Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/x2x/files/, x11-misc/x2x/
Date: Tue, 11 Jan 2022 16:30:47
Message-Id: 1641918632.628935c96983361f7fbfa3adb1771ef06f8d821a.flow@gentoo
1 commit: 628935c96983361f7fbfa3adb1771ef06f8d821a
2 Author: Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
3 AuthorDate: Wed Jan 5 22:12:20 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 11 16:30:32 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=628935c9
7
8 x11-misc/x2x: version bump to 1.30
9
10 We added an ebuild for x2x-1.30-10.
11 It uses the current upstream source, which now resides on GitHub.
12 Also, we removed obsolete patches and refactored the ebuild.
13 Furthermore, I added myself as a proxied maintainer.
14
15 Closes: https://bugs.gentoo.org/754132
16 Package-Manager: Portage-3.0.30, Repoman-3.0.3
17 Signed-off-by: Philipp Roesner <rndxelement <AT> protonmail.com>
18 Closes: https://github.com/gentoo/gentoo/pull/23668
19 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
20 Modified-by: Florian Schmaus <flow <AT> gentoo.org>
21
22 x11-misc/x2x/Manifest | 1 +
23 x11-misc/x2x/files/x2x_1.30-10-keymap.patch | 80 +++++++++++++++++++++++++++++
24 x11-misc/x2x/metadata.xml | 9 +++-
25 x11-misc/x2x/x2x-1.30.ebuild | 48 +++++++++++++++++
26 4 files changed, 137 insertions(+), 1 deletion(-)
27
28 diff --git a/x11-misc/x2x/Manifest b/x11-misc/x2x/Manifest
29 index b7569af88c55..afbe097daec5 100644
30 --- a/x11-misc/x2x/Manifest
31 +++ b/x11-misc/x2x/Manifest
32 @@ -1,4 +1,5 @@
33 DIST x2x-1.27-keymap.diff.gz 1145 BLAKE2B cca78c368a9f5a27c94121eec12ab800322d1b0549c1be940b22dd455cbd42761283d1646bba8e098b94364cd6023ef6e615df9f788cf68913af967077eb6de9 SHA512 46e0d9cef4b985523e4bf2d6c550d68f488c0975a007433f2a6c03d77541ce0cbdffd44ea29472fa6db4e8b804503cdaf9e8b5f9d72c56d902270cf3291ca37f
34 DIST x2x-1.27.tar.gz 16776 BLAKE2B 8f78d801c1911928b0d5bb37b406bcf5285d3a54daf5067abae40125ad4e4f7fc52b8cc74f4e1c35b99350fc794f80c26120cae48e5076326746ec87d7aee0f3 SHA512 c5f8b1ec49f9871bf0d8142a047a2dff9a6ee262dfafd459044c977973dd45e297186961a8793938fc8e328f2553ec4de97e06343bdf3550f3bc3f2368b23131
35 +DIST x2x-1.30.tar.gz 52760 BLAKE2B fae2eeb9aa68241c3ba9e79021aa9313a5852048f23b6be8ad5de7dd090d2cd09c006f4c1b1403ccfa8057f314657c2248463a7c53187e41291742cfaa04139a SHA512 cb14b40e1511e3fe6c927443f5f411a827ebf6c313bfb46af0165eebdd534c8aa3abcc8064b89420b7f44c23c518ed4f02bab4c23bbcfaece8910a3f824c9c11
36 DIST x2x_1.27-8-initvars.patch.gz 494 BLAKE2B 97d48f4a2e7b65fd6755860c51399e5b6343bd0c7e6c79c7dd311792a899a02ed0ac6991d16495e96ca34913fbcec011b106bac6d0f9798540fb5704ca12f4cf SHA512 53060affef7575106932380063616473103c738193fdeab9118e0fb9ec1d1de2fe63f4112e5af82fe38198d0b42a10effde574bb9dee95c8fefdbdf680dbdf01
37 DIST x2x_1.27-8.diff.gz 13291 BLAKE2B 4a4a0bf34a864596cff2f0722163bfe53968e30892bd0a18ed18ca6c3ef8f5bc763b215381c46792b499839397dbecab033bd9095646fad36613ad11beba1240 SHA512 8201ab5fd0efd93adec53cec3b48f7b4de907b2db184ffa6e85a1e16739b4d0021f4562820d0b4730a0f6a2779985b5574973c2b0ceb04b241f0d7dc15060b71
38
39 diff --git a/x11-misc/x2x/files/x2x_1.30-10-keymap.patch b/x11-misc/x2x/files/x2x_1.30-10-keymap.patch
40 new file mode 100644
41 index 000000000000..f1d7f543fcf5
42 --- /dev/null
43 +++ b/x11-misc/x2x/files/x2x_1.30-10-keymap.patch
44 @@ -0,0 +1,80 @@
45 +--- a./x2x.c
46 ++++ b./x2x.c
47 +@@ -321,6 +321,12 @@ typedef struct _sticky {
48 + KeySym keysym;
49 + } STICKY, *PSTICKY;
50 +
51 ++typedef struct _keymap {
52 ++ struct _keymap * pNext;
53 ++ KeySym from;
54 ++ KeySym to;
55 ++} KEYMAP, *PKEYMAP;
56 ++
57 + typedef int (*HANDLER)(); /* event handler function */
58 +
59 + /* These prototypes need the typedefs */
60 +@@ -377,6 +383,7 @@ static Bool doDpmsMouse = False;
61 + static int logicalOffset= 0;
62 + static int nButtons = 0;
63 + static KeySym buttonmap[N_BUTTONS + 1][MAX_BUTTONMAPEVENTS + 1];
64 ++static PKEYMAP keymaps = NULL;
65 + static Bool noScale = False;
66 + static int compRegLeft = 0;
67 + static int compRegRight = 0;
68 +@@ -571,7 +578,8 @@ char **argv;
69 + PSHADOW pShadow;
70 + extern char *lawyerese;
71 + PSTICKY pNewSticky;
72 +- KeySym keysym;
73 ++ PKEYMAP pNewKeymap;
74 ++ KeySym keysym,keysym2;
75 + int button;
76 + int eventno;
77 + char *keyname, *argptr;
78 +@@ -703,6 +711,22 @@ char **argv;
79 + } else {
80 + printf("x2x: warning: can't translate %s\n", argv[arg]);
81 + }
82 ++ } else if (!strcasecmp(argv[arg], "-keymap")) {
83 ++ if ((++arg+1) >= argc) Usage();
84 ++ if (((keysym = XStringToKeysym(argv[arg])) != NoSymbol) &&
85 ++ ((keysym2 = XStringToKeysym(argv[arg+1])) != NoSymbol)) {
86 ++ pNewKeymap = (PKEYMAP)malloc(sizeof(KEYMAP));
87 ++ pNewKeymap->pNext = keymaps;
88 ++ pNewKeymap->from = keysym;
89 ++ pNewKeymap->to = keysym2;
90 ++ keymaps = pNewKeymap;
91 ++#ifdef DEBUG
92 ++ printf("will translate key %s to %s\n", argv[arg],argv[arg+1]);
93 ++#endif
94 ++ } else {
95 ++ printf("x2x: warning: can't translate %s or %s\n", argv[arg],argv[arg+1]);
96 ++ }
97 ++ arg++;
98 + } else if (!strcasecmp(argv[arg], "-buttonmap")) {
99 + if (++arg >= argc) Usage();
100 + button = atoi(argv[arg]);
101 +@@ -2200,6 +2224,7 @@ XKeyEvent *pEv;
102 + PSHADOW pShadow;
103 + Bool bPress;
104 + PSTICKY pSticky;
105 ++ PKEYMAP pKeymap;
106 + Bool DoFakeShift = False;
107 + KeyCode toShiftCode;
108 +
109 +@@ -2211,6 +2236,15 @@ XKeyEvent *pEv;
110 + XKeysymToString(keysym), (bPress ? "pressed" : "released"), pEv->state);
111 + #endif
112 +
113 ++ for (pKeymap = keymaps; pKeymap; pKeymap = pKeymap->pNext)
114 ++ if (keysym == pKeymap->from) {
115 ++ keysym = pKeymap->to;
116 ++#ifdef DEBUG
117 ++ printf("Key mapped from %x to %x\n", pKeymap->from, pKeymap->to);
118 ++#endif
119 ++ }
120 ++
121 ++
122 + /* If CapsLock is on, we need to do some funny business to make sure the */
123 + /* "to" display does the right thing */
124 + if(doCapsLkHack && (pEv->state & 0x2))
125
126 diff --git a/x11-misc/x2x/metadata.xml b/x11-misc/x2x/metadata.xml
127 index 115e9d64a669..5d2f87cc3174 100644
128 --- a/x11-misc/x2x/metadata.xml
129 +++ b/x11-misc/x2x/metadata.xml
130 @@ -1,5 +1,12 @@
131 <?xml version="1.0" encoding="UTF-8"?>
132 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
133 <pkgmetadata>
134 - <!-- maintainer-needed -->
135 + <maintainer type="person" proxied="yes">
136 + <email>rndxelement@××××××××××.com</email>
137 + <name>Philipp Rösner</name>
138 + </maintainer>
139 + <maintainer type="project" proxied="proxy">
140 + <email>proxy-maint@g.o</email>
141 + <name>Proxy Maintainers</name>
142 + </maintainer>
143 </pkgmetadata>
144
145 diff --git a/x11-misc/x2x/x2x-1.30.ebuild b/x11-misc/x2x/x2x-1.30.ebuild
146 new file mode 100644
147 index 000000000000..09d330e821dd
148 --- /dev/null
149 +++ b/x11-misc/x2x/x2x-1.30.ebuild
150 @@ -0,0 +1,48 @@
151 +# Copyright 1999-2022 Gentoo Authors
152 +# Distributed under the terms of the GNU General Public License v2
153 +
154 +EAPI=8
155 +
156 +inherit autotools toolchain-funcs
157 +
158 +DESCRIPTION="A utility to connect the mouse and keyboard to another X"
159 +HOMEPAGE="https://github.com/dottedmag/x2x"
160 +SRC_URI="https://github.com/dottedmag/x2x/archive/refs/tags/debian/${PV}-10.tar.gz -> ${P}.tar.gz"
161 +
162 +LICENSE="MIT BSD"
163 +SLOT="0"
164 +KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
165 +IUSE=""
166 +
167 +RDEPEND="x11-libs/libX11
168 + x11-libs/libXtst
169 + x11-libs/libXext"
170 +DEPEND="${RDEPEND}"
171 +BDEPEND="
172 + app-text/rman
173 + x11-base/xorg-proto
174 + >=x11-misc/imake-1.0.8-r1"
175 +
176 +S="${WORKDIR}"/${PN}-debian-1.30-10
177 +
178 +PATCHES=(
179 + # Patch to fix bug #126939
180 + # AltGr does not work in x2x with different keymaps:
181 + "${FILESDIR}"/${PN}_1.30-10-keymap.patch
182 +)
183 +DOCS=( README AUTHORS INSTALL ChangeLog ChangeLog.old )
184 +
185 +src_prepare() {
186 + default
187 + eautoreconf
188 +}
189 +
190 +src_compile() {
191 + emake CC="$(tc-getCC)" CDEBUGFLAGS="${CFLAGS}" \
192 + EXTRA_LDOPTIONS="${LDFLAGS}"
193 +}
194 +
195 +src_install() {
196 + default
197 + dodoc -r docs/
198 +}