summarylogtreecommitdiffstats
path: root/arch-package.patch
blob: 9e57e5d6fde342d3811218caa960ef983f5eaa32 (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
47
48
49
diff --git a/Makefile b/Makefile
index a89ceda..b7834d8 100644
--- a/Makefile
+++ b/Makefile
@@ -28,12 +28,12 @@ src := $(wildcard src/*.c)
 obj := $(src:.c=.o)
 dep := $(obj:.o=.d)
 mod := saulrh/xbindjoy.scm
-solib := libguilexbindjoy.so
+solib := guile-xbindjoy.so
 
 # compiler flags. we use pkg-config to get the includes for guile. set the variable dbg if we want
 # to compile with debug flags (default to none). ldflags pull in the libraries we need.
-CFLAGS := -std=c11 `pkg-config --cflags guile-2.0` -fPIC $(dbg)
-LDFLAGS := -lX11 -lXtst -lev `pkg-config --libs guile-2.0`
+CFLAGS += -std=c11 `pkg-config --cflags guile-2.2` -fPIC $(dbg)
+LDFLAGS += -lX11 -lXtst -lev `pkg-config --libs guile-2.2`
 
 # our final shared library.
 $(solib): $(obj)
@@ -55,8 +55,14 @@ test: $(solib)
 run: $(solib)
 	@LD_LIBRARY_PATH=. rlwrap guile -L . -x "saulrh xbindjoy" --
 
+install: $(solib)
+	install -d $(DESTDIR)$(PREFIX)/lib/guile/2.2/extensions/
+	install -m 644 $(solib) $(DESTDIR)$(PREFIX)/lib/guile/2.2/extensions/
+	install -d $(DESTDIR)$(PREFIX)/share/guile/site/2.2/saulrh/
+	install -m 644 $(mod) $(DESTDIR)$(PREFIX)/share/guile/site/2.2/saulrh/
+
 # clean out object files and compilation products
 .PHONY: clean
 clean:
-	rm -f $(obj) libguilexbindjoy.so
+	rm -f $(obj) $(solib)
 	rm -f $(dep)
diff --git a/saulrh/xbindjoy.scm b/saulrh/xbindjoy.scm
index 856d79d..0803471 100644
--- a/saulrh/xbindjoy.scm
+++ b/saulrh/xbindjoy.scm
@@ -50,7 +50,7 @@
             ))
 
 ;;; load up the library that provides the low-level stuff
-(load-extension "libguilexbindjoy.so" "init_xbindjoy")
+(load-extension "guile-xbindjoy.so" "init_xbindjoy")
 
 
 ;;;