aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Tomasino <james@tomasino.org>2020-06-11 11:25:15 +0000
committerJames Tomasino <james@tomasino.org>2020-06-11 11:25:15 +0000
commit4b860e437ae9a58fc8fa086c3f3fc08c5a7f7586 (patch)
tree6bb446afa54e30ba61fb1f40ae66c878d5aba228
parente8d1839a0d24d29c4d370ee1210d44d58b39129e (diff)
downloadkristall-4b860e437ae9a58fc8fa086c3f3fc08c5a7f7586.tar.gz
overhaul of Makefile for clean install with desktop file and icons
-rw-r--r--Kristall.desktop2
-rw-r--r--Makefile35
-rw-r--r--src/icons/kristall-128.pngbin0 -> 2805 bytes
-rw-r--r--src/icons/kristall-16.pngbin0 -> 455 bytes
-rw-r--r--src/icons/kristall-32.pngbin0 -> 965 bytes
-rw-r--r--src/icons/kristall-64.pngbin0 -> 1566 bytes
6 files changed, 31 insertions, 6 deletions
diff --git a/Kristall.desktop b/Kristall.desktop
index b398f6d..5e71387 100644
--- a/Kristall.desktop
+++ b/Kristall.desktop
@@ -3,7 +3,7 @@ Name=Kristall
GenericName=Kristall
Comment=Graphical gemini client
Categories=Network;
-Icon=kristall
+Icon=net.random-projects.kristall
Exec=kristall %u
Terminal=false
Type=Application
diff --git a/Makefile b/Makefile
index f6594f0..9052d51 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,16 @@
-PREFIX ?= /usr/local
-BINDIR ?= $(DESTDIR)$(PREFIX)/bin
+# Install to /usr/local unless otherwise specified, such as `make PREFIX=/app`
+PREFIX=/usr/local
-default: all
-all: kristall
+# What to run to install various files
+INSTALL=install -D
+# Run to install the actual binary
+INSTALL_PROGRAM=$(INSTALL)
+# Run to install application data, with differing permissions
+INSTALL_DATA=$(INSTALL) -m 644
+
+# Directories into which to install the various files
+bindir=$(DESTDIR)$(PREFIX)/bin
+sharedir=$(DESTDIR)$(PREFIX)/share
kristall: build/kristall
cp build/kristall $@
@@ -12,7 +20,24 @@ build/kristall:
cd build && qmake ../src/kristall.pro && $(MAKE)
install: kristall
- install -m 755 ./kristall $(BINDIR)/kristall
+ # Install icons
+ $(INSTALL_DATA) src/icons/kristall.svg $(sharedir)/icons/hicolor/scalable/apps/net.random-projects.kristall.svg
+ $(INSTALL_DATA) src/icons/kristall-16.png $(sharedir)/icons/hicolor/16x16/apps/net.random-projects.kristall.png
+ $(INSTALL_DATA) src/icons/kristall-32.png $(sharedir)/icons/hicolor/32x32/apps/net.random-projects.kristall.png
+ $(INSTALL_DATA) src/icons/kristall-64.png $(sharedir)/icons/hicolor/64x64/apps/net.random-projects.kristall.png
+ $(INSTALL_DATA) src/icons/kristall-128.png $(sharedir)/icons/hicolor/128x128/apps/net.random-projects.kristall.png
+ $(INSTALL_DATA) Kristall.desktop $(sharedir)/applications/Kristall.desktop
+ $(INSTALL_PROGRAM) kristall $(bindir)/kristall
+
+uninstall:
+ # Remove the .desktop
+ rm -f $(sharedir)/applications/Kristall.desktop
+ # Remove the icons
+ rm -f $(sharedir)/icons/hicolor/scalable/apps/net.random-projects.kristall.png
+ rm -f $(sharedir)/icons/hicolor/*x*/apps/net.random-projects.kristall.png
+ # Remove the binary
+ rm -f $(bindir)/kristall
+
clean:
rm -rf build
diff --git a/src/icons/kristall-128.png b/src/icons/kristall-128.png
new file mode 100644
index 0000000..85fd764
--- /dev/null
+++ b/src/icons/kristall-128.png
Binary files differ
diff --git a/src/icons/kristall-16.png b/src/icons/kristall-16.png
new file mode 100644
index 0000000..64cccbd
--- /dev/null
+++ b/src/icons/kristall-16.png
Binary files differ
diff --git a/src/icons/kristall-32.png b/src/icons/kristall-32.png
new file mode 100644
index 0000000..cb1e119
--- /dev/null
+++ b/src/icons/kristall-32.png
Binary files differ
diff --git a/src/icons/kristall-64.png b/src/icons/kristall-64.png
new file mode 100644
index 0000000..ca24c50
--- /dev/null
+++ b/src/icons/kristall-64.png
Binary files differ