feather/contrib/build-appimage.sh

63 lines
2.4 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
2021-01-15 21:04:53 +00:00
unset SOURCE_DATE_EPOCH
APPDIR="$PWD/feather.AppDir"
2021-05-22 19:53:42 +00:00
rm -rf $APPDIR
mkdir -p "$APPDIR"
mkdir -p "$APPDIR/usr/share/applications/"
mkdir -p "$APPDIR/usr/bin"
2021-06-25 14:14:49 +00:00
mkdir -p "$APPDIR/usr/lib"
mkdir -p "$APPDIR/usr/plugins"
2021-05-22 19:53:42 +00:00
cp "$PWD/../src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop"
cp "$PWD/../src/assets/images/appicons/64x64.png" "$APPDIR/feather.png"
cp "$PWD/bin/feather" "$APPDIR/usr/bin/feather"
2021-06-25 14:14:49 +00:00
chmod +x "$APPDIR/usr/bin/feather"
2021-01-15 21:04:53 +00:00
2021-06-25 14:14:49 +00:00
export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu/:/usr/local/lib/$LD_LIBRARY_PATH
2021-07-09 16:39:47 +00:00
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs
2021-06-25 14:14:49 +00:00
pushd feather.AppDir/usr/plugins
ln -s ../lib/ gstreamer
popd
2021-07-09 16:39:47 +00:00
GST_PLUGINS=("libgstcamerabin.so libgstcoreelements.so libgstvolume.so libgstapp.so libgstvideoconvert.so
libgstvideoscale.so libgstvideo4linux2.so libgstencoding.so libgstmultifile.so libgstmatroska.so
libgstvpx.so libgstjpegformat.so libgstjpeg.so libgstautodetect.so libgstaudiotestsrc.so
libgstvorbis.so libgstaudiorate.so libgstaudioconvert.so libgstaudioresample.so libgstvideocrop.so")
for plugin in ${GST_PLUGINS[*]}; do
cp /usr/lib/x86_64-linux-gnu/gstreamer-1.0/$plugin feather.AppDir/usr/plugins/gstreamer/
# linuxdeployqt doesn't set RUNPATH on libs that are only loaded at runtime
patchelf --set-rpath "\$ORIGIN" feather.AppDir/usr/plugins/gstreamer/$plugin
done
2021-06-25 14:14:49 +00:00
cp /usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner feather.AppDir/usr/plugins/gstreamer/
2021-07-09 16:39:47 +00:00
# Need second deploy for gstreamer dependencies
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs
2021-06-25 14:14:49 +00:00
rm "$APPDIR/AppRun"
cp "$PWD/../contrib/AppImage/AppRun" "$APPDIR/"
chmod +x "$APPDIR/AppRun"
2021-01-15 21:04:53 +00:00
find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \;
# Manually create AppImage (reproducibly)
# download runtime
2021-06-25 14:14:49 +00:00
wget -nc https://github.com/AppImage/AppImageKit/releases/download/13/runtime-x86_64
echo "328e0d745c5c6817048c27bc3e8314871703f8f47ffa81a37cb06cd95a94b323 runtime-x86_64" | sha256sum -c
2021-01-15 21:04:53 +00:00
mksquashfs feather.AppDir feather.squashfs -info -root-owned -no-xattrs -noappend -fstime 0
# mksquashfs writes a timestamp to the header
printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8))
2021-01-15 21:04:53 +00:00
rm -f feather.AppImage
cat runtime-x86_64 >> feather.AppImage
cat feather.squashfs >> feather.AppImage
chmod a+x feather.AppImage