summarylogtreecommitdiffstats
path: root/0001-Use-system-libfswatch-install.patch
blob: 585454393eabeb7c576b164a0fd000d812484e4f (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
50
51
From 4b0148a5d9b21365606e75e3031e243765374b6c Mon Sep 17 00:00:00 2001
From: Xiretza <xiretza@xiretza.xyz>
Date: Fri, 6 Aug 2021 13:54:00 +0200
Subject: [PATCH 1/3] Use system libfswatch install

---
 Makefile               | 14 +++++---------
 c_lib/c_libfswatch.gpr |  2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index c3bd85a..8d02469 100644
--- a/Makefile
+++ b/Makefile
@@ -3,16 +3,12 @@ DESTDIR=
 all: generated
 	gprbuild -p -P ada_libfswatch
 
-# warn if libfswatch/ is not populated
-libfswatch:
-	@echo "you need to install the libfswatch library in libfswatch/"
-	@exit 1
-
 # generate the Ada binding
-generated: libfswatch
-	(mkdir -p generated; cd libfswatch/include/libfswatch/c/ ; \
-		gcc -C -fdump-ada-spec libfswatch.h -D_TIMEZONE_DEFINED; \
-	       	mv *.ads ../../../../generated/)
+generated:
+	(mkdir -p generated; cd generated ; \
+		gcc -C -fdump-ada-spec /usr/include/libfswatch/c/libfswatch.h -D_TIMEZONE_DEFINED ; \
+        rename 'libfswatch_c_' '' *.ads ; \
+        sed -i 's/libfswatch_c_//g' *.ads)
 
 clean:
 	gprclean -P ada_libfswatch
diff --git a/c_lib/c_libfswatch.gpr b/c_lib/c_libfswatch.gpr
index a12b28f..a032dca 100644
--- a/c_lib/c_libfswatch.gpr
+++ b/c_lib/c_libfswatch.gpr
@@ -1,6 +1,6 @@
 library project C_Libfswatch is
 
-   libfswatch_prefix := External("LIBFSWATCH_PREFIX", "../libfswatch");
+   libfswatch_prefix := External("LIBFSWATCH_PREFIX", "/usr");
 
    type OS_Type is ("unix", "Windows_NT");
    OS : OS_Type := External ("OS", "unix");
-- 
2.32.0