public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-libs/tslib/files/, x11-libs/tslib/
@ 2025-05-09 17:51 Andreas Sturmlechner
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2025-05-09 17:51 UTC (permalink / raw
  To: gentoo-commits

commit:     488acab5c1132b8013a8f17480cb6f32928c875c
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri May  9 17:47:32 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri May  9 17:51:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=488acab5

x11-libs/tslib: add 1.23, fix build w/ cmake-4

Closes: https://bugs.gentoo.org/955696
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 x11-libs/tslib/Manifest                      |  1 +
 x11-libs/tslib/files/tslib-1.23-cmake4.patch | 11 +++++
 x11-libs/tslib/tslib-1.23.ebuild             | 61 ++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+)

diff --git a/x11-libs/tslib/Manifest b/x11-libs/tslib/Manifest
index d19e2a411882..fc6d780936f9 100644
--- a/x11-libs/tslib/Manifest
+++ b/x11-libs/tslib/Manifest
@@ -1 +1,2 @@
 DIST tslib-1.22.tar.xz 351192 BLAKE2B 8cec9fe17b9aee7dac44bf54a78482b81a67072a7c1497b4c5a2a6703bb0e897a2481bc06df0fd91ca97fef3b4ebf17c475c3b717ce7f32fb677db5918630759 SHA512 8f51fc5e37bb1babb89e8d6d5302c7d7b712820525bed0253f980028a78b343e4100065bbe0ecafb828a7edf3a9b77f96929ab79205d516ebbf6c25b32af0008
+DIST tslib-1.23.tar.xz 360140 BLAKE2B 7cba3a4f9ddb91a1325c6fbfbd6d1c5d42e1847e82199eff329206519fe88da05ee7ca1d0f72ddd8b8d303d122208e74a98a07f642dafc359c29a99c284f34c6 SHA512 0fbd8e859fe7c24410a1436d3e12f618775e8594dc720ff98d12c8e8cef1ad07a36eb6f5911b2c4d976cc32ab75dd8988bd814379e1b7d8d35d88d7cf2b44dd1

diff --git a/x11-libs/tslib/files/tslib-1.23-cmake4.patch b/x11-libs/tslib/files/tslib-1.23-cmake4.patch
new file mode 100644
index 000000000000..e4c26352d018
--- /dev/null
+++ b/x11-libs/tslib/files/tslib-1.23-cmake4.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,7 +8,7 @@
+ #
+ #
+ 
+-cmake_minimum_required(VERSION 3.3)
++cmake_minimum_required(VERSION 3.5)
+ 
+ project(tslib LANGUAGES C)
+ 

diff --git a/x11-libs/tslib/tslib-1.23.ebuild b/x11-libs/tslib/tslib-1.23.ebuild
new file mode 100644
index 000000000000..141b18585de7
--- /dev/null
+++ b/x11-libs/tslib/tslib-1.23.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Touchscreen Access Library"
+HOMEPAGE="https://github.com/kergoth/tslib"
+SRC_URI="https://github.com/libts/tslib/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-2 uinput? ( GPL-2+ )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="evdev sdl uinput"
+
+DEPEND="
+	evdev? ( dev-libs/libevdev[${MULTILIB_USEDEP}] )
+	sdl? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="evdev? ( virtual/pkgconfig )"
+
+DOCS=( AUTHORS NEWS README{,.md} )
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.21-optional-utils.patch"
+	"${FILESDIR}/${P}-cmake4.patch" # bug 955696
+)
+
+src_configure() {
+	my_configure() {
+		local mycmakeargs=(
+			-Denable-input-evdev=$(usex evdev)
+			-DENABLE_TOOLS=$(usex uinput $(multilib_is_native_abi && echo ON || echo OFF) OFF)
+			-DENABLE_UTILS=$(multilib_is_native_abi && echo ON || echo OFF)
+			-Denable-arctic2=ON
+			-Denable-collie=ON
+			-Denable-corgi=ON
+			-Denable-cy8mrln-palmpre=ON
+			-Denable-dejitter=ON
+			-Denable-dmc=ON
+			-Denable-dmc_dus3000=ON
+			-Denable-galax=ON
+			-Denable-h3600=ON
+			-Denable-input=ON
+			-Denable-linear-h2200=ON
+			-Denable-linear=ON
+			-Denable-mk712=ON
+			-Denable-one-wire-ts-input=ON
+			-Denable-pthres=ON
+			-Denable-tatung=ON
+			-Denable-ucb1x00=ON
+			-Denable-variance=ON
+		)
+		multilib_is_native_abi && mycmakeargs+=( -Dwith-sdl=$(usex sdl) )
+
+		cmake_src_configure
+	}
+	multilib_parallel_foreach_abi my_configure
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-libs/tslib/files/, x11-libs/tslib/
@ 2025-10-17 13:09 Andreas Sturmlechner
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2025-10-17 13:09 UTC (permalink / raw
  To: gentoo-commits

commit:     00d7f2a3d8a295d79c9f300dcbfa12cb6a4d0ae4
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 17 11:00:52 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Oct 17 13:09:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00d7f2a3

x11-libs/tslib: Fix CMake <3.10 warning, build w/ 32-bit and printf UB

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 x11-libs/tslib/files/tslib-1.23-cmake4-1.patch     |  30 +++
 .../tslib-1.23-fix-64bit-time_t-printf-ub.patch    | 213 +++++++++++++++++++++
 x11-libs/tslib/tslib-1.23-r1.ebuild                |  62 ++++++
 3 files changed, 305 insertions(+)

diff --git a/x11-libs/tslib/files/tslib-1.23-cmake4-1.patch b/x11-libs/tslib/files/tslib-1.23-cmake4-1.patch
new file mode 100644
index 000000000000..b8c28114ca82
--- /dev/null
+++ b/x11-libs/tslib/files/tslib-1.23-cmake4-1.patch
@@ -0,0 +1,30 @@
+From eaa4a100fdcb5e2eac02d8b44a73cd6ad9caafd8 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Fri, 17 Oct 2025 12:44:25 +0200
+Subject: [PATCH] Bump minimum CMAKE_MINIMUM_REQUIRED version to 3.5, set range
+ up to 3.31
+
+CMake 3.31 started to warn about removing < 3.10 compatibility in the future.
+CMake 4 dropped < 3.5 compatibility.
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 269ea77..6bacc4f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,7 +8,7 @@
+ #
+ #
+ 
+-cmake_minimum_required(VERSION 3.3)
++cmake_minimum_required(VERSION 3.10..3.31)
+ 
+ project(tslib LANGUAGES C)
+ 
+-- 
+2.51.0
+

diff --git a/x11-libs/tslib/files/tslib-1.23-fix-64bit-time_t-printf-ub.patch b/x11-libs/tslib/files/tslib-1.23-fix-64bit-time_t-printf-ub.patch
new file mode 100644
index 000000000000..392d56e4f418
--- /dev/null
+++ b/x11-libs/tslib/files/tslib-1.23-fix-64bit-time_t-printf-ub.patch
@@ -0,0 +1,213 @@
+Source:
+  [PATCH 1/2]: git master
+  [PATCH 2/2]: https://github.com/libts/tslib/pull/229
+
+From acc471e96693b3f772b42687c5378591f0ed54ae Mon Sep 17 00:00:00 2001
+From: steini2001 <179123067+steini2001@users.noreply.github.com>
+Date: Tue, 12 Nov 2024 14:25:15 +0100
+Subject: [PATCH 1/2] Fix build on 32bit arches with 64bit time_t and debug
+ enabled
+
+commit a7a39a6 forgot this one
+---
+ plugins/input-raw.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/input-raw.c b/plugins/input-raw.c
+index 0e8a22f..da22720 100644
+--- a/plugins/input-raw.c
++++ b/plugins/input-raw.c
+@@ -650,8 +650,8 @@ static int ts_input_read_mt(struct tslib_module_info *inf,
+ 		#ifdef DEBUG
+ 			printf("INPUT-RAW: read type %d  code %3d  value %4d  time %ld.%ld\n",
+ 			       i->ev[it].type, i->ev[it].code,
+-			       i->ev[it].value, (long)i->ev[it].time.tv_sec,
+-			       (long)i->ev[it].time.tv_usec);
++			       i->ev[it].value, (long)i->ev[it].input_event_sec,
++			       (long)i->ev[it].input_event_usec);
+ 		#endif
+ 			switch (i->ev[it].type) {
+ 			case EV_KEY:
+-- 
+2.51.0
+
+
+From 32cf8d1b9e38b5eada97b00c73999af48be2d1cb Mon Sep 17 00:00:00 2001
+From: steini2001 <179123067+steini2001@users.noreply.github.com>
+Date: Tue, 12 Nov 2024 15:02:31 +0100
+Subject: [PATCH 2/2] fix printf with 64bit time_t
+
+Printing long long with %ld is UB. Converting long long to long could overflow.
+To be compatible with 32bit time_t we need an explicit cast to long long.
+---
+ README.md                 |  6 +++---
+ plugins/input-evdev-raw.c | 14 +++++++-------
+ plugins/input-raw.c       | 12 ++++++------
+ tests/ts_print.c          |  2 +-
+ tests/ts_print_mt.c       |  6 +++---
+ tests/ts_print_raw.c      |  2 +-
+ tests/ts_test.c           |  2 +-
+ tests/ts_test_mt_sdl.c    |  6 +++---
+ 8 files changed, 25 insertions(+), 25 deletions(-)
+
+diff --git a/README.md b/README.md
+index aaec82d..1d781b8 100644
+--- a/README.md
++++ b/README.md
+@@ -585,9 +585,9 @@ This is a complete example program, similar to `ts_print_mt.c`:
+ 					continue;
+ 			#endif
+ 
+-				printf("%ld.%06ld: (slot %d) %6d %6d %6d\n",
+-				       samp_mt[j][i].tv.tv_sec,
+-				       samp_mt[j][i].tv.tv_usec,
++				printf("%lld.%06lld: (slot %d) %6d %6d %6d\n",
++				       (long long)samp_mt[j][i].tv.tv_sec,
++				       (long long)samp_mt[j][i].tv.tv_usec,
+ 				       samp_mt[j][i].slot,
+ 				       samp_mt[j][i].x,
+ 				       samp_mt[j][i].y,
+diff --git a/plugins/input-evdev-raw.c b/plugins/input-evdev-raw.c
+index d187645..24208cf 100644
+--- a/plugins/input-evdev-raw.c
++++ b/plugins/input-evdev-raw.c
+@@ -461,11 +461,11 @@ static int ts_input_read(struct tslib_module_info *inf,
+ 				samp->tv = ev.time;
+ 		#ifdef DEBUG
+ 			fprintf(stderr,
+-				"RAW nr %d ---------------------> %d %d %d %ld.%ld\n",
++				"RAW nr %d ---------------------> %d %d %d %lld.%06lld\n",
+ 				total,
+ 				samp->x, samp->y, samp->pressure,
+-				(long)samp->tv.tv_sec,
+-				(long)samp->tv.tv_usec);
++				(long long)samp->tv.tv_sec,
++				(long long)samp->tv.tv_usec);
+ 		#endif /* DEBUG */
+ 				samp++;
+ 				total++;
+@@ -651,11 +651,11 @@ static int ts_input_read_mt(struct tslib_module_info *inf,
+ 		}
+ 
+ 	#ifdef DEBUG
+-		printf("INPUT-RAW nr %d: read type %d  code %3d  value %4d  time %ld.%ld\n",
++		printf("INPUT-RAW nr %d: read type %d  code %3d  value %4d  time %lld.%06lld\n",
+ 		       total,
+-		       ev.type, ev.code,
+-		       ev.value, (long)ev.time.tv_sec,
+-		       (long)ev.time.tv_usec);
++		       ev.type, ev.code, ev.value,
++		       (long long)ev.time.tv_sec,
++		       (long long)ev.time.tv_usec);
+ 	#endif
+ 		switch (ev.type) {
+ 		case EV_KEY:
+diff --git a/plugins/input-raw.c b/plugins/input-raw.c
+index da22720..ae0cad6 100644
+--- a/plugins/input-raw.c
++++ b/plugins/input-raw.c
+@@ -393,10 +393,10 @@ static int ts_input_read(struct tslib_module_info *inf,
+ 					samp->tv.tv_usec = ev.input_event_usec;
+ 			#ifdef DEBUG
+ 				fprintf(stderr,
+-					"RAW---------------------> %d %d %d %ld.%ld\n",
++					"RAW---------------------> %d %d %d %lld.%06lld\n",
+ 					samp->x, samp->y, samp->pressure,
+-					(long)samp->tv.tv_sec,
+-					(long)samp->tv.tv_usec);
++					(long long)samp->tv.tv_sec,
++					(long long)samp->tv.tv_usec);
+ 			#endif /* DEBUG */
+ 					samp++;
+ 					total++;
+@@ -648,10 +648,10 @@ static int ts_input_read_mt(struct tslib_module_info *inf,
+ 
+ 		for (it = 0; it < rd / sizeof(struct input_event); it++) {
+ 		#ifdef DEBUG
+-			printf("INPUT-RAW: read type %d  code %3d  value %4d  time %ld.%ld\n",
++			printf("INPUT-RAW: read type %d  code %3d  value %4d  time %lld.%06lld\n",
+ 			       i->ev[it].type, i->ev[it].code,
+-			       i->ev[it].value, (long)i->ev[it].input_event_sec,
+-			       (long)i->ev[it].input_event_usec);
++			       i->ev[it].value, (long long)i->ev[it].input_event_sec,
++			       (long long)i->ev[it].input_event_usec);
+ 		#endif
+ 			switch (i->ev[it].type) {
+ 			case EV_KEY:
+diff --git a/tests/ts_print.c b/tests/ts_print.c
+index e9e6c4f..406a087 100644
+--- a/tests/ts_print.c
++++ b/tests/ts_print.c
+@@ -106,7 +106,7 @@ int main(int argc, char **argv)
+ 		if (ret != 1)
+ 			continue;
+ 
+-		printf("%ld.%06ld: %6d %6d %6d\n", samp.tv.tv_sec, samp.tv.tv_usec, samp.x, samp.y, samp.pressure);
++		printf("%lld.%06lld: %6d %6d %6d\n", (long long)samp.tv.tv_sec, (long long)samp.tv.tv_usec, samp.x, samp.y, samp.pressure);
+ 
+ 	}
+ 
+diff --git a/tests/ts_print_mt.c b/tests/ts_print_mt.c
+index 6f18c67..5779ca2 100644
+--- a/tests/ts_print_mt.c
++++ b/tests/ts_print_mt.c
+@@ -254,10 +254,10 @@ int main(int argc, char **argv)
+ 				if (!(samp_mt[j][i].valid & TSLIB_MT_VALID))
+ 					continue;
+ 
+-				printf(YELLOW "sample %d - %ld.%06ld -" RESET " (slot %d) %6d %6d %6d\n",
++				printf(YELLOW "sample %d - %lld.%06lld -" RESET " (slot %d) %6d %6d %6d\n",
+ 				       j,
+-				       samp_mt[j][i].tv.tv_sec,
+-				       samp_mt[j][i].tv.tv_usec,
++				       (long long)samp_mt[j][i].tv.tv_sec,
++				       (long long)samp_mt[j][i].tv.tv_usec,
+ 				       samp_mt[j][i].slot,
+ 				       samp_mt[j][i].x,
+ 				       samp_mt[j][i].y,
+diff --git a/tests/ts_print_raw.c b/tests/ts_print_raw.c
+index b9e9466..a4dae3d 100644
+--- a/tests/ts_print_raw.c
++++ b/tests/ts_print_raw.c
+@@ -83,7 +83,7 @@ int main(int argc, char **argv)
+ 		if (ret != 1)
+ 			continue;
+ 
+-		printf("%ld.%06ld: %6d %6d %6d\n", samp.tv.tv_sec, samp.tv.tv_usec, samp.x, samp.y, samp.pressure);
++		printf("%lld.%06lld: %6d %6d %6d\n", (long long)samp.tv.tv_sec, (long long)samp.tv.tv_usec, samp.x, samp.y, samp.pressure);
+ 
+ 	}
+ 
+diff --git a/tests/ts_test.c b/tests/ts_test.c
+index c9ced73..4d6a5ca 100644
+--- a/tests/ts_test.c
++++ b/tests/ts_test.c
+@@ -202,7 +202,7 @@ int main(int argc, char **argv)
+ 					quit_pressed = 1;
+ 				}
+ 
+-		printf("%ld.%06ld: %6d %6d %6d\n", samp.tv.tv_sec, samp.tv.tv_usec,
++		printf("%lld.%06lld: %6d %6d %6d\n", (long long)samp.tv.tv_sec, (long long)samp.tv.tv_usec,
+ 			samp.x, samp.y, samp.pressure);
+ 
+ 		if (samp.pressure > 0) {
+diff --git a/tests/ts_test_mt_sdl.c b/tests/ts_test_mt_sdl.c
+index 556c949..bc4808a 100644
+--- a/tests/ts_test_mt_sdl.c
++++ b/tests/ts_test_mt_sdl.c
+@@ -200,9 +200,9 @@ int main(int argc, char **argv)
+ 				       samp_mt[0][i].x, samp_mt[0][i].y);
+ 
+ 			if (verbose) {
+-				printf("%ld.%06ld: (slot %d) %6d %6d %6d\n",
+-					samp_mt[0][i].tv.tv_sec,
+-					samp_mt[0][i].tv.tv_usec,
++				printf("%lld.%06lld: (slot %d) %6d %6d %6d\n",
++					(long long)samp_mt[0][i].tv.tv_sec,
++					(long long)samp_mt[0][i].tv.tv_usec,
+ 					samp_mt[0][i].slot,
+ 					samp_mt[0][i].x,
+ 					samp_mt[0][i].y,
+-- 
+2.51.0
+

diff --git a/x11-libs/tslib/tslib-1.23-r1.ebuild b/x11-libs/tslib/tslib-1.23-r1.ebuild
new file mode 100644
index 000000000000..6a9d962ecebe
--- /dev/null
+++ b/x11-libs/tslib/tslib-1.23-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Touchscreen Access Library"
+HOMEPAGE="https://github.com/kergoth/tslib"
+SRC_URI="https://github.com/libts/tslib/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-2 uinput? ( GPL-2+ )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="evdev sdl uinput"
+
+DEPEND="
+	evdev? ( dev-libs/libevdev[${MULTILIB_USEDEP}] )
+	sdl? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="evdev? ( virtual/pkgconfig )"
+
+DOCS=( AUTHORS NEWS README{,.md} )
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.21-optional-utils.patch"
+	"${FILESDIR}/${P}-cmake4-1.patch" # bug 955696
+	"${FILESDIR}/${P}-fix-64bit-time_t-printf-ub.patch"
+)
+
+src_configure() {
+	my_configure() {
+		local mycmakeargs=(
+			-Denable-input-evdev=$(usex evdev)
+			-DENABLE_TOOLS=$(usex uinput $(multilib_is_native_abi && echo ON || echo OFF) OFF)
+			-DENABLE_UTILS=$(multilib_is_native_abi && echo ON || echo OFF)
+			-Denable-arctic2=ON
+			-Denable-collie=ON
+			-Denable-corgi=ON
+			-Denable-cy8mrln-palmpre=ON
+			-Denable-dejitter=ON
+			-Denable-dmc=ON
+			-Denable-dmc_dus3000=ON
+			-Denable-galax=ON
+			-Denable-h3600=ON
+			-Denable-input=ON
+			-Denable-linear-h2200=ON
+			-Denable-linear=ON
+			-Denable-mk712=ON
+			-Denable-one-wire-ts-input=ON
+			-Denable-pthres=ON
+			-Denable-tatung=ON
+			-Denable-ucb1x00=ON
+			-Denable-variance=ON
+		)
+		multilib_is_native_abi && mycmakeargs+=( -Dwith-sdl=$(usex sdl) )
+
+		cmake_src_configure
+	}
+	multilib_parallel_foreach_abi my_configure
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-17 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09 17:51 [gentoo-commits] repo/gentoo:master commit in: x11-libs/tslib/files/, x11-libs/tslib/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2025-10-17 13:09 Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox