-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathio.github.xfuentes.smart-video-processor.yml
More file actions
287 lines (285 loc) · 15.1 KB
/
Copy pathio.github.xfuentes.smart-video-processor.yml
File metadata and controls
287 lines (285 loc) · 15.1 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
app-id: io.github.xfuentes.smart-video-processor
runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.node22
add-extensions:
org.freedesktop.Platform.ffmpeg-full:
version: '25.08'
directory: lib/ffmpeg
add-ld-path: lib
base: org.electronjs.Electron2.BaseApp
base-version: '25.08'
separate-locales: false
command: io.github.xfuentes.smart-video-processor
finish-args:
- --share=ipc
- --socket=fallback-x11
- --socket=pulseaudio
- --own-name=org.mpris.MediaPlayer2.* # allow media control from the system when playing a video
- --device=dri
- --share=network
- --socket=wayland
- --env=ELECTRON_TRASH=gio
- --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons
modules:
- name: mkvmerge-x86_64
only-arches:
- x86_64
buildsystem: simple
build-commands:
- |
set -e
mkdir -p deb
for deb in *.deb; do
b=$(basename "$deb" .deb)
mkdir -p "deb/$b"
(cd "deb/$b" && ar x "../../$deb" && tar -xf data.tar.*)
done
mkdir -p /app/bin /app/lib
MKVMERGE=$(find "$PWD/deb" -type f -name mkvmerge | head -1)
install -Dm755 "$MKVMERGE" /app/bin/mkvmerge
# Collect all libraries required by the prebuilt binary and copy only
# those to /app/lib, ignoring base runtime libraries.
DEB_LIB_DIR=$(find "$PWD/deb" -type d -name 'x86_64-linux-gnu' | tr '\n' ':')
SKIP_RE="linux-vdso|ld-linux|libc\.so|libm\.so|libpthread\.so|libdl\.so|librt\.so|libgcc_s\.so|libstdc\+\+\.so|libmvec\.so|libglib-2\.0|libgobject-2\.0|libgio-2\.0|libgmodule-2\.0|libgthread-2\.0|libpcre2-.*\.so"
export LD_LIBRARY_PATH="$DEB_LIB_DIR"
ldd /app/bin/mkvmerge 2>/dev/null | grep -oE '/[^ ]+\.so\.[^ ]+' > /tmp/mkvmerge.0
for i in 1 2 3 4 5; do
while IFS= read -r lib; do
ldd "$lib" 2>/dev/null | grep -oE '/[^ ]+\.so\.[^ ]+'
done < /tmp/mkvmerge.$((i-1)) | sort -u > /tmp/mkvmerge.$i
done
sort -u /tmp/mkvmerge.* | while IFS= read -r lib; do
[ -z "$lib" ] && continue
base=$(basename "$lib")
echo "$base" | grep -Eq "$SKIP_RE" && continue
[ -f "/app/lib/$base" ] && continue
[ -f "$lib" ] && cp -L "$lib" "/app/lib/$base"
done
sources:
- type: file
url: https://mkvtoolnix.download/debian/pool/bookworm/main/m/mkvtoolnix/mkvtoolnix_101.0-0~debian12bunkus01_amd64.deb
dest-filename: mkvtoolnix_101.0-0~debian12bunkus01_amd64.deb
sha256: ecffa3205c09e6a005228f9994dce121c01c17a953f8b358f1ee71eb3e94b43d
- type: file
url: http://deb.debian.org/debian/pool/main/b/boost1.74/libboost-filesystem1.74.0_1.74.0%2bds1-21_amd64.deb
dest-filename: libboost-filesystem1.74.0_1.74.0+ds1-21_amd64.deb
sha256: 3e80caec26a4ee663dc2e4fdaf10b0f03308284f7e44248290b8dd18de4ca237
- type: file
url: http://deb.debian.org/debian/pool/main/f/flac/libflac12_1.4.2%2bds-2_amd64.deb
dest-filename: libflac12_1.4.2+ds-2_amd64.deb
sha256: 4d8431c274eef13ec9ee2c0bf988c34b4342367dec053b7f69a432525be5b1fe
- type: file
url: http://deb.debian.org/debian/pool/main/f/fmtlib/libfmt9_9.1.0%2bds1-2_amd64.deb
dest-filename: libfmt9_9.1.0+ds1-2_amd64.deb
sha256: c3d405b6eabb1a521b60a57509826707f0e6f92b41cdfaae06bf1d7c37da2166
- type: file
url: http://deb.debian.org/debian/pool/main/g/gmp/libgmp10_6.2.1%2bdfsg1-1.1_amd64.deb
dest-filename: libgmp10_2%3a6.2.1+dfsg1-1.1_amd64.deb
sha256: 187aedef2ed763f425c1e523753b9719677633c7eede660401739e9c893482bd
- type: file
url: http://deb.debian.org/debian/pool/main/i/icu/libicu72_72.1-3%2bdeb12u1_amd64.deb
dest-filename: libicu72_72.1-3+deb12u1_amd64.deb
sha256: f7f6f99c6d7b025914df2447fc93e11d22c44c0c8bdd8b6f36691c9e7ddcef88
- type: file
url: http://deb.debian.org/debian/pool/main/libb/libb2/libb2-1_0.98.1-1.1_amd64.deb
dest-filename: libb2-1_0.98.1-1.1_amd64.deb
sha256: 322be801ee9051f34cc4f09512222bac1f0918e32da3a2bd12eddc51cd2df653
- type: file
url: http://deb.debian.org/debian/pool/main/libd/libdvdread/libdvdread8_6.1.3-1_amd64.deb
dest-filename: libdvdread8_6.1.3-1_amd64.deb
sha256: 7d06effc2a930cc8d737adcb56486cc8315ac216f917f5550360bcb2396aa738
- type: file
url: http://deb.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.7-1_amd64.deb
dest-filename: libvorbis0a_1.3.7-1_amd64.deb
sha256: 01c14f9d1109650077a4c5c337c285476a6932d4d448f5a190c2b845724dbf21
- type: file
url: http://deb.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.5-3_amd64.deb
dest-filename: libogg0_1.3.5-3_amd64.deb
sha256: f67acb0477aed0354f411172e37af338f3ac6bd4f3766134a2cf5539884b5a28
- type: file
url: http://deb.debian.org/debian/pool/main/q/qt6-base/libqt6core6_6.4.2%2bdfsg-10_amd64.deb
dest-filename: libqt6core6_6.4.2+dfsg-10_amd64.deb
sha256: 2849e8e686c3f7a1b60ad30373b64d6be33003f4b80953eacf331901c20beeb7
- type: file
url: http://deb.debian.org/debian/pool/main/d/double-conversion/libdouble-conversion3_3.2.1-1_amd64.deb
dest-filename: libdouble-conversion3_3.2.1-1_amd64.deb
sha256: 802b880ed900e4a8d54bab77b7551a7f3408b04891c3e5650fdc2368cc1fbc0a
- type: file
url: http://deb.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.74.6-2%2bdeb12u9_amd64.deb
dest-filename: libglib2.0-0_2.74.6-2+deb12u9_amd64.deb
sha256: 7ff85197685d89e150e342b29a59aab1beee400050ba7da73de81cd999ffee5a
- type: file
url: http://deb.debian.org/debian/pool/main/p/pcre2/libpcre2-16-0_10.42-1_amd64.deb
dest-filename: libpcre2-16-0_10.42-1_amd64.deb
sha256: 53892097cf102ecd8f133ccd3f1f6be6f288c6ffeeeacf6ce081dfee15292675
- type: file
url: http://deb.debian.org/debian/pool/main/p/pcre2/libpcre2-8-0_10.42-1_amd64.deb
dest-filename: libpcre2-8-0_10.42-1_amd64.deb
sha256: 030db54f4d76cdfe2bf0e8eb5f9efea0233ab3c7aa942d672c7b63b52dbaf935
- type: file
url: http://deb.debian.org/debian/pool/main/libz/libzstd/libzstd1_1.5.4%2bdfsg2-5_amd64.deb
dest-filename: libzstd1_1.5.4+dfsg2-5_amd64.deb
sha256: 6315b5ac38b724a710fb96bf1042019398cb656718b1522279a5185ed39318fa
- type: file
url: http://deb.debian.org/debian/pool/main/g/gcc-12/libgomp1_12.2.0-14%2bdeb12u1_amd64.deb
dest-filename: libgomp1_12.2.0-14+deb12u1_amd64.deb
sha256: 48fec46bda7f5b1638b9e959889bfbc20491247d402d120bb152687eb48143d7
- type: file
url: http://deb.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_amd64.deb
dest-filename: zlib1g_1%3a1.2.13.dfsg-1_amd64.deb
sha256: d7dd1d1411fedf27f5e27650a6eff20ef294077b568f4c8c5e51466dc7c08ce4
- name: mkvmerge-aarch64
only-arches:
- aarch64
buildsystem: simple
build-commands:
- |
set -e
mkdir -p deb
for deb in *.deb; do
b=$(basename "$deb" .deb)
mkdir -p "deb/$b"
(cd "deb/$b" && ar x "../../$deb" && tar -xf data.tar.*)
done
mkdir -p /app/bin /app/lib
MKVMERGE=$(find "$PWD/deb" -type f -name mkvmerge | head -1)
install -Dm755 "$MKVMERGE" /app/bin/mkvmerge
# Collect all libraries required by the prebuilt binary and copy only
# those to /app/lib, ignoring base runtime libraries.
DEB_LIB_DIR=$(find "$PWD/deb" -type d -name 'aarch64-linux-gnu' | tr '\n' ':')
SKIP_RE="linux-vdso|ld-linux|libc\.so|libm\.so|libpthread\.so|libdl\.so|librt\.so|libgcc_s\.so|libstdc\+\+\.so|libmvec\.so|libglib-2\.0|libgobject-2\.0|libgio-2\.0|libgmodule-2\.0|libgthread-2\.0|libpcre2-.*\.so"
export LD_LIBRARY_PATH="$DEB_LIB_DIR"
ldd /app/bin/mkvmerge 2>/dev/null | grep -oE '/[^ ]+\.so\.[^ ]+' > /tmp/mkvmerge.0
for i in 1 2 3 4 5; do
while IFS= read -r lib; do
ldd "$lib" 2>/dev/null | grep -oE '/[^ ]+\.so\.[^ ]+'
done < /tmp/mkvmerge.$((i-1)) | sort -u > /tmp/mkvmerge.$i
done
sort -u /tmp/mkvmerge.* | while IFS= read -r lib; do
[ -z "$lib" ] && continue
base=$(basename "$lib")
echo "$base" | grep -Eq "$SKIP_RE" && continue
[ -f "/app/lib/$base" ] && continue
[ -f "$lib" ] && cp -L "$lib" "/app/lib/$base"
done
sources:
- type: file
url: https://mkvtoolnix.download/debian/pool/bookworm/main/m/mkvtoolnix/mkvtoolnix_101.0-0~debian12bunkus01_arm64.deb
dest-filename: mkvtoolnix_101.0-0~debian12bunkus01_arm64.deb
sha256: a39376b19794d0f9d1474d481115f934caeca8714f09617fa72beac666fac84c
- type: file
url: http://deb.debian.org/debian/pool/main/b/boost1.74/libboost-filesystem1.74.0_1.74.0%2bds1-21_arm64.deb
dest-filename: libboost-filesystem1.74.0_1.74.0+ds1-21_arm64.deb
sha256: 486dd6442b5562ac197efd05d1f067d175e4c361212d1df757755f50a9c93fe0
- type: file
url: http://deb.debian.org/debian/pool/main/f/flac/libflac12_1.4.2%2bds-2_arm64.deb
dest-filename: libflac12_1.4.2+ds-2_arm64.deb
sha256: 338f78e2a140ed4ffca36d4240a7fc6f7867999bea000762a0c1b3924245a868
- type: file
url: http://deb.debian.org/debian/pool/main/f/fmtlib/libfmt9_9.1.0%2bds1-2_arm64.deb
dest-filename: libfmt9_9.1.0+ds1-2_arm64.deb
sha256: 7d4f191b968e33c491b252bae91b5f67737c01b8946bda98d1a13d4bac65a0f2
- type: file
url: http://deb.debian.org/debian/pool/main/g/gmp/libgmp10_6.2.1%2bdfsg1-1.1_arm64.deb
dest-filename: libgmp10_2%3a6.2.1+dfsg1-1.1_arm64.deb
sha256: 9906387c1dd806518c915bd8616d072c741061d7fa26b222e52763456060b31a
- type: file
url: http://deb.debian.org/debian/pool/main/i/icu/libicu72_72.1-3%2bdeb12u1_arm64.deb
dest-filename: libicu72_72.1-3+deb12u1_arm64.deb
sha256: 4f5d892fd81110435e45ed0a5f1b12899d7ff989d51db283cbc043f5631646d8
- type: file
url: http://deb.debian.org/debian/pool/main/libb/libb2/libb2-1_0.98.1-1.1_arm64.deb
dest-filename: libb2-1_0.98.1-1.1_arm64.deb
sha256: 7e81c630e6e5835ac36ec915a46c2c60407be3ad12378ea1c466fff7b8ca1bb6
- type: file
url: http://deb.debian.org/debian/pool/main/libd/libdvdread/libdvdread8_6.1.3-1_arm64.deb
dest-filename: libdvdread8_6.1.3-1_arm64.deb
sha256: f863417b3cf98127e0ab210fb0173c46de0aba56e6df20f8fe9851bda784db9f
- type: file
url: http://deb.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.7-1_arm64.deb
dest-filename: libvorbis0a_1.3.7-1_arm64.deb
sha256: 2f902ae456bcada7b0d494d7bd7c994feb81c4158209d8a12c0b2d9e255edda7
- type: file
url: http://deb.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.5-3_arm64.deb
dest-filename: libogg0_1.3.5-3_arm64.deb
sha256: 1a3e6c2a934a4099dcd982785d1563212fc6ad20f021a6f06aa0d6e6582416d3
- type: file
url: http://deb.debian.org/debian/pool/main/q/qt6-base/libqt6core6_6.4.2%2bdfsg-10_arm64.deb
dest-filename: libqt6core6_6.4.2+dfsg-10_arm64.deb
sha256: 3447d2ba935f8b4b826f338baf6349d9ec6aeba2b98c8507d59e8c15b809588c
- type: file
url: http://deb.debian.org/debian/pool/main/d/double-conversion/libdouble-conversion3_3.2.1-1_arm64.deb
dest-filename: libdouble-conversion3_3.2.1-1_arm64.deb
sha256: 84ce970692c83dcad802d5250dec44056b92d4f0ad5a8d40c5e41906f61100af
- type: file
url: http://deb.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.74.6-2%2bdeb12u9_arm64.deb
dest-filename: libglib2.0-0_2.74.6-2+deb12u9_arm64.deb
sha256: 61d92fffada7e27fc0ed9d23e047b45bca3b2e3bfe1a918f4ec16559282859f4
- type: file
url: http://deb.debian.org/debian/pool/main/p/pcre2/libpcre2-16-0_10.42-1_arm64.deb
dest-filename: libpcre2-16-0_10.42-1_arm64.deb
sha256: f4f08df15ba9faa2e74028212a0a7f5c6dc723d3ef3a71a923917a70aae0f3fe
- type: file
url: http://deb.debian.org/debian/pool/main/p/pcre2/libpcre2-8-0_10.42-1_arm64.deb
dest-filename: libpcre2-8-0_10.42-1_arm64.deb
sha256: b2448d0a8a3db7fbeac231e7ef93811346c1fb5f96ccf6f631701d8a4eb39206
- type: file
url: http://deb.debian.org/debian/pool/main/libz/libzstd/libzstd1_1.5.4%2bdfsg2-5_arm64.deb
dest-filename: libzstd1_1.5.4+dfsg2-5_arm64.deb
sha256: 95e173c9538f96ede4fc275ec7863f395a97dd0ea62454be9bc914efa1b9be93
- type: file
url: http://deb.debian.org/debian/pool/main/g/gcc-12/libgomp1_12.2.0-14%2bdeb12u1_arm64.deb
dest-filename: libgomp1_12.2.0-14+deb12u1_arm64.deb
sha256: a48b70dd1a95585466b40bd94564bce56ebcb2566e49ccdb6441e996aaab2098
- type: file
url: http://deb.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb
dest-filename: zlib1g_1%3a1.2.13.dfsg-1_arm64.deb
sha256: 52b8b8a145bbe1956bba82034f77022cbef0c3d0885c9e32d9817a7932fe1913
- name: smart-video-processor
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/node22/bin
env:
XDG_CACHE_HOME: /run/build/smart-video-processor/flatpak-node/cache
npm_config_cache: /run/build/smart-video-processor/flatpak-node/npm-cache
npm_config_offline: 'true'
npm_config_nodedir: /usr/lib/sdk/node22
ELECTRON_CACHE: /run/build/smart-video-processor/flatpak-node/cache/electron
build-commands:
- mkdir -p native/uwp-activation/build/Release
- sed -i "s/'dir', 'AppImage', 'tar.gz'/'dir'/g" electron-builder.ts
- npm ci --offline --no-audit --no-fund
- npm run build
- . flatpak-node/electron-builder-arch-args.sh
- npx electron-builder --linux $ELECTRON_BUILDER_ARCH_ARGS --dir --publish never
- rm -f dist/linux*unpacked/resources/bin/ffmpeg
- rm -f dist/linux*unpacked/resources/bin/ffprobe
- rm -f dist/linux*unpacked/resources/bin/mkvmerge
- install -d /app/lib/smart-video-processor
- cp -r dist/linux*unpacked/* /app/lib/smart-video-processor/
- node tools/configure.js ./flatpak
- install -Dm644 flatpak/io.github.xfuentes.smart-video-processor.desktop /app/share/applications/io.github.xfuentes.smart-video-processor.desktop
- install -Dm644 flatpak/io.github.xfuentes.smart-video-processor.metainfo.xml
/app/share/metainfo/io.github.xfuentes.smart-video-processor.metainfo.xml
- install -Dm644 resources/icon.svg /app/share/icons/hicolor/scalable/apps/io.github.xfuentes.smart-video-processor.svg
- install -Dm755 run.sh /app/bin/io.github.xfuentes.smart-video-processor
sources:
- type: git
url: https://github.com/xfuentes/smart-video-processor.git
tag: v1.9.4
commit: fb197979ff6fb52e94bc188235e5d7947ccf8acb
disable-lfs: true
x-checker-data:
type: git
tag-pattern: ^v(\d+\.\d+\.\d+)$
- generated-sources.json
- type: script
dest-filename: run.sh
commands:
- export PATH="/app/lib/ffmpeg/bin:$PATH"
- export FLATHUB=true
- exec zypak-wrapper /app/lib/smart-video-processor/smart-video-processor
"$@"