]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
build: add make convenience wrapper for guix scripts
authortobtoht <tob@featherwallet.org>
Mon, 4 Nov 2024 17:19:56 +0000 (18:19 +0100)
committertobtoht <tob@featherwallet.org>
Mon, 4 Nov 2024 17:19:56 +0000 (18:19 +0100)
Makefile [new file with mode: 0644]
contrib/guix/guix-attest
contrib/guix/guix-codesign
contrib/guix/guix-verify

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..eee37bb
--- /dev/null
+++ b/Makefile
@@ -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
index e9a0b817a54ddbd1d4bac10f117583b501812ab7..fa2fbe1a4d0e3cbb5fb8009736ed1f900a06fba8 100755 (executable)
@@ -66,9 +66,50 @@ Example w/o signing, just creating SHA256SUMS:
 EOF
 }
 
-if [ -z "$GUIX_SIGS_REPO" ] || [ -z "$SIGNER" ]; then
-    cmd_usage
-    exit 1
+if [ -z "${GUIX_SIGS_REPO}" ]; then
+    echo "[HINT] Fork and clone the feather-sigs repo, if you haven't already:"
+    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
 
 ################
index ad08df0985e2dd1ed03292c2a673350ff5d70cab..4afd5b02031caac01a99fa05f9f94cc46d76923b 100755 (executable)
@@ -35,8 +35,22 @@ EOF
 }
 
 if [ -z "$GUIX_SIGS_REPO" ]; then
-    cmd_usage
-    exit 1
+    echo "[HINT] Fork and clone the feather-sigs repo:"
+    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
 
 ################
@@ -73,7 +87,7 @@ fi
 
 if ! git -C "$GUIX_SIGS_REPO" diff-index --quiet HEAD -- && [ -z "$FORCE_DIRTY_WORKTREE" ]; then
     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...
 
index 02fc6f23dea6885311b1599d43718783a8aef60d..440228aadb1a7007a976a0b6605683eca69825b4 100755 (executable)
@@ -37,9 +37,19 @@ Example overriding signer's manifest to use as base
 EOF
 }
 
-if [ -z "$GUIX_SIGS_REPO" ]; then
-    cmd_usage
-    exit 1
+if [ -z "${GUIX_SIGS_REPO}" ]; then
+    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 verify"
+    echo ""
 fi
 
 ################