build: debian package

This commit is contained in:
tobtoht 2023-06-28 20:23:37 +02:00
parent 04f7fa16f7
commit 2ec4a05780
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
5 changed files with 51 additions and 11 deletions

7
contrib/debian/control Normal file
View file

@ -0,0 +1,7 @@
Package: feather
Version: VERSION
Description: Monero desktop wallet
Maintainer: tobtoht <tob@featherwallet.org>
Architecture: amd64
Priority: optional
Section: misc

View file

@ -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

View file

@ -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 .

View file

@ -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

View file

@ -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*)