From: Tomas Mudrunka <tomas.mudrunka@gmail.com>
To: buildroot@buildroot.org
Cc: Adrian Perez de Castro <aperez@igalia.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Tomas Mudrunka <tomas.mudrunka@gmail.com>
Subject: [Buildroot] [PATCH v2 3/5] package/hidapi: convert to cmake-package
Date: Fri, 13 Nov 2026 15:51:59 +0100 [thread overview]
Message-ID: <20261113145201.2357363-4-tomas.mudrunka@gmail.com> (raw)
In-Reply-To: <20261113145201.2357363-1-tomas.mudrunka@gmail.com>
Upstream considers the autotools build system deprecated and going to
be obsolete, and recommends using CMake instead (see BUILD.autotools.md
and BUILD.md). The CMake build system also allows to select which
backends are built (see the HIDAPI_WITH_* options), and avoids the
need to autoreconf the package.
Both backends (hidraw and libusb) are still built, so the installed
shared libraries (with the same libhidapi-*.so.0 SONAME), headers and
pkg-config files are unchanged; the .pc files are generated from the
same pc/*.pc.in templates.
The LIBS="-liconv" workaround is no longer needed: the libusb backend
uses find_package(Iconv) and links against libiconv when the C library
does not provide iconv.
As usual with cmake-package, only shared libraries are built when
BR2_SHARED_STATIC_LIBS=y, while the autotools build also installed the
static ones. No in-tree package links statically against hidapi in
that configuration.
The hidtest program and unit tests default to ON only for Debug
builds; disable them explicitly so they are never built.
Signed-off-by: Tomas Mudrunka <tomas.mudrunka@gmail.com>
---
package/hidapi/hidapi.mk | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/package/hidapi/hidapi.mk b/package/hidapi/hidapi.mk
index 7e202f0eb5..5f0c482a95 100644
--- a/package/hidapi/hidapi.mk
+++ b/package/hidapi/hidapi.mk
@@ -7,16 +7,19 @@
HIDAPI_VERSION = 0.15.0
HIDAPI_SITE = $(call github,libusb,hidapi,hidapi-$(HIDAPI_VERSION))
HIDAPI_INSTALL_STAGING = YES
-# No configure provided, so we need to autoreconf.
-HIDAPI_AUTORECONF = YES
HIDAPI_LICENSE = GPL-3.0 or BSD-3-Clause or HIDAPI license
HIDAPI_LICENSE_FILES = LICENSE.txt LICENSE-gpl3.txt LICENSE-bsd.txt LICENSE-orig.txt
HIDAPI_DEPENDENCIES = libusb udev
+HIDAPI_CONF_OPTS = \
+ -DHIDAPI_WITH_HIDRAW=ON \
+ -DHIDAPI_WITH_LIBUSB=ON \
+ -DHIDAPI_WITH_TESTS=OFF \
+ -DHIDAPI_BUILD_HIDTEST=OFF
+
ifeq ($(BR2_PACKAGE_LIBICONV),y)
HIDAPI_DEPENDENCIES += libiconv
-HIDAPI_CONF_ENV += LIBS="-liconv"
endif
-$(eval $(autotools-package))
+$(eval $(cmake-package))
--
2.56.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-11-13 14:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 13:00 [Buildroot] [PATCH 1/1] package/hidapi: add support for build without hidraw support when udev is not available Tomas Mudrunka
2026-11-13 14:51 ` [Buildroot] [PATCH v2 0/5] package/hidapi: allow building without udev Tomas Mudrunka
2026-11-13 14:51 ` [Buildroot] [PATCH v2 1/5] package/libmanette: select libgudev Tomas Mudrunka
2026-11-13 14:51 ` [Buildroot] [PATCH v2 2/5] package/hidapi: depend on udev instead of libgudev Tomas Mudrunka
2026-11-13 14:51 ` Tomas Mudrunka [this message]
2026-11-13 14:52 ` [Buildroot] [PATCH v2 4/5] package/hidapi: make the hidraw backend optional Tomas Mudrunka
2026-11-13 14:52 ` [Buildroot] [PATCH v2 5/5] DEVELOPERS: add Tomas Mudrunka for hidapi Tomas Mudrunka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261113145201.2357363-4-tomas.mudrunka@gmail.com \
--to=tomas.mudrunka@gmail.com \
--cc=aperez@igalia.com \
--cc=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox