fix(misc): vendor linuxdeploy and appimagetool to have reproducible AppImage builds

This commit is contained in:
Federico Terzi 2022-03-27 21:21:11 +02:00
parent 4bb540b095
commit e4309a4d17
6 changed files with 53 additions and 21 deletions

View File

@ -1,36 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
TOOL_DIR=$(pwd)/target/linux/linuxdeploy
TARGET_DIR=$(pwd)/target/linux/AppImage TARGET_DIR=$(pwd)/target/linux/AppImage
BUILD_DIR=$TARGET_DIR/build BUILD_DIR=$TARGET_DIR/build
OUTPUT_DIR=$TARGET_DIR/out OUTPUT_DIR=$TARGET_DIR/out
BASE_DIR=$(pwd) BASE_DIR=$(pwd)
mkdir -p $TOOL_DIR
if ls $TOOL_DIR/linuxdeploy*.AppImage 1> /dev/null 2>&1; then
echo "Skipping download of linuxdeploy"
else
echo "Downloading linuxdeploy tool"
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -P "$TOOL_DIR"
chmod +x $TOOL_DIR/linuxdeploy*.AppImage
fi
if ls $TOOL_DIR/appimagetool*.AppImage 1> /dev/null 2>&1; then
echo "Skipping download of appimagetool"
else
echo "Downloading appimagetool"
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -P "$TOOL_DIR"
chmod +x $TOOL_DIR/appimagetool*.AppImage
fi
rm -Rf "$TARGET_DIR" rm -Rf "$TARGET_DIR"
mkdir -p $OUTPUT_DIR mkdir -p $OUTPUT_DIR
mkdir -p $BUILD_DIR mkdir -p $BUILD_DIR
echo Building AppImage into $OUTPUT_DIR echo Building AppImage into $OUTPUT_DIR
pushd $OUTPUT_DIR pushd $OUTPUT_DIR
$TOOL_DIR/linuxdeploy*.AppImage --appimage-extract-and-run -e "$BASE_DIR/$EXEC_PATH" \ $BASE_DIR/scripts/vendor-app-image/linuxdeploy*.AppImage --appimage-extract-and-run -e "$BASE_DIR/$EXEC_PATH" \
-d "$BASE_DIR/espanso/src/res/linux/espanso.desktop" \ -d "$BASE_DIR/espanso/src/res/linux/espanso.desktop" \
-i "$BASE_DIR/espanso/src/res/linux/icon.png" \ -i "$BASE_DIR/espanso/src/res/linux/icon.png" \
--appdir $BUILD_DIR \ --appdir $BUILD_DIR \
@ -45,7 +26,7 @@ echo "Applying patch for libgmodule"
./Espanso*.AppImage --appimage-extract ./Espanso*.AppImage --appimage-extract
rm -Rf ./Espanso*.AppImage rm -Rf ./Espanso*.AppImage
rm -Rf squashfs-root/usr/lib/libgmodule* rm -Rf squashfs-root/usr/lib/libgmodule*
$TOOL_DIR/appimagetool*.AppImage --appimage-extract-and-run -v squashfs-root $BASE_DIR/scripts/vendor-app-image/appimagetool*.AppImage --appimage-extract-and-run -v squashfs-root
rm -Rf squashfs-root rm -Rf squashfs-root
popd popd

View File

@ -0,0 +1,28 @@
MIT License
If not stated otherwise within the individual file or subdirectory, the
original source code in this repository is licensed as below. This does not
necessarily apply for all dependencies. For the sake of clarity, this license
does NOT apply to the contents of AppImages that anyone may create.
Software contained inside an AppImage may be licensed under any license at the
discretion of the respecive rights holder(s).
Copyright (c) 2004-20 Simon Peter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,19 @@
Copyright 2018 TheAssassin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,4 @@
I'm vendoring these build tools here to have reproducible builds, otherwise
we might run into these issues again:
* https://github.com/federico-terzi/espanso/issues/900

Binary file not shown.

Binary file not shown.