From 2ec4a05780aaeb00d43de006f2b314f96ebfde15 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 28 Jun 2023 20:23:37 +0200 Subject: [PATCH] build: debian package --- contrib/debian/control | 7 +++++++ contrib/debian/make_deb.sh | 36 +++++++++++++++++++++++++++++++++ contrib/flatpak/make_flatpak.sh | 4 ++-- contrib/guix/guix-build | 10 ++++----- contrib/guix/libexec/build.sh | 5 +---- 5 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 contrib/debian/control create mode 100644 contrib/debian/make_deb.sh diff --git a/contrib/debian/control b/contrib/debian/control new file mode 100644 index 0000000..f89824f --- /dev/null +++ b/contrib/debian/control @@ -0,0 +1,7 @@ +Package: feather +Version: VERSION +Description: Monero desktop wallet +Maintainer: tobtoht +Architecture: amd64 +Priority: optional +Section: misc diff --git a/contrib/debian/make_deb.sh b/contrib/debian/make_deb.sh new file mode 100644 index 0000000..7784833 --- /dev/null +++ b/contrib/debian/make_deb.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -ex + +mkdir -p /output/debian +cd /output/debian + +#. +#├── control.tar.gz +cp /feather/contrib/debian/control . +sed -i "s/VERSION/${VERSION}/" control +touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" control +tar -czvf control.tar.gz control +rm control + +#├── data.tar.gz +mkdir data +cd data + +mkdir -p usr/bin +cd usr/bin +# copy feather binary +cp /feather-bin feather +cd ../.. + +find . -print0 | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" +tar -czvf ../data.tar.gz . + +cd /output/debian +chmod -R 755 data +rm -rf data + +#└── debian-binary +echo "2.0" > debian-binary + +ar r "feather_${VERSION}-1_amd64.deb" debian-binary control.tar.gz data.tar.gz +rm debian-binary control.tar.gz data.tar.gz \ No newline at end of file diff --git a/contrib/flatpak/make_flatpak.sh b/contrib/flatpak/make_flatpak.sh index eeee508..ee691c8 100644 --- a/contrib/flatpak/make_flatpak.sh +++ b/contrib/flatpak/make_flatpak.sh @@ -24,8 +24,8 @@ cp /feather/contrib/flatpak/metadata . mkdir files cd files -# Extract feather binary -unzip /feather-zip +# Copy feather binary +cp /feather-bin feather # Copy metadata cp -a /feather/contrib/flatpak/share . diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index a977977..422ae9d 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -447,27 +447,27 @@ EOF case "$OPTIONS" in pack) - FEATHER_ZIP="$(outdir_for_host "$host")/${DISTNAME}-pack.zip" + FEATHER_BIN="$(outdir_for_host "$host")/feather" + export VERSION=${VERSION} time-machine pack -S /profile=. --manifest="${PWD}/contrib/guix/pack.scm" PACK=$(time-machine pack --manifest="${PWD}/contrib/guix/pack.scm") - time-machine pack -R --manifest="${PWD}/contrib/guix/pack.scm" - RPACK=$(time-machine pack -R --manifest="${PWD}/contrib/guix/pack.scm") time-machine environment --ad-hoc unzip tar gzip findutils grep patchelf coreutils-minimal bash binutils sed \ --container \ --pure \ --no-cwd \ --share="$PWD"=/feather \ --share="$PACK"=/pack \ - --share="$RPACK"=/rpack \ --share="$(outdir_for_host "$host")"=/output \ - --share="$FEATHER_ZIP"=/feather-zip \ + --share="$FEATHER_BIN"=/feather-bin \ --keep-failed \ --fallback \ --user="user" \ ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \ ${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \ -- env SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \ + VERSION="$VERSION" \ bash -c "cd /feather && \ + bash contrib/debian/make_deb.sh && \ bash contrib/flatpak/make_flatpak.sh" ;; esac diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 631495e..c138833 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -434,10 +434,7 @@ mkdir -p "$DISTSRC" else find . -print0 \ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" - find . \ - | sort \ - | zip -X@ "${OUTDIR}/${DISTNAME}-pack.zip" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-pack.zip" && exit 1 ) + cp feather "${OUTDIR}" fi ;; *darwin*)