diff options
author | orbea <orbea@riseup.net> | 2023-07-12 08:28:19 -0700 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-08-29 07:09:11 +0100 |
commit | be7ff121c96af6cfe1cc0527176a84216e977052 (patch) | |
tree | 5bf8259fc0367d11b6f6e65c81c4ce17f988991c /dev-util/sdl-jstest | |
parent | dev-util/tinycmmc: new package, add 0.1.0, 9999 (diff) | |
download | gentoo-be7ff121c96af6cfe1cc0527176a84216e977052.tar.gz gentoo-be7ff121c96af6cfe1cc0527176a84216e977052.tar.bz2 gentoo-be7ff121c96af6cfe1cc0527176a84216e977052.zip |
dev-util/sdl-jstest: new package, add 0.2.2, 9999
Closes: https://bugs.gentoo.org/912236
Signed-off-by: orbea <orbea@riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/31851
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/sdl-jstest')
-rw-r--r-- | dev-util/sdl-jstest/Manifest | 2 | ||||
-rw-r--r-- | dev-util/sdl-jstest/files/sdl-jstest-0.2.2-appstream-util-nonet.patch | 35 | ||||
-rw-r--r-- | dev-util/sdl-jstest/files/sdl-jstest-0.2.2-sdl1.patch | 42 | ||||
-rw-r--r-- | dev-util/sdl-jstest/metadata.xml | 28 | ||||
-rw-r--r-- | dev-util/sdl-jstest/sdl-jstest-0.2.2.ebuild | 70 | ||||
-rw-r--r-- | dev-util/sdl-jstest/sdl-jstest-9999.ebuild | 65 |
6 files changed, 242 insertions, 0 deletions
diff --git a/dev-util/sdl-jstest/Manifest b/dev-util/sdl-jstest/Manifest new file mode 100644 index 000000000000..8d652f251134 --- /dev/null +++ b/dev-util/sdl-jstest/Manifest @@ -0,0 +1,2 @@ +DIST sdl-jstest-0.2.2.tar.gz 24018 BLAKE2B 21d5b50fceb6543084c68d04c732e8e45722fd36b7fecdc96e1c360da0d139dacf0a127c54f20bf008181390a201a1c9cf448945719f94721eb7931c1a4f23f9 SHA512 56d8688b22e86f307d94ec3b45f2c1a6068c92745e02e477a956218126e97c45d8f8a8606638e98f25ffa5893d7e52622df799815a64d05c0f09d466a8a33346 +DIST sdl-jstest-sdl_gamecontrollerdb-69c2ca071a.tar.gz 61994 BLAKE2B 41ae614dbdcbc4b820cd5586798cef4d56eefe58386829dc502552f0696ffd53fb1320a970e1a25fde29ba2e3243b0feae3e58014dfbd7e43cb85abf90cbc03e SHA512 d295f484ee108a18e48003321fb92e3ccb3f7b6885ddc3a0a4a20df7b6c25dba2e1d067f50ba5596ed246d08ed7d243cd0d2791f6c01c9fc6f1f440aa52fb2f6 diff --git a/dev-util/sdl-jstest/files/sdl-jstest-0.2.2-appstream-util-nonet.patch b/dev-util/sdl-jstest/files/sdl-jstest-0.2.2-appstream-util-nonet.patch new file mode 100644 index 000000000000..bcbb99518597 --- /dev/null +++ b/dev-util/sdl-jstest/files/sdl-jstest-0.2.2-appstream-util-nonet.patch @@ -0,0 +1,35 @@ +https://github.com/Grumbel/sdl-jstest/issues/17 +https://github.com/Grumbel/sdl-jstest/commit/d442ee9e2c4dda1fd43cb3201ea8edf8222ee66c.patch + +From d442ee9e2c4dda1fd43cb3201ea8edf8222ee66c Mon Sep 17 00:00:00 2001 +From: Ingo Ruhnke <grumbel@gmail.com> +Date: Fri, 14 Jul 2023 10:25:11 +0200 +Subject: [PATCH] Disable tests requiring network access + +Fixes #17 +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1e4284..09d3e2e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,7 +68,7 @@ if(BUILD_SDL_JSTEST) + if (BUILD_TESTS) + add_test(NAME sdl-jstest.appdata.xml + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +- COMMAND appstream-util validate-relax ${CMAKE_CURRENT_BINARY_DIR}/sdl-jstest.appdata.xml) ++ COMMAND appstream-util validate-relax --nonet ${CMAKE_CURRENT_BINARY_DIR}/sdl-jstest.appdata.xml) + endif(BUILD_TESTS) + + file(COPY sdl-jstest.1 +@@ -101,7 +101,7 @@ if(BUILD_SDL2_JSTEST) + if (BUILD_TESTS) + add_test(NAME sdl2-jstest.appdata.xml + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +- COMMAND appstream-util validate-relax ${CMAKE_CURRENT_BINARY_DIR}/sdl2-jstest.appdata.xml) ++ COMMAND appstream-util validate-relax --nonet ${CMAKE_CURRENT_BINARY_DIR}/sdl2-jstest.appdata.xml) + endif(BUILD_TESTS) + + file(COPY sdl2-jstest.1 diff --git a/dev-util/sdl-jstest/files/sdl-jstest-0.2.2-sdl1.patch b/dev-util/sdl-jstest/files/sdl-jstest-0.2.2-sdl1.patch new file mode 100644 index 000000000000..d90024019e14 --- /dev/null +++ b/dev-util/sdl-jstest/files/sdl-jstest-0.2.2-sdl1.patch @@ -0,0 +1,42 @@ +https://github.com/Grumbel/sdl-jstest/issues/15 +https://github.com/Grumbel/sdl-jstest/commit/62124aa8b9d4c3a8eec5206bf0fc09fade52b326 + +From 62124aa8b9d4c3a8eec5206bf0fc09fade52b326 Mon Sep 17 00:00:00 2001 +From: Ingo Ruhnke <grumbel@gmail.com> +Date: Wed, 12 Jul 2023 17:34:38 +0200 +Subject: [PATCH] Fix initial blank screen in sdl-jstest + +Screen was left blank due to only getting drawn once a new event +arrived. + +Fixes #15 +--- + src/sdl-jstest.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/sdl-jstest.c b/src/sdl-jstest.c +index 388e84d..bc95024 100644 +--- a/src/sdl-jstest.c ++++ b/src/sdl-jstest.c +@@ -192,11 +192,11 @@ int main(int argc, char** argv) + + int quit = 0; + SDL_Event event; ++ bool something_new = TRUE; + while(!quit) + { + SDL_Delay(10); + +- bool something_new = FALSE; + while (SDL_PollEvent(&event)) { + something_new = TRUE; + switch(event.type) +@@ -302,6 +302,8 @@ int main(int argc, char** argv) + printw("Press Ctrl-c to exit\n"); + + refresh(); ++ ++ something_new = FALSE; + } + + if ( getch() == 3 ) // Ctrl-c diff --git a/dev-util/sdl-jstest/metadata.xml b/dev-util/sdl-jstest/metadata.xml new file mode 100644 index 000000000000..4e991521b8b8 --- /dev/null +++ b/dev-util/sdl-jstest/metadata.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM 'https://www.gentoo.org/dtd/metadata.dtd'> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>orbea@riseup.net</email> + <name>orbea</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <use> + <flag name="sdl1">Enable <pkg>media-libs/libsdl</pkg> based input test</flag> + <flag name="sdl">Enable <pkg>media-libs/libsdl2</pkg> based input test</flag> + </use> + <longdescription> + sdl-jstest and sdl2-jstest are simple programs that lets you find + out how many joysticks SDL or SDL2 detected on your system, how many + axes, buttons, hats and balls they have each. They also lets you test + the joysticks by displaying the events they send or by displaying + their current button, axis, hat or ball state. sdl-jstest is + especially useful if you want to test your SDL_LINUX_JOYSTICK + configuration. + </longdescription> + <upstream> + <remote-id type="github">Grumbel/sdl-jstest</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-util/sdl-jstest/sdl-jstest-0.2.2.ebuild b/dev-util/sdl-jstest/sdl-jstest-0.2.2.ebuild new file mode 100644 index 000000000000..5494d36cbeee --- /dev/null +++ b/dev-util/sdl-jstest/sdl-jstest-0.2.2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +if [[ ${PV} == 9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/Grumbel/${PN}.git" +else + HASH_GAMECONTROLLERDB="69c2ca071ac380569b7037e05d9153a08e2e7651" + SRC_URI=" + https://github.com/Grumbel/${PN}/archive/v${PV}/${P}.tar.gz + https://github.com/gabomdq/SDL_GameControllerDB/archive/${HASH_GAMECONTROLLERDB}.tar.gz + -> ${PN}-sdl_gamecontrollerdb-${HASH_GAMECONTROLLERDB::10}.tar.gz + " + KEYWORDS="~amd64" +fi + +DESCRIPTION="Simple SDL joystick test application for the console" +HOMEPAGE="https://github.com/Grumbel/sdl-jstest" + +LICENSE="GPL-3+ ZLIB" +SLOT="0" +IUSE="+sdl sdl1 test" +REQUIRED_USE="|| ( sdl sdl1 )" +RESTRICT="!test? ( test )" + +DEPEND=" + sdl1? ( media-libs/libsdl[joystick] ) + sdl? ( media-libs/libsdl2[haptic,joystick] ) + sys-libs/ncurses:= +" +RDEPEND="${DEPEND}" +BDEPEND=" + test? ( dev-libs/appstream-glib ) + dev-util/tinycmmc + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${P}-appstream-util-nonet.patch + "${FILESDIR}"/${P}-sdl1.patch +) + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + local EGIT_SUBMODULES=( external/sdl_gamecontrollerdb ) + + git-r3_src_unpack + else + default + + rmdir "${S}"/external/sdl_gamecontrollerdb || die + mv SDL_GameControllerDB-${HASH_GAMECONTROLLERDB} \ + "${S}"/external/sdl_gamecontrollerdb || die + fi +} + +src_configure() { + local mycmakeargs=( + -DBUILD_SDL2_JSTEST=$(usex sdl) + -DBUILD_SDL_JSTEST=$(usex sdl1) + -DBUILD_TESTS=$(usex test) + -DWARNINGS=ON + ) + + cmake_src_configure +} diff --git a/dev-util/sdl-jstest/sdl-jstest-9999.ebuild b/dev-util/sdl-jstest/sdl-jstest-9999.ebuild new file mode 100644 index 000000000000..c2514acce683 --- /dev/null +++ b/dev-util/sdl-jstest/sdl-jstest-9999.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +if [[ ${PV} == 9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/Grumbel/${PN}.git" +else + HASH_GAMECONTROLLERDB="69c2ca071ac380569b7037e05d9153a08e2e7651" + SRC_URI=" + https://github.com/Grumbel/${PN}/archive/v${PV}/${P}.tar.gz + https://github.com/gabomdq/SDL_GameControllerDB/archive/${HASH_GAMECONTROLLERDB}.tar.gz + -> ${PN}-sdl_gamecontrollerdb-${HASH_GAMECONTROLLERDB::10}.tar.gz + " + KEYWORDS="~amd64" +fi + +DESCRIPTION="Simple SDL joystick test application for the console" +HOMEPAGE="https://github.com/Grumbel/sdl-jstest" + +LICENSE="GPL-3+ ZLIB" +SLOT="0" +IUSE="+sdl sdl1 test" +REQUIRED_USE="|| ( sdl sdl1 )" +RESTRICT="!test? ( test )" + +DEPEND=" + sdl1? ( media-libs/libsdl[joystick] ) + sdl? ( media-libs/libsdl2[haptic,joystick] ) + sys-libs/ncurses:= +" +RDEPEND="${DEPEND}" +BDEPEND=" + test? ( dev-libs/appstream-glib ) + dev-util/tinycmmc + virtual/pkgconfig +" + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + local EGIT_SUBMODULES=( external/sdl_gamecontrollerdb ) + + git-r3_src_unpack + else + default + + rmdir "${S}"/external/sdl_gamecontrollerdb || die + mv SDL_GameControllerDB-${HASH_GAMECONTROLLERDB} \ + "${S}"/external/sdl_gamecontrollerdb || die + fi +} + +src_configure() { + local mycmakeargs=( + -DBUILD_SDL2_JSTEST=$(usex sdl) + -DBUILD_SDL_JSTEST=$(usex sdl1) + -DBUILD_TESTS=$(usex test) + -DWARNINGS=ON + ) + + cmake_src_configure +} |