summaryrefslogtreecommitdiff
path: root/sys-libs/gpm
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
commitfcc5224904648a8e6eb528d7603154160a20022f (patch)
tree3bfce096b38a9cea8eed13fc70c1526c456e9abd /sys-libs/gpm
parent2fd57282f0262ca084e05b0f2c63fbada395d02b (diff)
gentoo resync : 02.02.2022
Diffstat (limited to 'sys-libs/gpm')
-rw-r--r--sys-libs/gpm/Manifest4
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch18
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-musl.patch143
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-signedness.patch20
-rw-r--r--sys-libs/gpm/gpm-1.20.7-r4.ebuild112
5 files changed, 297 insertions, 0 deletions
diff --git a/sys-libs/gpm/Manifest b/sys-libs/gpm/Manifest
index 92a28b83e429..30384fbe6eff 100644
--- a/sys-libs/gpm/Manifest
+++ b/sys-libs/gpm/Manifest
@@ -1,5 +1,8 @@
AUX gpm-1.20.7-gcc-10.patch 365 BLAKE2B 5650d6d25eb70c97fc5092d035b7ff5a2780ae50bc23fb797ebece2202cd55bb6ac2b1de3f173c81afe1fc408113b98482cda844bc066218fd5f714ebae871a6 SHA512 d0e354e15f0f969a64e606067c1417a5034060e03e6ba9db8c39f421712b368942c7fa50d43e1d87ff8a927125d5c8df3a5b28376a11488ffcee23779172814f
+AUX gpm-1.20.7-gcc-include.patch 598 BLAKE2B bce0cdb25739d367caa6f6ef56b93d8b010996ac28f86bffb1b66894af2e3ebab78ca014192c71f41565b08483ccd7a7e39711a9f4be91dda4b07bfd575dc79b SHA512 4641263e1e34ce249ea3a5f205754c718f5ef1450ddd2e8b6813e40f6ddcb55aa5ac1b8c755313dad5f76da56c55d20e8d44e12e99e04e50ea409baf5dd8093d
AUX gpm-1.20.7-glibc-2.26.patch 425 BLAKE2B bb148784e2ef78cfd6fcb9ccd7e4d29739f6de17f4ef0279972f76851da8b05604c340a8366a04f5ed00a733329491d0b314cca6faeb9f8e791d4e61fbb6f694 SHA512 d8d240d07d4aed4080e6066fb1c43f24812ada8ea6254531e657ee598406b7bb7ec46e81755e6d58f8888730c4a1fd5b624f1038034e43022a845decca4d6ba4
+AUX gpm-1.20.7-musl.patch 5275 BLAKE2B 87b02be1090271e7308b48a803e95755b6e0cb8a59c254585201b6eb126ec235d912eeed753be0f73f401045333f8804dd4b412b8b6dc7213e49eeaafc9e20ae SHA512 02b0721e1603d7cb4388cb6e2b025c1dc3192072de2f5ed4a56ba797db05635e775ba1a4426d70fe21f6901304932995a4d0c84a3700562eefc44f26bb4312e9
+AUX gpm-1.20.7-signedness.patch 656 BLAKE2B 9707e0df20ff88e1b8bf27944ed4197f628ea376224ed5d424b5c1d94572bcf38bb04b33bf01d4e9896c86b3f7da4b999fefebee60ae746a2d1602ee2459eb80 SHA512 c6d2a1322e113cd3819704ab493a88dfe549a6a7ef00d99a88ae4194b0590e9583457b88c9d4b46052b1db442bcf0c7e59fe9909e50f7132d0be8b4704c83174
AUX gpm-1.20.7-sysmacros.patch 1011 BLAKE2B 01ccb2fc4f18c2f12af67f7fd03783ebf7c607c780417a51f25cb566a497163bc1e2606d89bd6406776a2133e25c39f150a8558a490f4845403cb346c4298e8a SHA512 05ff1649182eb5223f1835945df8590e83b92d3948461ac55424ade8711a45a1fef61ebacd9497ef0f2c98f8e008e0ba3995eaf02ea567841b77a5ffd5b1e2fe
AUX gpm.conf.d 580 BLAKE2B cd5618d1ca362a2602d0b8a83c4a572e7a73f76fef4fb372297d978002306b0c4c837102e2ce7d08c6a3de8f73a01ae57b7691858d4852ed70433ccd0e100ccb SHA512 14a4306a7454d1a12fda29973b51aadd6d1a5cf4833b1be5298cfe0c1ebc63a479cc79490007ae92c6ae24368e19215dfc4bd50ef5b0cfa0fef88cf69db67065
AUX gpm.rc6-2 553 BLAKE2B 609a2fe28fc0539e50eed703e2ed6c5a37d98737add953fe4f7d7ad6d83651ee89bdc82c677ce55776fac1e8c722f08298b97652977598acb0dc675f90d8369d SHA512 19cfdab0e401ebc3571975acb6687891a33a176ba23fb04537c8724c2dab47617b67e144b4a89c933e6fdd7e2918857e8eadb2bc270e8ec96a84d855810e5934
@@ -7,4 +10,5 @@ AUX gpm.service 218 BLAKE2B 728726976390bb394d479e424d5c1fafb9bc17d00e23a9021899
DIST gpm-1.20.7-docs.patch.xz 41668 BLAKE2B cab4649d0eda83c37474b68ac141fab84cbfaac4e18f0f42ad7c0a90d14bc39697b17c450e8a8dc8b1c960f6d9e7ff344ec15791df240f61a27ccfcd7d0a9171 SHA512 6cdcad70d0a77a56cb507330ff8409155de11255b5e61fb92ee439c1e117932c346df475f4187abb0e348ee4c28fa235a9693883b1c36913e91404662df272f4
DIST gpm-1.20.7.tar.lzma 789691 BLAKE2B 5dbceedaa330d5f1ead8b2267fb5844cfd284627e085edd784a72365830a700f9a6a97f96afb4aa00a44ddbae735ef23be7eafc97a65f6250d72e15b359486c7 SHA512 a502741e2f457b47e41c6d155b1f7ef7c95384fd394503f82ddacf80cde9cdc286c906c77be12b6af8565ef1c3ab24d226379c1dcebcfcd15d64bcf3e94b63b9
EBUILD gpm-1.20.7-r3.ebuild 2384 BLAKE2B b54374cfe57825cac1cd3dbea8994b9087333316bcd858d6d0e94af55cdb7d840adb7884824a87b10b1e7714f43cdb61a41bc61af6136265f9de6cb7ab9c6083 SHA512 ff917fae60b9398a205ca3cefb477f4f872867192ca540abc69cf21d59b25af2b51b01d0255d73838a7ceb6630f885e2a6140a1d1ea72357fe82af248c1deb2e
+EBUILD gpm-1.20.7-r4.ebuild 2536 BLAKE2B 45a61f5a57b5775564b7b231327566ccf085c92fde2ed370a862283d8eb434f33738fbd6a4f9e47aebd98e923901b773957320296a9d8bb9da2f381a213bac76 SHA512 c792d00cf7a6aedbcef3c8c0db1430e032a2ecb17675e42890a68b2d3733d0acc6b07d3ba94a1cdcf505ddbadba5d0cfb20c6e822935acc819267959e2425a42
MISC metadata.xml 254 BLAKE2B f3a9f843cf94243d1129711770df727fcdc8808bca829ef784819cab6f5410dfa463cfed85182f8228c7de796a674dd602653ad3ef817a62c0c3e7198b23befe SHA512 b9fcd3084a7e197f6138e1ce8b0eff99c4c203c37a7d5c40de207040ba1501ef0e5b2f4e00216a567037bcd6d3394fdec6ff587484c9ba2fca9d04f431733b7c
diff --git a/sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch b/sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch
new file mode 100644
index 000000000000..51d047c465cc
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch
@@ -0,0 +1,18 @@
+https://github.com/telmich/gpm/commit/80cac2a2bd7eed7e80626559f792f37319030729
+
+From: "Desmond O. Chang" <dochang@gmail.com>
+Date: Wed, 13 Apr 2016 21:17:48 +0800
+Subject: [PATCH] Add gcc include path
+
+Close #13
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -96,7 +96,7 @@ $(DEPFILE) dep: prog/gpm-root.c
+
+ # create dependencies
+ for DEPS in `echo *.c */*.c`; do \
+- $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
++ $(CC) -I. -I $(srcdir) -I $(srcdir)/headers -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
+
+ ### INSTALL
diff --git a/sys-libs/gpm/files/gpm-1.20.7-musl.patch b/sys-libs/gpm/files/gpm-1.20.7-musl.patch
new file mode 100644
index 000000000000..37f8542a87aa
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-musl.patch
@@ -0,0 +1,143 @@
+https://github.com/telmich/gpm/commit/d88fb1de5803c366ab62f7de9ee5d83207fb2afe
+https://github.com/telmich/gpm/commit/4a938233fbe6de7af05aabc74891b68d4bae40f8
+https://bugs.gentoo.org/829581
+
+From: Dima Krasner <dima@dimakrasner.com>
+Date: Wed, 12 Nov 2014 23:06:46 +0200
+Subject: [PATCH] Added musl support to libgpm and the daemon.
+
+--- a/src/daemon/open_console.c
++++ b/src/daemon/open_console.c
+@@ -21,6 +21,7 @@
+
+ #include <fcntl.h> /* open and co. */
+ #include <sys/stat.h> /* stat() */
++#include <sys/types.h> /* major() */
+ #include <sys/ioctl.h> /* ioctl */
+
+ /* Linux specific (to be outsourced in gpm2 */
+--- a/src/prog/display-buttons.c
++++ b/src/prog/display-buttons.c
+@@ -36,6 +36,7 @@
+ #include <stdio.h> /* printf() */
+ #include <time.h> /* time() */
+ #include <errno.h> /* errno */
++#include <sys/select.h> /* fd_set and FD_* */
+ #include <gpm.h> /* gpm information */
+
+ /* display resulting data */
+--- a/src/prog/display-coords.c
++++ b/src/prog/display-coords.c
+@@ -38,6 +38,7 @@
+ #include <stdio.h> /* printf() */
+ #include <time.h> /* time() */
+ #include <errno.h> /* errno */
++#include <sys/select.h> /* fd_set and FD_* */
+ #include <gpm.h> /* gpm information */
+
+ /* display resulting data */
+--- a/src/prog/gpm-root.y
++++ b/src/prog/gpm-root.y
+@@ -1199,9 +1199,9 @@ int main(int argc, char **argv)
+ #if defined(__GLIBC__)
+ __sigemptyset(&childaction.sa_mask);
+ #else /* __GLIBC__ */
+- childaction.sa_mask=0;
++ sigemptyset(&childaction.sa_mask);
+ #endif /* __GLIBC__ */
+- childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
++ childaction.sa_flags=0;
+ sigaction(SIGCHLD,&childaction,NULL);
+
+ /*....................................... Connect and get your buffer */
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Sat, 29 Dec 2018 23:44:24 -0600
+Subject: [PATCH 1/4] Update gpm.c
+
+--- a/src/daemon/gpm.c
++++ b/src/daemon/gpm.c
+@@ -29,7 +29,7 @@
+ #include <signal.h> /* SIGPIPE */
+ #include <time.h> /* time() */
+ #include <sys/param.h>
+-#include <sys/fcntl.h> /* O_RDONLY */
++#include <fcntl.h> /* O_RDONLY */
+ #include <sys/wait.h> /* wait() */
+ #include <sys/stat.h> /* mkdir() */
+ #include <sys/time.h> /* timeval */
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Sat, 29 Dec 2018 23:47:17 -0600
+Subject: [PATCH 2/4] Add include <string.h>
+
+Added
+ line 28, #include <string.h> /* strcpy, bzero */
+for musl compilation
+--- a/src/daemon/old_main.c
++++ b/src/daemon/old_main.c
+@@ -25,6 +25,7 @@
+ #include <signal.h> /* guess again */
+ #include <errno.h> /* guess again */
+ #include <unistd.h> /* unlink */
++#include <string.h> /* strcpy, bzero */
+ #include <sys/stat.h> /* chmod */
+
+ #include <linux/kd.h> /* linux hd* */
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Sat, 29 Dec 2018 23:52:58 -0600
+Subject: [PATCH 3/4] Update liblow.c for musl compatible
+
+Changed #include <sys/fcntl.h> to #include <fcntl.h>
+Changed SA_NOMASK to SA_NODEFER on lines 176, 367
+--- a/src/lib/liblow.c
++++ b/src/lib/liblow.c
+@@ -33,7 +33,7 @@
+ #include <sys/types.h> /* socket() */
+ #include <sys/socket.h> /* socket() */
+ #include <sys/un.h> /* struct sockaddr_un */
+-#include <sys/fcntl.h> /* O_RDONLY */
++#include <fcntl.h> /* O_RDONLY */
+ #include <sys/stat.h> /* stat() */
+
+ #ifdef SIGTSTP /* true if BSD system */
+@@ -173,7 +173,7 @@ static void gpm_suspend_hook (int signum)
+ /* Reincarnation. Prepare for another death early. */
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = gpm_suspend_hook;
+- sa.sa_flags = SA_NOMASK;
++ sa.sa_flags = SA_NODEFER;
+ sigaction (SIGTSTP, &sa, 0);
+
+ /* Pop the gpm stack by closing the useless connection */
+@@ -364,7 +364,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
+
+ /* if signal was originally ignored, job control is not supported */
+ if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) {
+- sa.sa_flags = SA_NOMASK;
++ sa.sa_flags = SA_NODEFER;
+ sa.sa_handler = gpm_suspend_hook;
+ sigaction(SIGTSTP, &sa, 0);
+ }
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Mon, 31 Dec 2018 18:41:19 -0600
+Subject: [PATCH 4/4] Aligned comments
+
+--- a/src/lib/liblow.c
++++ b/src/lib/liblow.c
+@@ -29,11 +29,12 @@
+ #include <string.h> /* strncmp */
+ #include <unistd.h> /* select(); */
+ #include <errno.h>
++#include <fcntl.h> /* O_RDONLY */
++
+ #include <sys/time.h> /* timeval */
+ #include <sys/types.h> /* socket() */
+ #include <sys/socket.h> /* socket() */
+ #include <sys/un.h> /* struct sockaddr_un */
+-#include <fcntl.h> /* O_RDONLY */
+ #include <sys/stat.h> /* stat() */
+
+ #ifdef SIGTSTP /* true if BSD system */
diff --git a/sys-libs/gpm/files/gpm-1.20.7-signedness.patch b/sys-libs/gpm/files/gpm-1.20.7-signedness.patch
new file mode 100644
index 000000000000..3904bfd6cca3
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-signedness.patch
@@ -0,0 +1,20 @@
+https://github.com/telmich/gpm/commit/4337fd9fc2d2ea83654f2ca69245503730231ac3
+
+From: iljavs <ivansprundel@ioactive.com>
+Date: Mon, 27 Jun 2016 01:17:57 -0700
+Subject: [PATCH] fix signedness issue
+
+This commit fixes a signedness issue, where a negative vc coming from a malicious client could possibly cause memory corruption.
+--- a/src/daemon/processconn.c
++++ b/src/daemon/processconn.c
+@@ -67,7 +67,8 @@ int processConn(int fd)
+ return -1;
+ }
+
+- if((vc = request->vc) > MAX_VC) {
++ vc = request->vc;
++ if(vc > MAX_VC || vc < 0) {
+ gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
+ free(info);
+ close(newfd);
+
diff --git a/sys-libs/gpm/gpm-1.20.7-r4.ebuild b/sys-libs/gpm/gpm-1.20.7-r4.ebuild
new file mode 100644
index 000000000000..d554df614508
--- /dev/null
+++ b/sys-libs/gpm/gpm-1.20.7-r4.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# emacs support disabled due to #99533 #335900
+
+EAPI=7
+
+inherit autotools linux-info systemd usr-ldscript multilib-minimal
+
+DESCRIPTION="Console-based mouse driver"
+HOMEPAGE="https://www.nico.schottelius.org/software/gpm/"
+SRC_URI="
+ https://www.nico.schottelius.org/software/${PN}/archives/${P}.tar.lzma
+ mirror://gentoo/${P}-docs.patch.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="selinux"
+
+RDEPEND="
+ sys-libs/ncurses:=[${MULTILIB_USEDEP}]
+ selinux? ( sec-policy/selinux-gpm )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ app-arch/xz-utils
+ sys-apps/texinfo
+ virtual/yacc"
+
+CONFIG_CHECK="~INPUT_MOUSEDEV"
+ERROR_INPUT_MOUSEDEV="CONFIG_INPUT_MOUSEDEV:\tis not set (required to expose mice for GPM)"
+
+pkg_pretend() {
+ check_extra_config
+}
+
+src_prepare() {
+ eapply "${FILESDIR}"/${P}-sysmacros.patch
+
+ # Hack up the docs until we get this sorted upstream.
+ # https://github.com/telmich/gpm/issues/8
+ eapply "${WORKDIR}"/${P}-docs.patch
+ touch -r . doc/* || die
+
+ # bug #629774
+ eapply "${FILESDIR}"/${P}-glibc-2.26.patch
+ # bug #705878
+ eapply "${FILESDIR}"/${P}-gcc-10.patch
+ # bug #829581
+ eapply "${FILESDIR}"/${P}-musl.patch
+ #
+ eapply "${FILESDIR}"/${P}-gcc-include.patch
+ eapply "${FILESDIR}"/${P}-signedness.patch
+
+ eapply_user
+
+ # fix ABI values
+ sed -i \
+ -e '/^abi_lev=/s:=.*:=1:' \
+ -e '/^abi_age=/s:=.*:=20:' \
+ configure.ac.footer || die
+ # Rebuild autotools since release doesn't include them.
+ # Should be fixed with the next release though.
+ # https://github.com/telmich/gpm/pull/15
+ sed -i -e '/ACLOCAL/,$d' autogen.sh || die
+ ./autogen.sh
+ eautoreconf
+
+ # Out-of-tree builds are broken.
+ # https://github.com/telmich/gpm/issues/16
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ econf \
+ --disable-static \
+ --sysconfdir="${EPREFIX}"/etc/gpm \
+ emacs="${BROOT}"/bin/false
+}
+
+_emake() {
+ emake \
+ EMACS=: ELISP="" \
+ $(multilib_is_native_abi || echo "PROG= ") \
+ "$@"
+}
+
+multilib_src_compile() {
+ _emake
+}
+
+multilib_src_test() {
+ _emake check
+}
+
+multilib_src_install() {
+ _emake DESTDIR="${D}" install
+
+ dosym libgpm.so.1 /usr/$(get_libdir)/libgpm.so
+ gen_usr_ldscript -a gpm
+}
+
+multilib_src_install_all() {
+ insinto /etc/gpm
+ doins conf/gpm-*.conf
+
+ dodoc README TODO doc/Announce doc/FAQ doc/README*
+
+ newinitd "${FILESDIR}"/gpm.rc6-2 gpm
+ newconfd "${FILESDIR}"/gpm.conf.d gpm
+ systemd_dounit "${FILESDIR}"/gpm.service
+}