public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/rust-hidapi] epel10: Unretire and update to version 2.6.6; Fixes RHBZ#2479562
Date: Mon, 15 Jun 2026 13:48:55 GMT	[thread overview]
Message-ID: <178153133586.1.4012594677208971277.rpms-rust-hidapi-b8e8616dd29f@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rust-hidapi
Branch : epel10
Commit : b8e8616dd29f85957aa6875364796ad73db57692
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-05-23T20:31:49+01:00
Stats  : +139/-55 in 9 file(s)
URL    : https://src.fedoraproject.org/rpms/rust-hidapi/c/b8e8616dd29f85957aa6875364796ad73db57692?branch=epel10

Log:
Unretire and update to version 2.6.6; Fixes RHBZ#2479562

---
diff --git a/.gitignore b/.gitignore
index 14876eb..a1f7eee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /hidapi-1.2.6.crate
 /hidapi-1.4.1.crate
+/hidapi-2.6.6.crate

diff --git a/0001-add-missing-linker-flags-for-linking-with-libusb-1.0.patch b/0001-add-missing-linker-flags-for-linking-with-libusb-1.0.patch
deleted file mode 100644
index 9b31bc2..0000000
--- a/0001-add-missing-linker-flags-for-linking-with-libusb-1.0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4e07786f0790d05222183fd52736b82fc40c67f7 Mon Sep 17 00:00:00 2001
-From: Fabio Valentini <decathorpe@gmail.com>
-Date: Thu, 11 Aug 2022 00:27:08 +0200
-Subject: [PATCH] add missing linker flags for linking with libusb-1.0
-
----
- build.rs | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/build.rs b/build.rs
-index 3298590..897303c 100644
---- a/build.rs
-+++ b/build.rs
-@@ -86,6 +86,7 @@ fn compile_linux() {
-             "LINUX_SHARED_LIBUSB",
-             Box::new(|| {
-                 pkg_config::probe_library("hidapi-libusb").expect("Unable to find hidapi-libusb");
-+                println!("cargo:rustc-link-lib=usb-1.0");
-             }),
-         ),
-     ];
--- 
-2.37.1
-

diff --git a/183.patch b/183.patch
new file mode 100644
index 0000000..7b3913f
--- /dev/null
+++ b/183.patch
@@ -0,0 +1,13 @@
+From 0aa2049c2b06f660a56ba66ac0641339c5d6fd2e Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Mon, 18 May 2026 13:29:37 +0100
+Subject: [PATCH] Remove stray executable bit on a Rust source
+
+---
+ src/windows_native/mod.rs | 0
+ 1 file changed, 0 insertions(+), 0 deletions(-)
+ mode change 100755 => 100644 src/windows_native/mod.rs
+
+diff --git a/src/windows_native/mod.rs b/src/windows_native/mod.rs
+old mode 100755
+new mode 100644

diff --git a/hidapi-fix-metadata-auto.diff b/hidapi-fix-metadata-auto.diff
new file mode 100644
index 0000000..86f8b9e
--- /dev/null
+++ b/hidapi-fix-metadata-auto.diff
@@ -0,0 +1,24 @@
+--- hidapi-2.6.6/Cargo.toml	2006-07-24T01:21:28+00:00
++++ hidapi-2.6.6/Cargo.toml	2026-05-18T12:32:36.774226+00:00
+@@ -90,14 +90,6 @@
+ linux-static-libusb = []
+ macos-shared-device = []
+ windows-native = [
+-    "windows-sys/Win32_Devices_DeviceAndDriverInstallation",
+-    "windows-sys/Win32_Devices_HumanInterfaceDevice",
+-    "windows-sys/Win32_Devices_Properties",
+-    "windows-sys/Win32_Security",
+-    "windows-sys/Win32_Storage_FileSystem",
+-    "windows-sys/Win32_System_IO",
+-    "windows-sys/Win32_System_Threading",
+-    "windows-sys/Win32_UI_Shell_PropertiesSystem",
+ ]
+ 
+ [lib]
+@@ -133,6 +125,3 @@
+ version = "0.9"
+ optional = true
+ 
+-[target."cfg(windows)".dependencies.windows-sys]
+-version = "0.61"
+-features = ["Win32_Foundation"]

diff --git a/hidapi-fix-metadata.diff b/hidapi-fix-metadata.diff
index 8253654..0cb6c08 100644
--- a/hidapi-fix-metadata.diff
+++ b/hidapi-fix-metadata.diff
@@ -1,17 +1,41 @@
---- hidapi-1.4.1/Cargo.toml	1970-01-01T00:00:01+00:00
-+++ hidapi-1.4.1/Cargo.toml	2022-08-10T20:59:24.213467+00:00
-@@ -43,13 +43,6 @@
- version = "0.3"
+--- hidapi-2.6.6/Cargo.toml	2006-07-24T01:21:28+00:00
++++ hidapi-2.6.6/Cargo.toml	2026-05-18T12:32:36.775412+00:00
+@@ -71,26 +71,14 @@
  
  [features]
--default = [
--    "linux-static-libusb",
+ default = [
+-    "linux-static-hidraw",
 -    "illumos-static-libusb",
--]
++    "linux-shared-hidraw",
+ ]
 -illumos-shared-libusb = []
 -illumos-static-libusb = []
-+default = ["linux-shared-libusb"]
+ linux-native = [
+     "dep:udev",
+     "dep:nix",
+ ]
+-linux-native-basic-udev = [
+-    "dep:basic-udev",
+-    "dep:nix",
+-]
  linux-shared-hidraw = []
  linux-shared-libusb = []
 -linux-static-hidraw = []
 -linux-static-libusb = []
+-macos-shared-device = []
+-windows-native = [
+-]
+ 
+ [lib]
+ name = "hidapi"
+@@ -108,10 +96,6 @@
+ [build-dependencies.pkg-config]
+ version = "0.3"
+ 
+-[target.'cfg(target_os = "linux")'.dependencies.basic-udev]
+-version = "0.1"
+-optional = true
+-
+ [target.'cfg(target_os = "linux")'.dependencies.nix]
+ version = "0.30"
+ features = [

diff --git a/rust-hidapi.spec b/rust-hidapi.spec
index 41d61b1..c41a3e2 100644
--- a/rust-hidapi.spec
+++ b/rust-hidapi.spec
@@ -1,26 +1,31 @@
-# Generated by rust2rpm 22
-%bcond_without check
+# Generated by rust2rpm 28
+%bcond check 1
 %global debug_package %{nil}
 
 %global crate hidapi
 
 Name:           rust-hidapi
-Version:        1.4.1
+Version:        2.6.6
 Release:        %autorelease
 Summary:        Rust-y wrapper around hidapi
 
 License:        MIT
 URL:            https://crates.io/crates/hidapi
 Source:         %{crates_source}
+# Automatically generated patch to strip dependencies and normalize metadata
+Patch:          hidapi-fix-metadata-auto.diff
 # Manually created patch for downstream crate metadata changes
-# * remove features for Illumos OS support
+# * remove features for Illumos and other non-Linux OS support
 # * remove features for statically linking with hidapi
+# * remove feature for basic-udev crate, currently not packaged
 Patch:          hidapi-fix-metadata.diff
-Patch:          0001-add-missing-linker-flags-for-linking-with-libusb-1.0.patch
+# * Remove stray executable bit on a Rust source
+Patch10:        https://github.com/ruabmbua/hidapi-rs/pull/183.patch
 
-ExclusiveArch:  %{rust_arches}
-
-BuildRequires:  rust-packaging >= 21
+BuildRequires:  cargo-rpm-macros >= 24
+BuildRequires:  pkgconfig(hidapi-hidraw)
+BuildRequires:  pkgconfig(libusb-1.0)
+BuildRequires:  pkgconfig(hidapi-libusb)
 
 %global _description %{expand:
 Rust-y wrapper around hidapi.}
@@ -53,6 +58,18 @@ use the "default" feature of the "%{crate}" crate.
 %files       -n %{name}+default-devel
 %ghost %{crate_instdir}/Cargo.toml
 
+%package     -n %{name}+linux-native-devel
+Summary:        %{summary}
+BuildArch:      noarch
+
+%description -n %{name}+linux-native-devel %{_description}
+
+This package contains library source intended for building other packages which
+use the "linux-native" feature of the "%{crate}" crate.
+
+%files       -n %{name}+linux-native-devel
+%ghost %{crate_instdir}/Cargo.toml
+
 %package     -n %{name}+linux-shared-hidraw-devel
 Summary:        %{summary}
 BuildArch:      noarch
@@ -69,6 +86,7 @@ use the "linux-shared-hidraw" feature of the "%{crate}" crate.
 %package     -n %{name}+linux-shared-libusb-devel
 Summary:        %{summary}
 BuildArch:      noarch
+Requires:       pkgconfig(libusb-1.0)
 Requires:       pkgconfig(hidapi-libusb)
 
 %description -n %{name}+linux-shared-libusb-devel %{_description}
@@ -80,16 +98,13 @@ use the "linux-shared-libusb" feature of the "%{crate}" crate.
 %ghost %{crate_instdir}/Cargo.toml
 
 %prep
-%autosetup -n %{crate}-%{version_no_tilde} -p1
-# remove bundled hidapi sources
-rm -rf etc/
+%autosetup -n %{crate}-%{version} -p1
+# Remove bundled sources intended for static linking
+rm --recursive --verbose etc/
 %cargo_prep
 
 %generate_buildrequires
 %cargo_generate_buildrequires
-echo 'pkgconfig(hidapi-hidraw)'
-echo 'pkgconfig(hidapi-libusb)'
-echo 'pkgconfig(libusb-1.0)'
 
 %build
 %cargo_build

diff --git a/rust2rpm.conf b/rust2rpm.conf
deleted file mode 100644
index 4bd92b9..0000000
--- a/rust2rpm.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-buildrequires =
-  pkgconfig(hidapi-libusb)
-  pkgconfig(hidapi-hidraw)
-lib+linux-shared-hidraw.requires =
-  pkgconfig(hidapi-hidraw)
-lib+linux-shared-libusb.requires =
-  pkgconfig(hidapi-libusb)

diff --git a/rust2rpm.toml b/rust2rpm.toml
new file mode 100644
index 0000000..0493c49
--- /dev/null
+++ b/rust2rpm.toml
@@ -0,0 +1,39 @@
+[package]
+cargo-toml-patch-comments = [
+    "remove features for Illumos and other non-Linux OS support",
+    "remove features for statically linking with hidapi",
+    "remove feature for basic-udev crate, currently not packaged",
+]
+license-files.exclude = [
+    # From bundled libraries for static linkin, removed in %prep
+    "etc/hidapi/LICENSE*.txt",
+]
+
+
+[[package.extra-patches]]
+number = 10
+file = "https://github.com/ruabmbua/hidapi-rs/pull/183.patch"
+comments = [
+    "Remove stray executable bit on a Rust source",
+]
+
+[requires]
+build = [
+    "pkgconfig(hidapi-hidraw)",
+    "pkgconfig(libusb-1.0)",
+    "pkgconfig(hidapi-libusb)",
+]
+[requires.features]
+linux-shared-hidraw = [
+    "pkgconfig(hidapi-hidraw)",
+]
+linux-shared-libusb = [
+    "pkgconfig(libusb-1.0)",
+    "pkgconfig(hidapi-libusb)",
+]
+
+[scripts.prep]
+pre = [
+    "# Remove bundled sources intended for static linking",
+    "rm --recursive --verbose etc/",
+]

diff --git a/sources b/sources
index f15f8bd..636550d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (hidapi-1.4.1.crate) = b9ed7f9d812c0874374b93ea05d58db6845e55c46b0ce5d7d8c5357f85f9b4f2dcf3e9760c7f9c2a6f8a99235492252fcd19a4d298f3becaddfae022f000af4b
+SHA512 (hidapi-2.6.6.crate) = 71564f5944420e6b6f12a6995dba2ee2f22c287dd7825d517fe857a0a28ea7532c2174575a843b5aa85fbee1e172b086836d353f7e60da418f7c28739470148e

                 reply	other threads:[~2026-06-15 13:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178153133586.1.4012594677208971277.rpms-rust-hidapi-b8e8616dd29f@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /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