-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathdev.paperback.desktop.yaml
More file actions
136 lines (129 loc) · 4.61 KB
/
Copy pathdev.paperback.desktop.yaml
File metadata and controls
136 lines (129 loc) · 4.61 KB
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
133
134
135
136
app-id: dev.paperback.desktop
runtime: org.gnome.Platform
runtime-version: '50'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.llvm21
command: paperback
finish-args:
# Filesystem access to open documents
- --filesystem=home
# X11 and Wayland display
- --socket=x11
- --socket=wayland
# GPU acceleration
- --device=dri
# Access to network for update checks and external links
- --share=network
# IPC for accessibility
- --share=ipc
cleanup:
- /include
- /lib/cmake
- /lib/pkgconfig
- /share/bakefile
- /share/man
- /bin/wx-config
- '*.la'
- '*.a'
modules:
# wxWidgets 3.3.2 - GUI toolkit (required by wxDragon 0.9.14)
- name: wxwidgets
sources:
- type: archive
url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.3.2/wxWidgets-3.3.2.tar.bz2
sha256: 50a28cb668de47b0e006cd6ebed8cf4f76c1cac6116fb3c978c44478219103f2
config-opts:
- --enable-shared
- --with-gtk=3
- --without-opengl
- --enable-display
- --enable-propgrid
- --enable-stc
- --with-libjpeg
- --with-libpng
- --with-zlib
- --enable-webview
- --disable-ribbon
cleanup:
- /bin/wxrc*
# pandoc - Documentation build tool (build-time only)
- name: pandoc
buildsystem: simple
build-commands:
- install -Dm755 pandoc-3.8.2.1/bin/pandoc /app/bin/pandoc
cleanup:
- /bin/pandoc
sources:
- type: archive
url: https://github.com/jgm/pandoc/releases/download/3.8.2.1/pandoc-3.8.2.1-linux-amd64.tar.gz
sha256: b362815e21d8ad3629c124aa92baf54558da086ad72374b4f6fdd97b9f3275b0
strip-components: 0
# SDL2 - needed by wxWidgets sound backend (wxdragon-sys builds wxWidgets with SDL support)
- name: SDL2
buildsystem: cmake-ninja
builddir: true
config-opts:
- -DSDL_STATIC=OFF
- -DSDL_TEST=OFF
sources:
- type: archive
url: https://github.com/libsdl-org/SDL/releases/download/release-2.32.6/SDL2-2.32.6.tar.gz
sha256: 6a7a40d6c2e00016791815e1a9f4042809210bdf10cc78d2c75b45c4f52f93ad
cleanup:
- /bin
- /include
- /share
# pdfium - PDF rendering library (pre-built binaries)
- name: pdfium
buildsystem: simple
sources:
- type: archive
url: https://github.com/bblanchon/pdfium-binaries/releases/download/chromium/7749/pdfium-linux-x64.tgz
sha256: 735abb28af7deab720dc54c8df3673a0a2a57bae9a0b16288842695fbd90a4b9
build-commands:
- install -Dm644 libpdfium.so -t /app/lib/
# paperback - Main application
- name: paperback
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm21/bin:/app/bin
env:
CARGO_HOME: /run/build/paperback/cargo
WXWIDGETS_DIR: /run/build/paperback/wxWidgets-extracted
LIBCLANG_PATH: /usr/lib/sdk/llvm21/lib
PAPERBACK_COMMIT_HASH: flatpak
RUSTFLAGS: -L/app/lib -lSDL2
build-commands:
# Extract wxWidgets source for wxdragon-sys
- unzip -qo wxWidgets-3.3.2.zip -d wxWidgets-extracted
# wxdragon-sys 0.9.14 natively respects WXWIDGETS_DIR env var, no patching needed
# Build with cargo
- cargo build --release --offline
# Install binary
- install -Dm755 target/release/paperback /app/bin/paperback
# Install translations (remove conflicting files from wxWidgets first)
- |
if [ -d target/release/langs ]; then
mkdir -p /app/share/locale
for lang in target/release/langs/*; do
langname=$(basename "$lang")
rm -rf "/app/share/locale/$langname"
cp -r "$lang" "/app/share/locale/"
done
fi
# Install desktop file
- install -Dm644 paperback.desktop /app/share/applications/dev.paperback.desktop.desktop
# Update Icon field in desktop file to use app-id
- sed -i 's/Icon=paperback/Icon=dev.paperback.desktop/' /app/share/applications/dev.paperback.desktop.desktop
# Install icons
- for size in 16 32 48 64 128 256; do if [ -f icons/hicolor/${size}x${size}/apps/paperback.png ]; then install -Dm644 icons/hicolor/${size}x${size}/apps/paperback.png /app/share/icons/hicolor/${size}x${size}/apps/dev.paperback.desktop.png; fi; done
sources:
- type: dir
path: .
- cargo-sources.json
# wxWidgets source for wxdragon-sys (normally downloads at build time)
- type: file
url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.3.2/wxWidgets-3.3.2.zip
sha256: f6a56de6d8fb55317230fba4ef64f81a646ad6f8c439d2710d98750493a8a569