pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/comms/libhidapi



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Fri Mar 13 10:37:25 UTC 2026

Modified Files:
        pkgsrc/comms/libhidapi: Makefile PLIST distinfo
Added Files:
        pkgsrc/comms/libhidapi/patches: patch-netbsd_CMakeLists.txt
            patch-netbsd_hid.c

Log Message:
libhidapi: update to 0.15.0

pkgsrc changes:

 - add PLIST_VARS for libhidapi-netbsd (NetBSD HID native backend)
 - pull iconv(3) const check from libusb version
 - check both addr 0 and 1 on enumerating devices (see NetBSD PR/60073)

Upstream changes:
 https://github.com/libusb/hidapi/releases/tag/hidapi-0.15.0

general: Add hid_send_output_report() (#677)
general: Add hid_read_error() (#721)

winapi: add hid_winapi_set_write_timeout (#700)
winapi: improvements for hid_get_report_descriptor/hid_winapi_descriptor_reconstruct_pp_data (#707)

hidraw: report only Top-Level Usage_page/Usage pairs as 'unique' devices (#601)

macOS: add option to mimic 1.0.0 compatibility version (#709)

NetBSD: UHID native backend implementation (#612)

libusb: add abstraction for thread model, allow building using non-POSIX runtime
libusb: enable support for Xbox 360 and Xbox One controllers (#572)

general: various other fixes and improvements


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 pkgsrc/comms/libhidapi/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/comms/libhidapi/PLIST
cvs rdiff -u -r1.9 -r1.10 pkgsrc/comms/libhidapi/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/comms/libhidapi/patches/patch-netbsd_CMakeLists.txt \
    pkgsrc/comms/libhidapi/patches/patch-netbsd_hid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/comms/libhidapi/Makefile
diff -u pkgsrc/comms/libhidapi/Makefile:1.12 pkgsrc/comms/libhidapi/Makefile:1.13
--- pkgsrc/comms/libhidapi/Makefile:1.12        Wed Aug 20 11:34:48 2025
+++ pkgsrc/comms/libhidapi/Makefile     Fri Mar 13 10:37:25 2026
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.12 2025/08/20 11:34:48 wiz Exp $
+# $NetBSD: Makefile,v 1.13 2026/03/13 10:37:25 tsutsui Exp $
 
 GITHUB_PROJECT=        hidapi
-GITHUB_TAG=    ${GITHUB_PROJECT}-0.14.0
+GITHUB_TAG=    ${GITHUB_PROJECT}-0.15.0
 DISTNAME=      ${GITHUB_TAG}
 PKGNAME=       lib${DISTNAME}
 CATEGORIES=    comms devel
@@ -24,7 +24,7 @@ PKGCONFIG_OVERRIDE+=  pc/hidapi-hidraw.pc
 PKGCONFIG_OVERRIDE+=   pc/hidapi-libusb.pc.in
 PKGCONFIG_OVERRIDE+=   pc/hidapi.pc.in
 
-PLIST_VARS+=   libusb hidraw
+PLIST_VARS+=   libusb hidraw netbsd
 
 PLIST_SUBST+=  PKGVERSION=${PKGVERSION_NOREV}
 
@@ -34,6 +34,8 @@ PLIST_SUBST+= PKGVERSION=${PKGVERSION_NO
 PLIST.libusb=  yes
 .  if ${OPSYS} == "Linux"
 PLIST.hidraw=  yes
+.  elif ${OPSYS} == "NetBSD"
+PLIST.netbsd=  yes
 .  endif
 .endif
 

Index: pkgsrc/comms/libhidapi/PLIST
diff -u pkgsrc/comms/libhidapi/PLIST:1.8 pkgsrc/comms/libhidapi/PLIST:1.9
--- pkgsrc/comms/libhidapi/PLIST:1.8    Tue May 23 17:54:04 2023
+++ pkgsrc/comms/libhidapi/PLIST        Fri Mar 13 10:37:25 2026
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.8 2023/05/23 17:54:04 nikita Exp $
+@comment $NetBSD: PLIST,v 1.9 2026/03/13 10:37:25 tsutsui Exp $
 include/hidapi/hidapi.h
 ${PLIST.libusb}include/hidapi/hidapi_libusb.h
 lib/cmake/hidapi/hidapi-config-version.cmake
@@ -11,5 +11,9 @@ ${PLIST.hidraw}lib/libhidapi-hidraw.so.$
 lib/libhidapi-libusb.so
 lib/libhidapi-libusb.so.0
 lib/libhidapi-libusb.so.${PKGVERSION}
+${PLIST.netbsd}lib/libhidapi-netbsd.so
+${PLIST.netbsd}lib/libhidapi-netbsd.so.0
+${PLIST.netbsd}lib/libhidapi-netbsd.so.${PKGVERSION}
 ${PLIST.hidraw}lib/pkgconfig/hidapi-hidraw.pc
 ${PLIST.libusb}lib/pkgconfig/hidapi-libusb.pc
+${PLIST.netbsd}lib/pkgconfig/hidapi-netbsd.pc

Index: pkgsrc/comms/libhidapi/distinfo
diff -u pkgsrc/comms/libhidapi/distinfo:1.9 pkgsrc/comms/libhidapi/distinfo:1.10
--- pkgsrc/comms/libhidapi/distinfo:1.9 Tue May 23 17:54:04 2023
+++ pkgsrc/comms/libhidapi/distinfo     Fri Mar 13 10:37:25 2026
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.9 2023/05/23 17:54:04 nikita Exp $
+$NetBSD: distinfo,v 1.10 2026/03/13 10:37:25 tsutsui Exp $
 
-BLAKE2s (hidapi-0.14.0.tar.gz) = b2121c1d82fb4ddfddd66179a36c417f5a7bae08f8e040df8bb3c51aa57b3f12
-SHA512 (hidapi-0.14.0.tar.gz) = 66a045144f90b41438898b82f0398e80223323ebfe6e4f197d2713696bb3ae60f36aea5a37a9999b34b12294783fd7e4c28c6e785462559cbe21276009da1eac
-Size (hidapi-0.14.0.tar.gz) = 348221 bytes
+BLAKE2s (hidapi-0.15.0.tar.gz) = 194b619bd498bee0708388a97dd04f2af6e0065deb74d4aafa8572f6195e97d4
+SHA512 (hidapi-0.15.0.tar.gz) = a4ddd13a80a84956872fa52aa861b40e4959f301d8d91afe0feaf9dbd87394561e1fdd20cbf8cf47200845f80a8db8a934bc2e3025fe6f16435e37c17621e7b6
+Size (hidapi-0.15.0.tar.gz) = 363838 bytes
 SHA1 (patch-Makefile.am) = 8e39fc4650601af39c510107ca2b3c85029fb2df
 SHA1 (patch-configure.ac) = caf23d94ec0af608f63dfd3acba7b3624af78bdc
 SHA1 (patch-libusb_Makefile.am) = 2caf718bd7538bcc43b7eaea75dc5a7024f12581
+SHA1 (patch-netbsd_CMakeLists.txt) = 6a9ddb4e69be23cc34f59aee71520e17795b647a
+SHA1 (patch-netbsd_hid.c) = 1a882a1fc276fcc0175b1c0b84d27efdb7eeb748

Added files:

Index: pkgsrc/comms/libhidapi/patches/patch-netbsd_CMakeLists.txt
diff -u /dev/null pkgsrc/comms/libhidapi/patches/patch-netbsd_CMakeLists.txt:1.1
--- /dev/null   Fri Mar 13 10:37:25 2026
+++ pkgsrc/comms/libhidapi/patches/patch-netbsd_CMakeLists.txt  Fri Mar 13 10:37:25 2026
@@ -0,0 +1,22 @@
+$NetBSD: patch-netbsd_CMakeLists.txt,v 1.1 2026/03/13 10:37:25 tsutsui Exp $
+
+- check iconv(3) arg type as libusb
+
+--- netbsd/CMakeLists.txt.orig 2026-03-13 06:26:53.507574456 +0000
++++ netbsd/CMakeLists.txt
+@@ -10,6 +10,15 @@ find_package(Threads REQUIRED)
+ 
+ target_link_libraries(hidapi_netbsd PRIVATE Threads::Threads)
+ 
++# check for error: "conflicting types for 'iconv'"
++check_c_source_compiles("#include<iconv.h>
++    extern size_t iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
++    int main() {}"
++HIDAPI_ICONV_CONST)
++if(HIDAPI_ICONV_CONST)
++    target_compile_definitions(hidapi_netbsd PRIVATE "ICONV_CONST=const")
++endif()
++
+ set_target_properties(hidapi_netbsd
+     PROPERTIES
+         EXPORT_NAME "netbsd"
Index: pkgsrc/comms/libhidapi/patches/patch-netbsd_hid.c
diff -u /dev/null pkgsrc/comms/libhidapi/patches/patch-netbsd_hid.c:1.1
--- /dev/null   Fri Mar 13 10:37:25 2026
+++ pkgsrc/comms/libhidapi/patches/patch-netbsd_hid.c   Fri Mar 13 10:37:25 2026
@@ -0,0 +1,59 @@
+$NetBSD: patch-netbsd_hid.c,v 1.1 2026/03/13 10:37:25 tsutsui Exp $
+
+- don't assume roothub addr is always zero (see NetBSD PR/60073)
+- check iconv(3) arg type properly
+
+--- netbsd/hid.c.orig  2025-05-18 18:25:13.000000000 +0000
++++ netbsd/hid.c
+@@ -30,6 +30,10 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <iconv.h>
++#ifndef ICONV_CONST
++#define ICONV_CONST
++#endif
++
+ #include <poll.h>
+ 
+ /* NetBSD */
+@@ -724,6 +728,7 @@ struct hid_device_info HID_API_EXPORT * 
+       for (size_t i = 0; i < len; i++) {
+               char devpath[USB_MAX_DEVNAMELEN];
+               int bus;
++              struct hid_device_info *prev_end;
+ 
+               strlcpy(devpath, "/dev/", sizeof(devpath));
+               strlcat(devpath, arr[i], sizeof(devpath));
+@@ -732,7 +737,13 @@ struct hid_device_info HID_API_EXPORT * 
+               if (bus == -1)
+                       continue;
+ 
+-              enumerate_usb_devices(bus, 0, hid_enumerate_callback, &hed);
++              /* ehci/ohci/uhci/dwctwo etc. use 'addr 1' for root hubs */
++              prev_end = hed.end;
++              enumerate_usb_devices(bus, 1, hid_enumerate_callback, &hed);
++              /* xhci uses 'addr 0' so check it if no device at addr 1 */
++              if (hed.end == prev_end)
++                      enumerate_usb_devices(bus, 0,
++                          hid_enumerate_callback, &hed);
+ 
+               close(bus);
+       }
+@@ -1087,7 +1098,7 @@ int HID_API_EXPORT_CALL hid_get_indexed_
+       struct usb_string_desc usd;
+       usb_string_descriptor_t *str;
+       iconv_t ic;
+-      const char *src;
++      ICONV_CONST char *src;
+       size_t srcleft;
+       char *dst;
+       size_t dstleft;
+@@ -1131,7 +1142,7 @@ int HID_API_EXPORT_CALL hid_get_indexed_
+               return -1;
+       }
+ 
+-      src = (const char *) str->bString;
++      src = (ICONV_CONST char *)str->bString;
+       srcleft = str->bLength - 2;
+       dst = (char *) string;
+       dstleft = sizeof(wchar_t[maxlen]);



Home | Main Index | Thread Index | Old Index