commit ae714772c38410a0169f2c76a14a64a62c0daff0 parent fd5d1dab4f4aed84b6cfacc3a2ee845f7bb9a91b Author: Axel Gembe <derago@gmail.com> Date: Sun, 23 Jun 2019 02:40:29 +0200 AppImage: Make build reproducible We build our own mksquashfs from squashfskit which supports generating reproducible squashfs images. We use a small wrapper script to remove the -mkfs-fixed-time which appimagekit passes but squashfskits mksquashfs does not support. ----- taken from Electron-Cash/Electron-Cash@dd1f106f4f500fbf993094cf73da89a5745a0e2c see AppImage/AppImageKit#929 Diffstat:
M | contrib/build-linux/appimage/build.sh | | | 20 | +++++++++++++++++++- |
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/contrib/build-linux/appimage/build.sh b/contrib/build-linux/appimage/build.sh @@ -14,6 +14,7 @@ CACHEDIR="$CONTRIB_APPIMAGE/.cache/appimage" PYTHON_VERSION=3.6.8 PKG2APPIMAGE_COMMIT="eb8f3acdd9f11ab19b78f5cb15daa772367daf15" LIBSECP_VERSION="b408c6a8b287003d1ade5709e6f7bc3c7f1d5be7" +SQUASHFSKIT_COMMIT="ae0d656efa2d0df2fcac795b6823b44462f19386" VERSION=`git describe --tags --dirty --always` @@ -55,6 +56,16 @@ tar xf "$CACHEDIR/Python-$PYTHON_VERSION.tar.xz" -C "$BUILDDIR" ) +info "Building squashfskit" +git clone "https://github.com/squashfskit/squashfskit.git" "$BUILDDIR/squashfskit" +( + cd "$BUILDDIR/squashfskit" + git checkout "$SQUASHFSKIT_COMMIT" + make -C squashfs-tools mksquashfs +) +MKSQUASHFS="$BUILDDIR/squashfskit/squashfs-tools/mksquashfs" + + info "building libsecp256k1." ( git clone https://github.com/bitcoin-core/secp256k1 "$CACHEDIR"/secp256k1 \ @@ -203,7 +214,14 @@ info "creating the AppImage." cd "$BUILDDIR" chmod +x "$CACHEDIR/appimagetool" "$CACHEDIR/appimagetool" --appimage-extract - env VERSION="$VERSION" ARCH=x86_64 ./squashfs-root/AppRun --no-appstream --verbose "$APPDIR" "$APPIMAGE" + # We build a small wrapper for mksquashfs that removes the -mkfs-fixed-time option + # that mksquashfs from squashfskit does not support. It is not needed for squashfskit. + cat > ./squashfs-root/usr/lib/appimagekit/mksquashfs << EOF +#!/bin/sh +args=\$(echo "\$@" | sed -e 's/-mkfs-fixed-time 0//') +"$MKSQUASHFS" \$args +EOF + env VERSION="$VERSION" ARCH=x86_64 SOURCE_DATE_EPOCH=1530212462 ./squashfs-root/AppRun --no-appstream --verbose "$APPDIR" "$APPIMAGE" )