build: add make convenience wrapper for guix scripts

This commit is contained in:
tobtoht 2024-11-04 18:19:56 +01:00
parent d877523cce
commit 725ad63210
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
4 changed files with 93 additions and 9 deletions

19
Makefile Normal file
View file

@ -0,0 +1,19 @@
build:
@./contrib/guix/guix-build
codesign:
@./contrib/guix/guix-codesign
attest:
@./contrib/guix/guix-attest
verify:
@./contrib/guix/guix-attest
clean:
@./contrib/guix/guix-clean
DEFAULT_GOAL := default
default: build
.PHONY: default build attest verify clean

View file

@ -66,9 +66,50 @@ Example w/o signing, just creating SHA256SUMS:
EOF EOF
} }
if [ -z "$GUIX_SIGS_REPO" ] || [ -z "$SIGNER" ]; then if [ -z "${GUIX_SIGS_REPO}" ]; then
cmd_usage echo "[HINT] Fork and clone the feather-sigs repo, if you haven't already:"
exit 1 echo "https://github.com/feather-wallet/feather-sigs"
echo ""
printf "Enter path to 'feather-sigs' repo: "
read -r repo
if [ ! -d "${repo}" ]; then
echo "ERR: directory does not exist"
exit 1
fi
export GUIX_SIGS_REPO="$repo"
wizard=1
fi
if [ -z "${SIGNER}" ]; then
printf "Enter your GitHub username: "
read -r signer
if [ -z "$signer" ]; then
echo "ERR: signer name can't be empty"
exit 1
fi
echo ""
echo "[HINT] To find your GPG fingerprint use:"
echo "gpg --list-secret-keys --keyid-format=long"
echo "It should look like: E87BD921CDD885C9D78A38C5E45B10DD027D2472"
echo ""
printf "Enter fingerprint of your GPG key: "
read -r fingerprint
export SIGNER="${fingerprint}=${signer}"
wizard=1
fi
if [ -n "$wizard" ]; then
echo ""
echo "Next time, invoke this command as:"
echo "env GUIX_SIGS_REPO=${GUIX_SIGS_REPO} SIGNER=${SIGNER} make attest"
echo ""
fi fi
################ ################

View file

@ -35,8 +35,22 @@ EOF
} }
if [ -z "$GUIX_SIGS_REPO" ]; then if [ -z "$GUIX_SIGS_REPO" ]; then
cmd_usage echo "[HINT] Fork and clone the feather-sigs repo:"
exit 1 echo "https://github.com/feather-wallet/feather-sigs"
echo ""
printf "Enter path to 'feather-sigs' repo: "
read -r GUIX_SIGS_REPO
if [ ! -d "${GUIX_SIGS_REPO}" ]; then
echo "Directory does not exist"
exit 1
fi
echo ""
echo "Next time, invoke this command as:"
echo "env GUIX_SIGS_REPO=${GUIX_SIGS_REPO} make codesign"
echo ""
fi fi
################ ################
@ -73,7 +87,7 @@ fi
if ! git -C "$GUIX_SIGS_REPO" diff-index --quiet HEAD -- && [ -z "$FORCE_DIRTY_WORKTREE" ]; then if ! git -C "$GUIX_SIGS_REPO" diff-index --quiet HEAD -- && [ -z "$FORCE_DIRTY_WORKTREE" ]; then
cat << EOF cat << EOF
ERR: The DETACHED CODESIGNATURE git worktree is dirty, which may lead to broken builds. ERR: The FEATHER SIGS git worktree is dirty, which may lead to broken builds.
Aborting... Aborting...

View file

@ -37,9 +37,19 @@ Example overriding signer's manifest to use as base
EOF EOF
} }
if [ -z "$GUIX_SIGS_REPO" ]; then if [ -z "${GUIX_SIGS_REPO}" ]; then
cmd_usage printf "Enter path to 'feather-sigs' repo: "
exit 1 read -r GUIX_SIGS_REPO
if [ ! -d "${GUIX_SIGS_REPO}" ]; then
echo "Directory does not exist"
exit 1
fi
echo ""
echo "Next time, invoke this command as:"
echo "env GUIX_SIGS_REPO=${GUIX_SIGS_REPO} make verify"
echo ""
fi fi
################ ################