~whereswaldon/arbor-dev

sprig: Add install script and resources to linux build v1 SUPERSEDED

~athorp96
~athorp96: 1
 Add install script and resources to linux build

 2 files changed, 14 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~whereswaldon/arbor-dev/patches/11454/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH sprig] Add install script and resources to linux build Export this patch

~athorp96
From: Andrew Thorp <andrew.thorp.dev@gmail.com>

Use dedicated install script
---
 Makefile         |  3 ++-
 install-linux.sh | 12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 install-linux.sh

diff --git a/Makefile b/Makefile
index 22bfaee..ca2eeb8 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ WINDOWS_ARCHIVE = sprig-windows.zip

LINUX_BIN = sprig
LINUX_ARCHIVE = sprig-linux.tar.xz
LINUX_FILES = $(LINUX_BIN) ./desktop-assets ./install-linux.sh ./appicon.png

MACOS_BIN = sprig-mac
MACOS_ARCHIVE = sprig-macos.tar.gz
@@ -36,7 +37,7 @@ $(WINDOWS_BIN): $(SOURCE)
linux: $(LINUX_ARCHIVE)

$(LINUX_ARCHIVE): $(LINUX_BIN)
	tar cJf $(LINUX_ARCHIVE) $(LINUX_BIN)
	tar -cJf $(LINUX_ARCHIVE) $(LINUX_FILES)

$(LINUX_BIN): $(SOURCE)
	env GOOS=linux go build -o $(LINUX_BIN) .
diff --git a/install-linux.sh b/install-linux.sh
new file mode 100644
index 0000000..1a8a892
--- /dev/null
+++ b/install-linux.sh
@@ -0,0 +1,12 @@
#!/bin/bash

set -euo pipefail

BASEDIR=$(dirname "$(realpath "$0")")

PREFIX=${PREFIX:-${XDG_DATA_HOME:-$HOME/.local/share}}
BIN_PREFIX=/usr/local/bin

cp -v "$BASEDIR/sprig" "$BIN_PREFIX/sprig"
cp -v "$BASEDIR/desktop-assets/sprig.desktop" "$PREFIX/applications/"
cp -v "$BASEDIR/appicon.png" "$PREFIX/icons/sprig.png"
-- 
2.26.2
Thanks for putting this together! A couple of notes/questions below:

On Fri Jul 3, 2020 at 7:23 PM EDT, ~athorp96 wrote: