summaryrefslogtreecommitdiff
path: root/dev-util/sdl-jstest
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-29 10:04:55 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-29 10:04:55 +0100
commit20325cfc3bd40d48d3c7034afaac4f5193d9c704 (patch)
treeb8e6ff7fc02271595e20f956b32cef56c41dafca /dev-util/sdl-jstest
parent14a6858a7d8bc085420a1430b3a3f67885019f27 (diff)
gentoo auto-resync : 29:08:2023 - 10:04:54
Diffstat (limited to 'dev-util/sdl-jstest')
-rw-r--r--dev-util/sdl-jstest/Manifest7
-rw-r--r--dev-util/sdl-jstest/files/sdl-jstest-0.2.2-appstream-util-nonet.patch35
-rw-r--r--dev-util/sdl-jstest/files/sdl-jstest-0.2.2-sdl1.patch42
-rw-r--r--dev-util/sdl-jstest/metadata.xml28
-rw-r--r--dev-util/sdl-jstest/sdl-jstest-0.2.2.ebuild70
-rw-r--r--dev-util/sdl-jstest/sdl-jstest-9999.ebuild65
6 files changed, 247 insertions, 0 deletions
diff --git a/dev-util/sdl-jstest/Manifest b/dev-util/sdl-jstest/Manifest
new file mode 100644
index 000000000000..a7469ed99e8b
--- /dev/null
+++ b/dev-util/sdl-jstest/Manifest
@@ -0,0 +1,7 @@
+AUX sdl-jstest-0.2.2-appstream-util-nonet.patch 1370 BLAKE2B a7fae0e41537bb780603330d7018b1f790a4e3a3dbc00e669b989fd310b1a2ed92913fe553e9079c9a5e850d7499381e3c3fa5378aa6bf328f8d91d76e4112ba SHA512 5283a949b800bbf4d34c0138ee7230a8059a64db2a40a701fda6b3f234991696667496540cacaeb1a6402c5a5dcdccd6f046db32e8ce595e4b7cad5241a11c26
+AUX sdl-jstest-0.2.2-sdl1.patch 1199 BLAKE2B 3faa164fa14ba0f39891bb719f029cf8384bb21842574aaf982789f84cd54ab67f65fd8e71a129581b1852181abd60c51b74c2c1a7c026ca94dbe389fafa52ae SHA512 da0e63ecfde9fb8008c752ef868536e45cf5547be5e7b451c493ce1f7227b9e6ceb2d80ca374fad49c4c74486c7668605d323d42fdbeb977322f60f1b4447632
+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
+EBUILD sdl-jstest-0.2.2.ebuild 1578 BLAKE2B 09e1b34969972a3d74aa0fccf4cc3d317176c0a70166191961e2c82bd5666a90c9f160f52fdc2f8e6efb0fb306041107b6d3cf94c761c73ef5564f3889be8cda SHA512 51f0ddd5f964a0cfc72d7bdad2a7e060a387fea6ead43cb687749839b416c9c856ae48986ae36504c0ed622c1c09ee7b095cca814e6183ddf6e04dc3052c998f
+EBUILD sdl-jstest-9999.ebuild 1487 BLAKE2B 61fabb76913947f1b608a0ca31ba011ac43e7b56cfb571cbe0db91251748979422c1283ed2ff7279c550a539723e0281ccde4aa6ff8bd8eaf123e9ab4203fcd8 SHA512 62e83878e5fa34f1d1eb40174ff18d6ef8264a0fe78c37bbff955eb8b45444a741d394879b16a134d632768822481beca604441fad710dc6e95654641879ce66
+MISC metadata.xml 1105 BLAKE2B 1f39f01d735d356abc6fb2fa351ecb83f1726df58d3c6d6cff02975b86cd5593b1f23f98d36313b0d5719b1104ff8f4d094c427528d33f9562e5a5692d473d36 SHA512 ddd16b5dd98f264c48eb5464eeb58ab8e355c9e99add572c7e6bf55594b1ea61462b4554862d1813c313fe124e17b58dff0213879fcf1e2493efbb12b5d4932b
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
+}