summarylogtreecommitdiffstats
path: root/Makefile.2.pre.release.7.patch
blob: 238422dfde61bd18677dc432fd79abde50e50345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/Makefile b/Makefile
index 1ede1854..c5021977 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,13 @@ LISP ?= sbcl
 ## We use --non-interactive with SBCL so that errors don't interrupt the CI.
 LISP_FLAGS ?= --no-userinit --non-interactive
 
-NYXT_INTERNAL_QUICKLISP=true
-NYXT_RENDERER=gi-gtk
+NYXT_INTERNAL_QUICKLISP = true
+NYXT_RENDERER = gi-gtk
+
+PREFIX = /usr/local
+prefix = $(PREFIX)
+BINDIR = $(PREFIX)/bin
+DATADIR = $(PREFIX)/share
 
 .PHONY: help
 help:
@@ -60,7 +65,25 @@ ifeq ($(UNAME), Darwin)
 all: nyxt app-bundle
 endif
 
+.PHONY: install-assets
+install-assets:
+	mkdir -p "$(DESTDIR)$(DATADIR)/applications/"
+	sed "s/VERSION/$$(git describe --tags)/" assets/nyxt.desktop > "$(DESTDIR)$(DATADIR)/applications/nyxt.desktop"
+	for i in 16 32 128 256 512; do \
+		mkdir -p "$(DESTDIR)$(DATADIR)/icons/hicolor/$${i}x$${i}/apps/" ; \
+		cp -f assets/nyxt_$${i}x$${i}.png "$(DESTDIR)$(DATADIR)/icons/hicolor/$${i}x$${i}/apps/nyxt.png" ; \
+		done
+
+.PHONY: install-nyxt
+install-nyxt: nyxt
+	mkdir -p "$(DESTDIR)$(BINDIR)"
+	cp -f $< "$(DESTDIR)$(BINDIR)/"
+	chmod 755 "$(DESTDIR)$(BINDIR)/"$<
+
 .PHONY: install
+ifeq ($(UNAME), Linux)
+install: install-nyxt install-assets
+endif
 ifeq ($(UNAME), Darwin)
 install: install-app-bundle
 else