forked from flathub/com.yacreader.YACReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcom.yacreader.YACReader.yml
132 lines (131 loc) · 6.46 KB
/
com.yacreader.YACReader.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
app-id: com.yacreader.YACReader
runtime: org.kde.Platform
runtime-version: "6.8"
sdk: org.kde.Sdk
command: YACReader
finish-args:
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
- --share=network
- --device=dri
- --filesystem=home
- --filesystem=/mnt
- --filesystem=/media
- --filesystem=/run/media
rename-desktop-file: YACReader.desktop
rename-icon: YACReader
cleanup:
- /bin/gn
- /include
- /lib/cmake
- /lib/pkgconfig
- /lib/systemd
- /share/doc
- /share/man
- "*.a"
- "*.la"
modules:
- name: yacreader
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=yacreader
buildsystem: qmake
config-opts:
- CONFIG+=unarr pdfium server_bundled
install-rule: null
make-install-args:
- sub-YACReader-install_subtargets
- sub-YACReaderLibrary-install_subtargets
post-install:
# fix YACReaderLibrary desktop file and icons
- mv "$FLATPAK_DEST"/share/applications/{YACReaderLibrary,com.yacreader.YACReader.YACReaderLibrary}.desktop
- mv "$FLATPAK_DEST"/share/icons/hicolor/scalable/apps/{YACReaderLibrary,com.yacreader.YACReader.YACReaderLibrary}.svg
- desktop-file-edit --set-icon=com.yacreader.YACReader.YACReaderLibrary "$FLATPAK_DEST"/share/applications/com.yacreader.YACReader.YACReaderLibrary.desktop
- install -D -m644 com.yacreader.YACReader.appdata.xml "$FLATPAK_DEST"/share/metainfo/com.yacreader.YACReader.appdata.xml
sources:
- type: git
url: https://github.com/YACReader/yacreader.git
tag: 9.14.2
- type: file
path: com.yacreader.YACReader.appdata.xml
modules:
- name: unarr
buildsystem: cmake-ninja
sources:
- type: git
url: https://github.com/selmf/unarr.git
tag: v1.1.1
- name: pdfium
buildsystem: simple
build-commands:
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=libpdfium-nojs
# Patch abseil build to be static
- sed -i -e 's/component(/static_library(/' -e 's/is_component_build(/false/' pdfium/third_party/abseil-cpp/BUILD.gn
# Use system provided icu library (unbundling)
- mkdir -p pdfium/third_party/icu
- ln -sf ../../build/linux/unbundle/icu.gn pdfium/third_party/icu/BUILD.gn
# Decode shim header script needed to unbundle icu (gittiles is weird)
- mkdir -p pdfium/tools/generate_shim_headers
- base64 --decode generate_shim_headers.py > pdfium/tools/generate_shim_headers/generate_shim_headers.py
# Create fake gclient_args.gni file to satisfy include list for build/config/compiler/compiler.gni
- touch pdfium/build/config/gclient_args.gni
# Exclude test fonts from build
- sed -i '/"\/\/third_party\/test_fonts",/s/^/#/g' pdfium/testing/BUILD.gn
# Remove cross-compile-toolchain-prefix for gcc (needed for aarch64 build)
- sed -i 's/"aarch64-linux-gnu-"/""/g' pdfium/build/toolchain/linux/BUILD.gn
# Use correct no-outline for gcc (needed for aarch64)
- sed -i 's/"-mno-outline"/"-mno-outline-atomics"/g' pdfium/build/config/compiler/BUILD.gn
# Build
- gn --root=pdfium gen pdfium/out/Release --args="is_clang=false use_sysroot=false is_debug=false symbol_level=0 pdf_enable_v8=false pdf_enable_xfa=false treat_warnings_as_errors=false use_system_libjpeg=true use_system_zlib=true pdf_bundle_freetype=false use_system_freetype=true use_system_lcms2=true use_system_libpng=true use_custom_libcxx=false pdf_is_standalone=true use_system_libopenjpeg2=true is_component_build=true pdf_use_partition_alloc=false"
- ninja -C pdfium/out/Release pdfium
# TODO: use a variable for version
- sed -e 's/@VERSION@/6167/g' -e 's#^\s*prefix\s*=.*$#prefix='"$FLATPAK_DEST"'#' -i libpdfium.pc
# Install
- install -D -m644 pdfium/LICENSE "$FLATPAK_DEST/share/licenses/pdfium/LICENSE"
- install -D pdfium/public/*.h --target-directory="$FLATPAK_DEST/include/pdfium"
- install -D pdfium/public/cpp/* --target-directory="$FLATPAK_DEST/include/pdfium/cpp"
- install -D pdfium/docs/* --target-directory="$FLATPAK_DEST/share/doc/pdfium"
- install -Dm755 pdfium/out/Release/libpdfium.so --target-directory="$FLATPAK_DEST/lib"
- install -Dm644 libpdfium.pc --target-directory="$FLATPAK_DEST/lib/pkgconfig"
sources:
- type: git
url: https://pdfium.googlesource.com/pdfium
# curl https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions/all/releases | grep 'version' | head -1 | cut -d'.' -f 3
# branch: chromium/6167
# TODO: Using commit instead of branch is suboptimal, but linting enforces it
commit: 7388bd02f160a35d06b58e57f6374780fe4bafd3
dest: pdfium
- type: git
url: https://chromium.googlesource.com/chromium/src/build.git
# awk '/build_revision/ {print substr($2,2,40)}' pdfium/DEPS
commit: 292639dc3d2fdf6fab10144ef52baf4c4c40993d
dest: pdfium/build
- type: git
url: https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp
# awk '/abseil_revision/ {print substr($2,2,40)}' pdfium/DEPS
commit: 16ed8d7d56105c49a0bbc04a428bf00dc7fadaf6
dest: pdfium/third_party/abseil-cpp
- type: file
url: https://chromium.googlesource.com/chromium/src/+/main/tools/generate_shim_headers/generate_shim_headers.py?format=TEXT
dest-filename: generate_shim_headers.py
sha256: c405eb998cc9c27d724c945f3db8a7b9d2be62ac38049301f4f52929f734b5a9
- type: file
url: https://aur.archlinux.org/cgit/aur.git/plain/libpdfium.pc?h=libpdfium-nojs
dest-filename: libpdfium.pc
sha256: 4e8cf32c09568ae4c59244f0a221eee8f87ea4a31ddb31f796a1d818c967d477
modules:
- name: gn
buildsystem: simple
build-options:
env:
# Set CC and CXX to override default (llvm) build settings
CC: gcc
CXX: g++
build-commands:
- ./build/gen.py
- ninja -C out gn
- install -Dm755 out/gn "$FLATPAK_DEST/bin/gn"
sources:
- type: git
url: https://gn.googlesource.com/gn
commit: 06cdcc8e1fa8e56f70efb4357d473345b7d1c083
disable-shallow-clone: true