summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/gpm
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/gpm')
-rw-r--r--meta-oe/recipes-support/gpm/gpm/0001-Avoid-shadowing-ncurses-functions.patch234
-rw-r--r--meta-oe/recipes-support/gpm/gpm/0002-Fix-function-definition-in-yacc-source-file-until-va.patch81
-rw-r--r--meta-oe/recipes-support/gpm/gpm/0003-Add-incomplete-type-definition-for-WINDOW-in-Gpm_Wge.patch37
-rw-r--r--meta-oe/recipes-support/gpm/gpm_git.bb12
4 files changed, 361 insertions, 3 deletions
diff --git a/meta-oe/recipes-support/gpm/gpm/0001-Avoid-shadowing-ncurses-functions.patch b/meta-oe/recipes-support/gpm/gpm/0001-Avoid-shadowing-ncurses-functions.patch
new file mode 100644
index 0000000000..ad10c9848c
--- /dev/null
+++ b/meta-oe/recipes-support/gpm/gpm/0001-Avoid-shadowing-ncurses-functions.patch
@@ -0,0 +1,234 @@
1From 8acd38879bcdeb34700ab1989e0dd6245af04706 Mon Sep 17 00:00:00 2001
2From: NHOrus <jy6x2b32pie9@yahoo.com>
3Date: Tue, 11 Feb 2025 18:42:47 +0400
4Subject: [PATCH 1/3] Avoid shadowing ncurses functions. This fails with GCC-15
5 and other compilers implementing C23 Added prefix gpm_ to raw() and noraw()
6 used in two files because they are implemented in same two files, and are
7 static. Same with scr_dump() and src_restore() in yacc source file
8
9Upstream-Status: Submitted [https://github.com/telmich/gpm/pull/49]
10Signed-off-by: mark.yang <mark.yang@lge.com>
11---
12 src/prog/gpm-root.y | 10 +++++-----
13 src/prog/hltest.c | 11 +++++------
14 src/prog/mouse-test.c | 24 ++++++++++++------------
15 3 files changed, 22 insertions(+), 23 deletions(-)
16
17diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
18index 76c896c..800e51b 100644
19--- a/src/prog/gpm-root.y
20+++ b/src/prog/gpm-root.y
21@@ -941,7 +941,7 @@ static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4};
22 static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1;
23
24 /*------------*/
25-static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
26+static inline void gpm_scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
27 {
28 int dumpfd;
29 char dumpname[20];
30@@ -960,7 +960,7 @@ static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
31 }
32
33 /*------------*/
34-static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
35+static inline void gpm_scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
36 {
37 int dumpfd;
38 char dumpname[20];
39@@ -1002,7 +1002,7 @@ Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console)
40 if (!new) return NULL;
41 new->draw=draw;
42 new->dump=dump=malloc(opt_buf);
43- scr_dump(fd,f,dump,console);
44+ gpm_scr_dump(fd,f,dump,console);
45 lines=dump[0]; columns=dump[1];
46 i=(columns*dump[3]+dump[2])*2+1; /* where to get it */
47 if (i<0) i=1;
48@@ -1060,7 +1060,7 @@ Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console)
49 for (i=0; i<draw->width; i++) PUTC(HORLINE,draw->bord,draw->back);
50 PUTC(LRCORNER,draw->bord,draw->back);
51
52- scr_restore(fd,f,dump,console);
53+ gpm_scr_restore(fd,f,dump,console);
54 free(dump);
55
56 #undef PUTC
57@@ -1077,7 +1077,7 @@ Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc)
58 {
59 Posted *prev=which->prev;
60
61- scr_restore(fd,f,which->dump, vc);
62+ gpm_scr_restore(fd,f,which->dump, vc);
63 ioctl(fd,TCXONC,TCOON); /* activate the console */
64 free(which->dump);
65 free(which);
66diff --git a/src/prog/hltest.c b/src/prog/hltest.c
67index cce0abc..a916873 100644
68--- a/src/prog/hltest.c
69+++ b/src/prog/hltest.c
70@@ -80,7 +80,6 @@ int wid,hei,vcsize;
71 unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4};
72 unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1;
73
74-
75 static inline int scrdump(char *buf)
76 {
77 clear_sel_arg[0]=2; /* clear_selection */
78@@ -99,7 +98,7 @@ static inline int scrrestore(char *buf)
79
80
81 /* I don't like curses, so I'm doing low level stuff here */
82-static void raw(void)
83+static void gpm_raw(void)
84 {
85 struct termios it;
86
87@@ -115,7 +114,7 @@ tcsetattr(fileno(stdin),TCSANOW,&it);
88
89 }
90
91-static void noraw(void)
92+static void gpm_noraw(void)
93 {
94 struct termios it;
95
96@@ -136,7 +135,7 @@ void killed(int signo)
97 {
98 CLEAR;
99 fprintf(stderr,"hltest: killed by signal %i\r\n",signo);
100- noraw();
101+ gpm_noraw();
102 exit(0);
103 }
104
105@@ -525,7 +524,7 @@ int main(int argc, char **argv)
106 gpm_roi_handler=xhandler;
107 gpm_roi_data=NULL;
108
109- raw();
110+ gpm_raw();
111 newmsg(0,NULL); /* init data structures */
112 while((c=Gpm_Getchar())!=EOF) {
113 char s[32];
114@@ -538,6 +537,6 @@ int main(int argc, char **argv)
115 newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s);
116 }
117
118- noraw();
119+ gpm_noraw();
120 exit(0);
121 }
122diff --git a/src/prog/mouse-test.c b/src/prog/mouse-test.c
123index d7d1027..0db3560 100644
124--- a/src/prog/mouse-test.c
125+++ b/src/prog/mouse-test.c
126@@ -106,7 +106,7 @@ return 0;
127 /*-----------------------------------------------------------------------------
128 Place the description here.
129 -----------------------------------------------------------------------------*/
130-static void raw(void)
131+static void gpm_raw(void)
132 {
133 struct termios it;
134
135@@ -125,7 +125,7 @@ static void raw(void)
136 /*-----------------------------------------------------------------------------
137 Place the description here.
138 -----------------------------------------------------------------------------*/
139-static void noraw(void)
140+static void gpm_noraw(void)
141 {
142 struct termios it;
143
144@@ -144,7 +144,7 @@ static void noraw(void)
145 void killed(int signo)
146 {
147 fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo);
148- noraw();
149+ gpm_noraw();
150 exit(0);
151 }
152
153@@ -196,7 +196,7 @@ int mousereopen(int oldfd, const char *name, Gpm_Type *type)
154
155 int noneofthem(void)
156 {
157- noraw();
158+ gpm_noraw();
159 printf("\n\nSomething went wrong, I didn't manage to detect your"
160 "protocol\n\nFeel free to report your problems to the author\n");
161 exit(1);
162@@ -336,7 +336,7 @@ int main(int argc, char **argv)
163 I_serial=mice->init; /* the first one has I_serial */
164
165 signal(SIGINT,killed); /* control-C kills us */
166- raw();
167+ gpm_raw();
168
169 /*====================================== First of all, detect the device */
170
171@@ -568,7 +568,7 @@ int main(int argc, char **argv)
172 /* why checking and not using return value ??? */
173 CHECKFAIL(typecount);
174 if (typecount==1) {
175- noraw();
176+ gpm_noraw();
177 printf("\n\n\nWell, it seems like your mouse is already detected:\n"
178 "it is on the device \"%s\", and speaks the protocol \"%s\"\n",
179 mousename,list->this->name);
180@@ -587,7 +587,7 @@ int main(int argc, char **argv)
181 } while(i!='y' && i!='n');
182
183 if (i=='n') {
184- noraw();
185+ gpm_noraw();
186 printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n",
187 mousename);
188 exit(0);
189@@ -634,7 +634,7 @@ int main(int argc, char **argv)
190 for (pending=0,i=0;i<got-16;i++)
191 if(!memcmp(buf+i,buf+i+8,8)) pending++;
192 if (pending > 3) {
193- noraw();
194+ gpm_noraw();
195 printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n",
196 mousename,pending);
197 exit(0);
198@@ -660,7 +660,7 @@ int main(int argc, char **argv)
199 continue;
200 }
201 if (pending>3) {
202- noraw();
203+ gpm_noraw();
204 printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n",
205 cur->this->name,mousename,pending);
206 exit(0);
207@@ -695,7 +695,7 @@ int main(int argc, char **argv)
208 for (pending=0,i=0;i<got-20;i++)
209 if(!memcmp(buf+i,buf+i+10,10)) pending++;
210 if (pending>3) {
211- noraw();
212+ gpm_noraw();
213 printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n"
214 "gpm gets '-o %s' on it command line, and X gets\n"
215 "%s in XF86Config\nThe device is \"%s\"",
216@@ -726,7 +726,7 @@ int main(int argc, char **argv)
217 for (pending=0,i=0;i<got-20;i++)
218 if(!memcmp(buf+i,buf+i+10,10)) pending++;
219 if (pending>3) {
220- noraw();
221+ gpm_noraw();
222 printf("\nWorked. You should keep the button pressed every time the\n"
223 "computer boots, and run gpm in '-R' mode in order to ignore\n"
224 "such hassle when starting X\n\nStill better, but a better mouse\n"
225@@ -734,7 +734,7 @@ int main(int argc, char **argv)
226
227 exit(0);
228 }
229- noraw();
230+ gpm_noraw();
231 printf("\nI'm lost. Can't tell you how to use your middle button\n");
232 return 0;
233 }
234
diff --git a/meta-oe/recipes-support/gpm/gpm/0002-Fix-function-definition-in-yacc-source-file-until-va.patch b/meta-oe/recipes-support/gpm/gpm/0002-Fix-function-definition-in-yacc-source-file-until-va.patch
new file mode 100644
index 0000000000..4534de9be4
--- /dev/null
+++ b/meta-oe/recipes-support/gpm/gpm/0002-Fix-function-definition-in-yacc-source-file-until-va.patch
@@ -0,0 +1,81 @@
1From 155873ed357a94f06e7e7032e27acba58bba8214 Mon Sep 17 00:00:00 2001
2From: NHOrus <jy6x2b32pie9@yahoo.com>
3Date: Tue, 11 Feb 2025 19:01:48 +0400
4Subject: [PATCH 2/3] Fix function definition in yacc source file until valid
5 C23. Fill empty argument lists with values. Add 0 as third argument for
6 two-argument function, it will be ignored at call site.
7
8Upstream-Status: Submitted [https://github.com/telmich/gpm/pull/49]
9Signed-off-by: mark.yang <mark.yang@lge.com>
10---
11 src/prog/gpm-root.y | 14 +++++++-------
12 1 file changed, 7 insertions(+), 7 deletions(-)
13
14diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
15index 800e51b..f06872c 100644
16--- a/src/prog/gpm-root.y
17+++ b/src/prog/gpm-root.y
18@@ -128,7 +128,7 @@ typedef struct DrawItem {
19 char *name;
20 char *arg; /* a cmd string */
21 void *clientdata; /* a (Draw *) for menus or whatever */
22- int (*fun)();
23+ int (*fun)(int, struct DrawItem *, int);
24 struct DrawItem *next;
25 } DrawItem;
26
27@@ -159,7 +159,7 @@ int yyerror(char *s);
28 int yylex(void);
29
30 DrawItem *cfg_cat(DrawItem *, DrawItem *);
31-DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail);
32+DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(int, DrawItem *, int), void *detail);
33
34
35 /*===================================================================*
36@@ -195,7 +195,7 @@ int f_pipe(int mode, DrawItem *self, int uid);
37 char *string;
38 Draw *draw;
39 DrawItem *item;
40- int (*fun)();
41+ int (*fun)(int, DrawItem *, int);
42 }
43
44 %token <string> T_STRING
45@@ -284,7 +284,7 @@ struct tokenName tokenList[] = {
46 struct funcName {
47 char *name;
48 int token;
49- int (*fun)();
50+ int (*fun)(int, DrawItem *, int);
51 };
52 struct funcName funcList[] = {
53 {"f.debug",T_FUNC,f_debug},
54@@ -390,7 +390,7 @@ Draw *cfg_alloc(void)
55
56 /*---------------------------------------------------------------------*/
57 /* malloc an empty DrawItem and fill it */
58-DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail)
59+DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(int, DrawItem *, int), void *detail)
60 {
61 DrawItem *new=calloc(1,sizeof(DrawItem));
62
63@@ -405,7 +405,7 @@ DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail)
64
65 case 'F': /* a function without args */
66 new->fun=fun;
67- if (fun) fun(F_CREATE,new);
68+ if (fun) fun(F_CREATE,new,0);
69 break;
70
71 case 'M':
72@@ -1047,7 +1047,7 @@ Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console)
73 }
74 /* sides and items */
75 for (item=draw->menu; y++, item; item=item->next) {
76- if (item->fun) (*(item->fun))(F_POST,item);
77+ if (item->fun) (*(item->fun))(F_POST,item,0);
78 GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back);
79 for (i=0;i<item->pad;i++) PUTC(' ',draw->fore,draw->back);
80 PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name);
81
diff --git a/meta-oe/recipes-support/gpm/gpm/0003-Add-incomplete-type-definition-for-WINDOW-in-Gpm_Wge.patch b/meta-oe/recipes-support/gpm/gpm/0003-Add-incomplete-type-definition-for-WINDOW-in-Gpm_Wge.patch
new file mode 100644
index 0000000000..0913c809c8
--- /dev/null
+++ b/meta-oe/recipes-support/gpm/gpm/0003-Add-incomplete-type-definition-for-WINDOW-in-Gpm_Wge.patch
@@ -0,0 +1,37 @@
1From d8224863233ae64310a1ee91b9f4e77daf9cfd10 Mon Sep 17 00:00:00 2001
2From: NHOrus <jy6x2b32pie9@yahoo.com>
3Date: Sat, 22 Feb 2025 01:12:32 +0400
4Subject: [PATCH 3/3] Add incomplete type definition for WINDOW in Gpm_Wgetch()
5
6Window handle is an opaque pointer that Gpm_Wgetch() passes
7through straight to ncurses if it's not null and calls getch
8if it's null. Code doesn't care what's inside the handle
9as long as it agrees with curses definition.
10
11Upstream-Status: Submitted [https://github.com/telmich/gpm/pull/49]
12Signed-off-by: mark.yang <mark.yang@lge.com>
13---
14 src/headers/gpm.h | 9 ++++++++-
15 1 file changed, 8 insertions(+), 1 deletion(-)
16
17diff --git a/src/headers/gpm.h b/src/headers/gpm.h
18index fe52e53..b944d4b 100644
19--- a/src/headers/gpm.h
20+++ b/src/headers/gpm.h
21@@ -268,7 +268,14 @@ Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after);
22 /* libcurses.c */
23 /* #include <curses.h> Hmm... seems risky */
24
25-extern int Gpm_Wgetch();
26+/* Window handle is an opaque pointer that Gpm_Wgetch()
27+ * passes through to ncurses if it's not null and calls getch
28+ * if it's null. Code doesn't care what's inside the handle
29+ * as long as it agrees with curses definition.
30+*/
31+typedef struct _win_st WINDOW;
32+
33+extern int Gpm_Wgetch(WINDOW *);
34 #define Gpm_Getch() (Gpm_Wgetch(NULL))
35
36 /* libxtra.c */
37
diff --git a/meta-oe/recipes-support/gpm/gpm_git.bb b/meta-oe/recipes-support/gpm/gpm_git.bb
index 31503e9c62..155e56bdef 100644
--- a/meta-oe/recipes-support/gpm/gpm_git.bb
+++ b/meta-oe/recipes-support/gpm/gpm_git.bb
@@ -15,23 +15,29 @@ DEPENDS = "ncurses bison-native"
15SRC_URI = "git://github.com/telmich/gpm;protocol=https;branch=master \ 15SRC_URI = "git://github.com/telmich/gpm;protocol=https;branch=master \
16 file://init \ 16 file://init \
17 file://gpm.service.in \ 17 file://gpm.service.in \
18 file://0001-Avoid-shadowing-ncurses-functions.patch \
19 file://0002-Fix-function-definition-in-yacc-source-file-until-va.patch \
20 file://0003-Add-incomplete-type-definition-for-WINDOW-in-Gpm_Wge.patch \
18 " 21 "
19 22
20S = "${WORKDIR}/git"
21 23
22inherit autotools-brokensep update-rc.d systemd texinfo 24inherit autotools-brokensep update-rc.d systemd texinfo
23 25
24INITSCRIPT_NAME = "gpm" 26INITSCRIPT_NAME = "gpm"
25INITSCRIPT_PARAMS = "defaults" 27INITSCRIPT_PARAMS = "defaults"
26 28
29# Avoid line statements with bison/yacc
30# ERROR: lib32-gpm-1.99.7+gite82d1a653ca94aa4ed12441424da6ce780b1e530-r0 do_package_qa: QA Issue: File /usr/src/debug/lib32-gpm/1.99.7+gite82d1a653ca94aa4ed12441424da6ce780b1e530/src/prog/gpm-root.c in package lib32-gpm-src contains reference to TMPDIR [buildpaths]
31EXTRA_OEMAKE = "YFLAGS='-l'"
32
27do_configure:prepend() { 33do_configure:prepend() {
28 (cd ${S};./autogen.sh;cd -) 34 (cd ${S};./autogen.sh;cd -)
29} 35}
30 36
31do_install:append () { 37do_install:append () {
32 install -d ${D}${systemd_system_unitdir} 38 install -d ${D}${systemd_system_unitdir}
33 sed 's:@bindir@:${sbindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service 39 sed 's:@bindir@:${sbindir}:' < ${UNPACKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
34 install -D -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/gpm 40 install -D -m 0755 ${UNPACKDIR}/init ${D}${INIT_D_DIR}/gpm
35 ln -s libgpm.so.2 ${D}${libdir}/libgpm.so 41 ln -s libgpm.so.2 ${D}${libdir}/libgpm.so
36} 42}
37 43