From 8448af4975a158f4a9dd0333e4f0589c3e9bf55b Mon Sep 17 00:00:00 2001 From: llm96 Date: Tue, 22 Jul 2025 06:12:42 +0100 Subject: [PATCH] [new-package] hidapitester 0.5 (#24899) --- .../0001-Shared-link-with-hidapi.patch | 14 +++++++ mingw-w64-hidapitester/PKGBUILD | 37 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 mingw-w64-hidapitester/0001-Shared-link-with-hidapi.patch create mode 100644 mingw-w64-hidapitester/PKGBUILD diff --git a/mingw-w64-hidapitester/0001-Shared-link-with-hidapi.patch b/mingw-w64-hidapitester/0001-Shared-link-with-hidapi.patch new file mode 100644 index 0000000000..1bff8710bb --- /dev/null +++ b/mingw-w64-hidapitester/0001-Shared-link-with-hidapi.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile b/Makefile +index d0c2f93..93fdd88 100644 +--- a/Makefile ++++ b/Makefile +@@ -57,8 +57,7 @@ ifeq (default,$(origin CC)) + CC = gcc + endif + +-LIBS += -lsetupapi -Wl,--enable-auto-import -static-libgcc -static-libstdc++ +-OBJS = $(HIDAPI_DIR)/windows/hid.o ++LIBS += -lsetupapi -lhidapi -Wl,--enable-auto-import + EXE=.exe + + endif diff --git a/mingw-w64-hidapitester/PKGBUILD b/mingw-w64-hidapitester/PKGBUILD new file mode 100644 index 0000000000..b99a8c09d6 --- /dev/null +++ b/mingw-w64-hidapitester/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: llm96 + +_realname=hidapitester +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver="0.5" +pkgrel=1 +pkgdesc="Simple command-line program to test HIDAPI (mingw-w64)" +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://github.com/todbot/hidapitester' +license=('spdx:GPL-3.0-or-later') +makedepends=("${MINGW_PACKAGE_PREFIX}-make" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-hidapi") +source=("${url}/archive/refs/tags/v${pkgver}.tar.gz" + "0001-Shared-link-with-hidapi.patch") +sha256sums=('286b7d3b3b8660adf9ce3360916d03bbeb99886a5890069ec57578174de7b299' + 'a76d5128f92415b5f7f07eb96d0c676883ff7e1f4ba2eff468dfd8642ec6be7d') + +prepare() { + cd "${_realname}-${pkgver}" + patch -p1 -i "${srcdir}/0001-Shared-link-with-hidapi.patch" +} + +build() { + cd "${_realname}-${pkgver}" + + HIDAPI_DIR="${MINGW_PREFIX}/include" make +} + +package() { + cd "${_realname}-${pkgver}" + + install -Dm755 "${srcdir}/${_realname}-${pkgver}/hidapitester.exe" "${pkgdir}${MINGW_PREFIX}/bin/hidapitester.exe" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +}