summaryrefslogtreecommitdiff
path: root/org.handhelds.familiar/packages/detect-stylus/files/nox.patch
blob: 8bee53613f3c163f9cc0097f1278d73d3755c8b4 (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
Only in detect-stylus-0.13: .pc
diff -ur detect-stylus-0.13.orig/Makefile detect-stylus-0.13/Makefile
--- detect-stylus-0.13.orig/Makefile	2004-09-08 17:57:37.000000000 +0200
+++ detect-stylus-0.13/Makefile	2006-04-18 21:00:57.000000000 +0200
@@ -15,7 +15,11 @@
 PACKAGE_CFLAGS += -Os -fomit-frame-pointer
 endif
 PACKAGE_CPPFLAGS += -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -DPACKAGE_LOCALE_DIR=\"$(PREFIX)/share/locale\"
+ifeq ($(NOX),yes)
+PACKAGE_CPPFLAGS += -DNOX
+else
 PACKAGE_LDFLAGS += `pkg-config --libs x11`
+endif
 
 OBJS = $(patsubst %,%.o,$(MEMBERS))
 
@@ -36,8 +40,7 @@
 	mkdir -p $(DESTDIR)$(PREFIX)/bin/
 	$(STRIP) $(PACKAGE)
 	install $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
-	mkdir -p $(DESTDIR)/etc/X11/Xinit.d
-	install 70detect-stylus $(DESTDIR)/etc/X11/Xinit.d
+	if [ -z $(NOX) ]; then mkdir -p $(DESTDIR)/etc/X11/Xinit.d && install -m 0755 70detect-stylus $(DESTDIR)/etc/X11/Xinit.d; fi
 
 clean:
 	rm -f $(PACKAGE) $(OBJS)
Only in detect-stylus-0.13: detect-stylus
diff -ur detect-stylus-0.13.orig/detect-stylus.c detect-stylus-0.13/detect-stylus.c
--- detect-stylus-0.13.orig/detect-stylus.c	2006-04-18 20:22:13.000000000 +0200
+++ detect-stylus-0.13/detect-stylus.c	2006-04-19 21:18:09.000000000 +0200
@@ -14,8 +14,10 @@
 #include <dirent.h>
 #include <string.h>
 
+#ifndef NOX
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
+#endif /* NOX */
 
 #include <linux/input.h>
 
@@ -42,11 +44,14 @@
 int
 main (int argc, char *argv[])
 {
+#ifndef NOX
   char b = 1;
-  char *tsdev;
   Atom atom;
   Display *dpy;
   Window root;
+#endif /* NOX */
+
+  char *tsdev;
   int fd;
   int i;
 
@@ -55,6 +60,8 @@
       if (!strcmp (argv[i], "--device"))
 	flag_device = 1;
     }
+  if (strstr (argv[0], "detect-tsdevice"))
+    flag_device = 1;
 
   fd = try_open ("/dev/touchscreen/0");
   
@@ -119,6 +126,10 @@
   if (flag_device)
     exit (1);		/* Nothing found */
 
+#ifdef NOX
+  fprintf (stderr, "This version of detect-stylus was compiled without X support.");
+  exit (1);
+#else
   if (fd >= 0)
     {
       close (fd);
@@ -141,4 +152,5 @@
     }
       
   exit (0);
+#endif /* NOX */
 }
Only in detect-stylus-0.13.orig/: detect-stylus.c.orig
Only in detect-stylus-0.13: detect-stylus.o
Only in detect-stylus-0.13: patches