~whereswaldon/arbor-dev

sprig: Updated Linux builds v1 APPLIED

~athorp96
This patch set contains the previous changes as well as the following
updates:

- Include the license in the build artifact
- Add two
common app categories to the desktop entry
- Template the icon
directory in the desktop entry
- Make the install script executable 
-
Default the install location to `/usr/local`
- Create install
destination directories if necessary

Thoughts and feedback
appreciated.

Cheers,

Andrew Thorp

Andrew Thorp (1):
  Add install script and resources to linux build

 Makefile                     |  3 ++-
 desktop-assets/sprig.desktop |  4 ++--
 install-linux.sh             | 27 +++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100755 install-linux.sh

-- 
2.26.2
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/11467/mbox | git am -3
Learn more about email & git
View this thread in the archives

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

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

Use dedicated install script

Template icon path
Install globally
Add more common app categories

Add license
---
 Makefile                     |  3 ++-
 desktop-assets/sprig.desktop |  4 ++--
 install-linux.sh             | 27 +++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100755 install-linux.sh

diff --git a/Makefile b/Makefile
index 22bfaee..1a0a91b 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 ./LICENSE.txt

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/desktop-assets/sprig.desktop b/desktop-assets/sprig.desktop
index 136df23..ec8770b 100644
--- a/desktop-assets/sprig.desktop
+++ b/desktop-assets/sprig.desktop
@@ -4,5 +4,5 @@ Name=Sprig
Exec=sprig
Terminal=false
Type=Application
Icon=Arbor
Categories=Chat;
Icon={ICON_PATH}/sprig.png
Categories=Chat;Network;InstantMessaging;
diff --git a/install-linux.sh b/install-linux.sh
new file mode 100755
index 0000000..bd69fa2
--- /dev/null
+++ b/install-linux.sh
@@ -0,0 +1,27 @@
#!/bin/bash

set -euo pipefail

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

PREFIX=/usr/local
BIN_DIR=$PREFIX/bin
APP_DIR=$PREFIX/share/applications
ICON_DIR=$PREFIX/share/icons

if [ ! -d $BIN_DIR ]; then
    mkdir -pv $BIN_DIR
fi
cp -v "$BASEDIR/sprig" "$PREFIX/bin/sprig"

if [ ! -d $APP_DIR ]; then
    mkdir -pv $APP_DIR
fi
# Update icon path in desktop entry
sed -i "s#{ICON_PATH}#$ICON_DIR#" $BASEDIR/desktop-assets/sprig.desktop
cp -v "$BASEDIR/desktop-assets/sprig.desktop" "$PREFIX/share/applications/"

if [ ! -d $ICON_DIR ]; then
    mkdir -pv $ICON_DIR
fi
cp -v "$BASEDIR/appicon.png" "$PREFIX/share/icons/sprig.png"
-- 
2.26.2