Browse Source

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
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
Axel Gembe 6 years ago
committed by SomberNight
parent
commit
ae714772c3
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 20
      contrib/build-linux/appimage/build.sh

20
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"
)

Loading…
Cancel
Save