summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch12
-rw-r--r--meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch326
-rw-r--r--meta-oe/recipes-support/gpm/gpm/gpm.service.in9
-rw-r--r--meta-oe/recipes-support/gpm/gpm/init (renamed from meta-oe/recipes-support/gpm/gpm-1.99.7/init)0
-rw-r--r--meta-oe/recipes-support/gpm/gpm/no-docs.patch (renamed from meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch)2
-rw-r--r--meta-oe/recipes-support/gpm/gpm/processcreds.patch (renamed from meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch)0
-rw-r--r--meta-oe/recipes-support/gpm/gpm_1.99.7.bb53
-rw-r--r--meta-oe/recipes-support/gpm/gpm_git.bb45
8 files changed, 55 insertions, 392 deletions
diff --git a/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch b/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch
deleted file mode 100644
index e43bdcb222..0000000000
--- a/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch
+++ /dev/null
@@ -1,12 +0,0 @@
1Upstream-Status: pending
2
3--- gpm-1.99.7.orig/src/daemon/open_console.c 2008-07-24 12:33:05.000000000 +0200
4+++ gpm-1.99.7/src/daemon/open_console.c 2013-01-10 12:39:47.975461947 +0100
5@@ -23,6 +23,7 @@
6 #include <fcntl.h> /* open and co. */
7 #include <sys/stat.h> /* stat() */
8 #include <sys/ioctl.h> /* ioctl() */
9+#include <sys/types.h> /* major() */
10
11 /* Linux specific (to be outsourced in gpm2 */
12 #include <linux/serial.h> /* for serial console check */
diff --git a/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch b/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch
deleted file mode 100644
index d2d6cb8a8c..0000000000
--- a/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch
+++ /dev/null
@@ -1,326 +0,0 @@
1Remove nested functions, they are not available in all compilers
2e.g. clang will not support them.
3
4Upstream-Status: Pending
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: gpm-1.99.7/src/drivers/summa/i.c
8===================================================================
9--- gpm-1.99.7.orig/src/drivers/summa/i.c
10+++ gpm-1.99.7/src/drivers/summa/i.c
11@@ -36,6 +36,28 @@ extern int summamaxy;
12
13 extern signed char summaid;
14
15+static void resetsumma(int fd)
16+{
17+ write(fd, 0, 1); /* Reset */
18+ usleep(400000); /* wait */
19+}
20+
21+static int waitsumma(int fd)
22+{
23+ struct timeval timeout;
24+
25+ fd_set readfds;
26+
27+ int err;
28+
29+ FD_ZERO(&readfds);
30+ FD_SET(fd, &readfds);
31+ timeout.tv_sec = 0;
32+ timeout.tv_usec = 200000;
33+ err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
34+ return (err);
35+}
36+
37 Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
38 char **argv)
39 {
40@@ -43,24 +65,6 @@ Gpm_Type *I_summa(int fd, unsigned short
41 flags = argc = 0; /* FIXME: 1.99.13 */
42 argv = NULL;
43
44- void resetsumma() {
45- write(fd, 0, 1); /* Reset */
46- usleep(400000); /* wait */
47- }
48- int waitsumma() {
49- struct timeval timeout;
50-
51- fd_set readfds;
52-
53- int err;
54-
55- FD_ZERO(&readfds);
56- FD_SET(fd, &readfds);
57- timeout.tv_sec = 0;
58- timeout.tv_usec = 200000;
59- err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
60- return (err);
61- }
62 int err;
63
64 char buffer[255];
65@@ -91,7 +95,7 @@ Gpm_Type *I_summa(int fd, unsigned short
66 */
67 setspeed(fd, 1200, 9600, 1,
68 B9600 | CS8 | CREAD | CLOCAL | HUPCL | PARENB | PARODD);
69- resetsumma();
70+ resetsumma(fd);
71
72 write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE));
73
74@@ -103,7 +107,7 @@ Gpm_Type *I_summa(int fd, unsigned short
75 * read the Summa Firm-ID
76 */
77 write(fd, SS_FIRMID, strlen(SS_FIRMID));
78- err = waitsumma();
79+ err = waitsumma(fd);
80 if(!((err == -1) || (!err))) {
81 summaid = 10; /* Original Summagraphics */
82 read(fd, buffer, 255); /* Read Firm-ID */
83@@ -111,14 +115,14 @@ Gpm_Type *I_summa(int fd, unsigned short
84 }
85
86 if(summaid < 0) { /* Genius-test */
87- resetsumma();
88+ resetsumma(fd);
89 write(fd, GEN_MMSERIES, 1);
90 write(fd, &GEN_MODELL, 1); /* Read modell */
91- err = waitsumma();
92+ err = waitsumma(fd);
93 if(!((err == -1) || (!err))) { /* read Genius-ID */
94- err = waitsumma();
95+ err = waitsumma(fd);
96 if(!((err == -1) || (!err))) {
97- err = waitsumma();
98+ err = waitsumma(fd);
99 if(!((err == -1) || (!err))) {
100 read(fd, &config, 1);
101 summaid = (config[0] & 224) >> 5; /* genius tablet-id
102@@ -135,14 +139,14 @@ Gpm_Type *I_summa(int fd, unsigned short
103 * unknown tablet ?
104 */
105 if((summaid < 0) || (summaid == 11)) {
106- resetsumma();
107+ resetsumma(fd);
108 write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3);
109 }
110
111 /*
112 * read tablet size
113 */
114- err = waitsumma();
115+ err = waitsumma(fd);
116 if(!((err == -1) || (!err)))
117 read(fd, buffer, sizeof(buffer));
118 write(fd, SS_READCONFIG, 1);
119Index: gpm-1.99.7/src/drivers/wacom/i.c
120===================================================================
121--- gpm-1.99.7.orig/src/drivers/wacom/i.c
122+++ gpm-1.99.7/src/drivers/wacom/i.c
123@@ -30,10 +30,6 @@
124 #include "message.h" /* gpm_report */
125 #include "wacom.h" /* wacom */
126
127-Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
128- char **argv)
129-{
130-
131 /* wacom graphire tablet */
132 #define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */
133 /*
134@@ -45,83 +41,91 @@ Gpm_Type *I_wacom(int fd, unsigned short
135 #define UD_COORD "~C\r" /* Request max coordinates */
136 #define UD_STOP "\nSP\r" /* stop sending coordinates */
137
138- flags = 0; /* FIXME: 1.99.13 */
139
140- void reset_wacom() {
141- /*
142- * Init Wacom communication; this is modified from xf86Wacom.so module
143- */
144- /*
145- * Set speed to 19200
146- */
147- setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL);
148- /*
149- * Send Reset Baudrate Command
150- */
151- write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
152- usleep(250000);
153- /*
154- * Send Reset Command
155- */
156- write(fd, UD_RESET, strlen(UD_RESET));
157- usleep(75000);
158- /*
159- * Set speed to 9600bps
160- */
161- setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL);
162- /*
163- * Send Reset Command
164- */
165- write(fd, UD_RESET, strlen(UD_RESET));
166- usleep(250000);
167- write(fd, UD_STOP, strlen(UD_STOP));
168- usleep(100000);
169- }
170+static void reset_wacom(int fd)
171+{
172+ /*
173+ * Init Wacom communication; this is modified from xf86Wacom.so module
174+ */
175+ /*
176+ * Set speed to 19200
177+ */
178+ setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL);
179+ /*
180+ * Send Reset Baudrate Command
181+ */
182+ write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
183+ usleep(250000);
184+ /*
185+ * Send Reset Command
186+ */
187+ write(fd, UD_RESET, strlen(UD_RESET));
188+ usleep(75000);
189+ /*
190+ * Set speed to 9600bps
191+ */
192+ setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL);
193+ /*
194+ * Send Reset Command
195+ */
196+ write(fd, UD_RESET, strlen(UD_RESET));
197+ usleep(250000);
198+ write(fd, UD_STOP, strlen(UD_STOP));
199+ usleep(100000);
200+}
201
202- int wait_wacom() {
203- /*
204- * Wait up to 200 ms for Data from Tablet.
205- * Do not read that data.
206- * Give back 0 on timeout condition, -1 on error and 1 for DataPresent
207- */
208- struct timeval timeout;
209-
210- fd_set readfds;
211-
212- int err;
213-
214- FD_ZERO(&readfds);
215- FD_SET(fd, &readfds);
216- timeout.tv_sec = 0;
217- timeout.tv_usec = 200000;
218- err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
219- return ((err > 0) ? 1 : err);
220- }
221+static int wait_wacom(int fd)
222+{
223+ /*
224+ * Wait up to 200 ms for Data from Tablet.
225+ * Do not read that data.
226+ * Give back 0 on timeout condition, -1 on error and 1 for DataPresent
227+ */
228+ struct timeval timeout;
229
230- char buffer[50], *p;
231+ fd_set readfds;
232
233- int RequestData(char *cmd) {
234- int err;
235+ int err;
236
237- /*
238- * Send cmd if not null, and get back answer from tablet.
239- * Get Data to buffer until full or timeout.
240- * Give back 0 for timeout and !0 for buffer full
241- */
242- if(cmd)
243- write(fd, cmd, strlen(cmd));
244- memset(buffer, 0, sizeof(buffer));
245- p = buffer;
246- err = wait_wacom();
247- while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) {
248- p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer));
249- err = wait_wacom();
250- }
251- /*
252- * return 1 for buffer full
253- */
254- return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0);
255+ FD_ZERO(&readfds);
256+ FD_SET(fd, &readfds);
257+ timeout.tv_sec = 0;
258+ timeout.tv_usec = 200000;
259+ err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
260+ return ((err > 0) ? 1 : err);
261+}
262+
263+static int RequestData(int fd, char *cmd, char *buffer)
264+{
265+ int err;
266+ char *p;
267+ /*
268+ * Send cmd if not null, and get back answer from tablet.
269+ * Get Data to buffer until full or timeout.
270+ * Give back 0 for timeout and !0 for buffer full
271+ */
272+ if(cmd)
273+ write(fd, cmd, strlen(cmd));
274+ memset(buffer, 0, sizeof(buffer));
275+ p = buffer;
276+ err = wait_wacom(fd);
277+ while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) {
278+ p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer));
279+ err = wait_wacom(fd);
280 }
281+ /*
282+ * return 1 for buffer full
283+ */
284+ return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0);
285+}
286+
287+Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
288+ char **argv)
289+{
290+
291+ flags = 0; /* FIXME: 1.99.13 */
292+
293+ char buffer[50];
294
295 /*
296 * We do both modes, relative and absolute, with the same function.
297@@ -143,17 +147,17 @@ Gpm_Type *I_wacom(int fd, unsigned short
298 };
299 parse_argv(optioninfo, argc, argv);
300 type->absolute = WacomAbsoluteWanted;
301- reset_wacom();
302+ reset_wacom(fd);
303
304 /*
305 * "Flush" input queque
306 */
307- while(RequestData(NULL)) ;
308+ while(RequestData(fd, NULL, buffer)) ;
309
310 /*
311 * read WACOM-ID
312 */
313- RequestData(UD_FIRMID);
314+ RequestData(fd, UD_FIRMID, buffer);
315
316 /*
317 * Search for matching modell
318@@ -180,7 +184,7 @@ Gpm_Type *I_wacom(int fd, unsigned short
319 * read Wacom max size
320 */
321 if(WacomModell != (-1) && (!wcmodell[WacomModell].maxX)) {
322- RequestData(UD_COORD);
323+ RequestData(fd, UD_COORD, buffer);
324 sscanf(buffer + 2, "%d,%d", &wmaxx, &wmaxy);
325 wmaxx = (wmaxx - wcmodell[WacomModell].border);
326 wmaxy = (wmaxy - wcmodell[WacomModell].border);
diff --git a/meta-oe/recipes-support/gpm/gpm/gpm.service.in b/meta-oe/recipes-support/gpm/gpm/gpm.service.in
new file mode 100644
index 0000000000..ee6c040fa6
--- /dev/null
+++ b/meta-oe/recipes-support/gpm/gpm/gpm.service.in
@@ -0,0 +1,9 @@
1[Unit]
2Description=Virtual console mouse server
3
4[Service]
5Type=forking
6ExecStart=@bindir@/gpm -m /dev/input/mice -t imps2
7
8[Install]
9WantedBy=multi-user.target
diff --git a/meta-oe/recipes-support/gpm/gpm-1.99.7/init b/meta-oe/recipes-support/gpm/gpm/init
index 2dcf9ab049..2dcf9ab049 100644
--- a/meta-oe/recipes-support/gpm/gpm-1.99.7/init
+++ b/meta-oe/recipes-support/gpm/gpm/init
diff --git a/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch b/meta-oe/recipes-support/gpm/gpm/no-docs.patch
index f10217a942..3faef84ee2 100644
--- a/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch
+++ b/meta-oe/recipes-support/gpm/gpm/no-docs.patch
@@ -11,7 +11,7 @@ Index: gpm-1.99.7/Makefile.in
11 # user-overridable flags, but it's also all the implicit rule looks at. 11 # user-overridable flags, but it's also all the implicit rule looks at.
12 # missing ? 12 # missing ?
13 13
14-SUBDIRS = src doc contrib gpm2 14-SUBDIRS = src doc contrib
15+SUBDIRS = src 15+SUBDIRS = src
16 16
17 17
diff --git a/meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch b/meta-oe/recipes-support/gpm/gpm/processcreds.patch
index d647eca0ad..d647eca0ad 100644
--- a/meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch
+++ b/meta-oe/recipes-support/gpm/gpm/processcreds.patch
diff --git a/meta-oe/recipes-support/gpm/gpm_1.99.7.bb b/meta-oe/recipes-support/gpm/gpm_1.99.7.bb
deleted file mode 100644
index bbb8c28ac6..0000000000
--- a/meta-oe/recipes-support/gpm/gpm_1.99.7.bb
+++ /dev/null
@@ -1,53 +0,0 @@
1DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
2for the console and xterm, with sample clients included \
3(emacs, etc)."
4SECTION = "console/utils"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://gpm2/core/main.c;endline=19;md5=66d3c205c4e7ee5704b2ee351dfed72f"
7
8PR = "r2"
9
10DEPENDS = "ncurses"
11
12SRC_URI = "ftp://arcana.linux.it/pub/gpm/gpm-${PV}.tar.bz2 \
13 file://no-docs.patch \
14 file://processcreds.patch \
15 file://eglibc-2.17.patch \
16 file://remove_nested_functions.patch \
17 file://init"
18
19inherit autotools-brokensep update-rc.d
20
21INITSCRIPT_NAME = "gpm"
22INITSCRIPT_PARAMS = "defaults"
23
24#export LIBS = "-lm"
25
26# all fields are /* FIXME: gpm 1.99.13 */
27# gpm-1.99.7/src/lib/libhigh.c:171:43: error: parameter 'clientdata' set but not used [-Werror=unused-but-set-parameter]
28# gpm-1.99.7/src/lib/report-lib.c:28:21: error: parameter 'line' set but not used [-Werror=unused-but-set-parameter]
29# gpm-1.99.7/src/lib/report-lib.c:28:33: error: parameter 'file' set but not used [-Werror=unused-but-set-parameter]
30# gpm-1.99.7/src/drivers/empty/i.c:26:23: error: parameter 'fd' set but not used [-Werror=unused-but-set-parameter]
31# gpm-1.99.7/src/drivers/empty/i.c:26:42: error: parameter 'flags' set but not used [-Werror=unused-but-set-parameter]
32# gpm-1.99.7/src/drivers/etouch/i.c:34:43: error: parameter 'flags' set but not used [-Werror=unused-but-set-parameter]
33# gpm-1.99.7/src/drivers/msc/r.c:32:12: error: variable 'dy' set but not used [-Werror=unused-but-set-variable]
34# gpm-1.99.7/src/drivers/msc/r.c:32:8: error: variable 'dx' set but not used [-Werror=unused-but-set-variable]
35# cc1: all warnings being treated as errors
36CFLAGS += "-Wno-extra -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable"
37
38# twiddler is WIP in 1.99.7 and probably not worth fixing (a lot of changes in gpm-2-dev after 1.99.7
39# gpm-1.99.7/src/drivers/twid/twiddler.c:503:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
40# /gpm-1.99.7/src/mice.c:221:5: error: (near initialization for 'mice[32].init') [-Werror]
41CFLAGS += "-Wno-error=int-to-pointer-cast -Wno-error"
42
43do_install () {
44 oe_runmake 'DESTDIR=${D}' install
45 install -m 0644 src/headers/gpm.h ${D}${includedir}
46 install -d ${D}/${sysconfdir}/init.d
47 install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
48 cd ${D}${libdir} && ln -sf libgpm.so.1.19.0 libgpm.so.1
49}
50SRC_URI[md5sum] = "9fdddf5f53cb11d40bb2bb671d3ac544"
51SRC_URI[sha256sum] = "6071378b24494e36ca3ef6377606e7e565040413c86704753a162d2180af32ee"
52
53FILES_${PN} += "${datadir}/emacs"
diff --git a/meta-oe/recipes-support/gpm/gpm_git.bb b/meta-oe/recipes-support/gpm/gpm_git.bb
new file mode 100644
index 0000000000..69f12d9b89
--- /dev/null
+++ b/meta-oe/recipes-support/gpm/gpm_git.bb
@@ -0,0 +1,45 @@
1DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
2for the console and xterm, with sample clients included \
3(emacs, etc)."
4SECTION = "console/utils"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
7
8PV = "1.99.7+git${SRCREV}"
9PR = "r2"
10SRCREV = "1fd19417b8a4dd9945347e98dfa97e4cfd798d77"
11
12DEPENDS = "ncurses"
13
14SRC_URI = "git://github.com/telmich/gpm;protocol=git \
15 file://no-docs.patch \
16 file://processcreds.patch \
17 file://gpm.service.in \
18 file://init"
19
20S = "${WORKDIR}/git"
21
22inherit autotools-brokensep update-rc.d systemd
23
24INITSCRIPT_NAME = "gpm"
25INITSCRIPT_PARAMS = "defaults"
26
27do_configure_prepend() {
28 (cd ${S};./autogen.sh;cd -)
29}
30
31do_install_append () {
32 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
33 install -d ${D}${systemd_system_unitdir}
34 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
35 fi
36 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
37 install -D -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
38 fi
39 install -D -m 0644 ${S}/src/headers/gpm.h ${D}${includedir}/gpm.h
40 ln -s libgpm.so.2 ${D}${libdir}/libgpm.so
41}
42
43SYSTEMD_SERVICE_${PN} = "gpm.service"
44
45FILES_${PN} += "${datadir}/emacs"