summaryrefslogtreecommitdiffstats
path: root/testing/i3wm/musl.patch
blob: 47a0f233168db3d4005660c608db8ecc9324c5a3 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
diff -urw i3-4.7.2/common.mk i3-4.7.2-musl/common.mk
--- i3-4.7.2/common.mk	2014-01-23 21:52:24.000000000 +0000
+++ i3-4.7.2-musl/common.mk	2014-05-15 18:42:55.620000001 +0000
@@ -136,6 +136,7 @@
 LIBSN_LIBS   := $(call ldflags_for_lib, libstartup-notification-1.0,startup-notification-1)
 
 # Pango
+PANGO_CFLAGS := $(call cflags_for_lib, pango)
 PANGO_CFLAGS := $(call cflags_for_lib, cairo)
 PANGO_CFLAGS += $(call cflags_for_lib, pangocairo)
 I3_CPPFLAGS  += -DPANGO_SUPPORT=1
diff -urw i3-4.7.2/i3-config-wizard/main.c i3-4.7.2-musl/i3-config-wizard/main.c
--- i3-4.7.2/i3-config-wizard/main.c	2014-01-23 21:52:24.000000000 +0000
+++ i3-4.7.2-musl/i3-config-wizard/main.c	2014-05-15 18:42:55.646666668 +0000
@@ -448,6 +448,8 @@
  * or multiple matches are found, it just returns a copy of path as given.
  *
  */
+
+#ifdef GLOB_TILDE
 static char *resolve_tilde(const char *path) {
     static glob_t globbuf;
     char *head, *tail, *result;
@@ -473,6 +475,11 @@
 
     return result;
 }
+#else // glob-tilde is a glibc gnuism
+static char *resolve_tilde(const char *path) {
+    return strdup(path);
+}
+#endif
 
 /*
  * Handles expose events, that is, draws the window contents.
diff -urw i3-4.7.2/i3bar/src/main.c i3-4.7.2-musl/i3bar/src/main.c
--- i3-4.7.2/i3bar/src/main.c	2014-01-23 21:52:24.000000000 +0000
+++ i3-4.7.2-musl/i3bar/src/main.c	2014-05-15 18:42:55.520000001 +0000
@@ -44,6 +44,7 @@
  * Glob path, i.e. expand ~
  *
  */
+#ifdef GLOB_TILDE
 char *expand_path(char *path) {
     static glob_t globbuf;
     if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) {
@@ -54,6 +55,11 @@
     globfree(&globbuf);
     return result;
 }
+#else
+char *expand_path(char *path) {
+    return strdup(path);
+}
+#endif
 
 void print_usage(char *elf_name) {
     printf("Usage: %s -b bar_id [-s sock_path] [-h] [-v]\n", elf_name);
diff -urw i3-4.7.2/libi3/libi3.mk i3-4.7.2-musl/libi3/libi3.mk
--- i3-4.7.2/libi3/libi3.mk	2014-01-23 21:52:24.000000000 +0000
+++ i3-4.7.2-musl/libi3/libi3.mk	2014-05-15 18:42:55.653333335 +0000
@@ -10,7 +10,7 @@
 
 libi3/%.o: libi3/%.c $(libi3_HEADERS)
 	echo "[libi3] CC $<"
-	$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(libi3_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -c -o $@ $<
+	$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(libi3_CFLAGS) $(I3_CFLAGS) $(PANGO_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 libi3.a: $(libi3_OBJECTS)
 	echo "[libi3] AR libi3.a"
diff -urw i3-4.7.2/src/util.c i3-4.7.2-musl/src/util.c
--- i3-4.7.2/src/util.c	2014-01-23 21:52:24.000000000 +0000
+++ i3-4.7.2-musl/src/util.c	2014-05-15 18:42:55.490000000 +0000
@@ -125,6 +125,7 @@
  * or multiple matches are found, it just returns a copy of path as given.
  *
  */
+#ifdef GLOB_TILDE
 char *resolve_tilde(const char *path) {
         static glob_t globbuf;
         char *head, *tail, *result;
@@ -150,6 +151,12 @@
 
         return result;
 }
+#else
+// libc like musl does not support this gnuism
+char *resolve_tilde(const char *path) {
+        return sstrdup(path);
+}
+#endif
 
 /*
  * Checks if the given path exists by calling stat().