public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-hidapi] epel10: Update to version 1.4.1; Fixes RHBZ#2036768
@ 2026-06-15 13:48 Fabio Valentini
  0 siblings, 0 replies; only message in thread
From: Fabio Valentini @ 2026-06-15 13:48 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rust-hidapi
Branch : epel10
Commit : ef52ed7ad8b9b316bbcc1cc1506bafd073bc4146
Author : Fabio Valentini <decathorpe@gmail.com>
Date   : 2022-08-11T00:32:01+02:00
Stats  : +79/-38 in 7 file(s)
URL    : https://src.fedoraproject.org/rpms/rust-hidapi/c/ef52ed7ad8b9b316bbcc1cc1506bafd073bc4146?branch=epel10

Log:
Update to version 1.4.1; Fixes RHBZ#2036768

---
diff --git a/.gitignore b/.gitignore
index 5491fe9..14876eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /hidapi-1.2.6.crate
+/hidapi-1.4.1.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
new file mode 100644
index 0000000..9b31bc2
--- /dev/null
+++ b/0001-add-missing-linker-flags-for-linking-with-libusb-1.0.patch
@@ -0,0 +1,24 @@
+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/disable-static-feature.patch b/disable-static-feature.patch
deleted file mode 100644
index ff622c9..0000000
--- a/disable-static-feature.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -urN hidapi-1.2.6.orig/Cargo.toml hidapi-1.2.6/Cargo.toml
---- hidapi-1.2.6.orig/Cargo.toml	1969-12-31 19:00:00.000000000 -0500
-+++ hidapi-1.2.6/Cargo.toml	2021-11-14 22:03:37.727932755 -0500
-@@ -30,8 +30,6 @@
- version = "0.3"
- 
- [features]
--default = ["linux-static-libusb"]
-+default = ["linux-shared-libusb"]
- linux-shared-hidraw = []
- linux-shared-libusb = []
--linux-static-hidraw = []
--linux-static-libusb = []

diff --git a/hidapi-fix-metadata.diff b/hidapi-fix-metadata.diff
new file mode 100644
index 0000000..8253654
--- /dev/null
+++ b/hidapi-fix-metadata.diff
@@ -0,0 +1,17 @@
+--- 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"
+ 
+ [features]
+-default = [
+-    "linux-static-libusb",
+-    "illumos-static-libusb",
+-]
+-illumos-shared-libusb = []
+-illumos-static-libusb = []
++default = ["linux-shared-libusb"]
+ linux-shared-hidraw = []
+ linux-shared-libusb = []
+-linux-static-hidraw = []
+-linux-static-libusb = []

diff --git a/rust-hidapi.spec b/rust-hidapi.spec
index 8d0ea94..41d61b1 100644
--- a/rust-hidapi.spec
+++ b/rust-hidapi.spec
@@ -1,27 +1,26 @@
-# Generated by rust2rpm 18
+# Generated by rust2rpm 22
 %bcond_without check
 %global debug_package %{nil}
 
 %global crate hidapi
 
-Name:           rust-%{crate}
-Version:        1.2.6
+Name:           rust-hidapi
+Version:        1.4.1
 Release:        %autorelease
 Summary:        Rust-y wrapper around hidapi
 
-# Upstream license specification: MIT
 License:        MIT
 URL:            https://crates.io/crates/hidapi
 Source:         %{crates_source}
-Patch0:         disable-static-feature.patch
+# Manually created patch for downstream crate metadata changes
+# * remove features for Illumos OS support
+# * remove features for statically linking with hidapi
+Patch:          hidapi-fix-metadata.diff
+Patch:          0001-add-missing-linker-flags-for-linking-with-libusb-1.0.patch
 
 ExclusiveArch:  %{rust_arches}
-%if %{__cargo_skip_build}
-BuildArch:      noarch
-%endif
 
-BuildRequires:  rust-packaging
-BuildRequires:  pkgconfig(hidapi-hidraw)
+BuildRequires:  rust-packaging >= 21
 
 %global _description %{expand:
 Rust-y wrapper around hidapi.}
@@ -34,13 +33,13 @@ BuildArch:      noarch
 
 %description    devel %{_description}
 
-This package contains library source intended for building other packages
-which use "%{crate}" crate.
+This package contains library source intended for building other packages which
+use the "%{crate}" crate.
 
 %files          devel
-%license LICENSE.txt etc/hidapi/LICENSE.txt etc/hidapi/LICENSE-orig.txt etc/hidapi/LICENSE-gpl3.txt etc/hidapi/LICENSE-bsd.txt
-%doc examples README.md etc/hidapi/README.md etc/hidapi/HACKING.txt etc/hidapi/AUTHORS.txt
-%{cargo_registry}/%{crate}-%{version_no_tilde}/
+%license %{crate_instdir}/LICENSE.txt
+%doc %{crate_instdir}/README.md
+%{crate_instdir}/
 
 %package     -n %{name}+default-devel
 Summary:        %{summary}
@@ -48,11 +47,11 @@ BuildArch:      noarch
 
 %description -n %{name}+default-devel %{_description}
 
-This package contains library source intended for building other packages
-which use "default" feature of "%{crate}" crate.
+This package contains library source intended for building other packages which
+use the "default" feature of the "%{crate}" crate.
 
 %files       -n %{name}+default-devel
-%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
+%ghost %{crate_instdir}/Cargo.toml
 
 %package     -n %{name}+linux-shared-hidraw-devel
 Summary:        %{summary}
@@ -61,11 +60,11 @@ Requires:       pkgconfig(hidapi-hidraw)
 
 %description -n %{name}+linux-shared-hidraw-devel %{_description}
 
-This package contains library source intended for building other packages
-which use "linux-shared-hidraw" feature of "%{crate}" crate.
+This package contains library source intended for building other packages which
+use the "linux-shared-hidraw" feature of the "%{crate}" crate.
 
 %files       -n %{name}+linux-shared-hidraw-devel
-%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
+%ghost %{crate_instdir}/Cargo.toml
 
 %package     -n %{name}+linux-shared-libusb-devel
 Summary:        %{summary}
@@ -74,18 +73,23 @@ Requires:       pkgconfig(hidapi-libusb)
 
 %description -n %{name}+linux-shared-libusb-devel %{_description}
 
-This package contains library source intended for building other packages
-which use "linux-shared-libusb" feature of "%{crate}" crate.
+This package contains library source intended for building other packages which
+use the "linux-shared-libusb" feature of the "%{crate}" crate.
 
 %files       -n %{name}+linux-shared-libusb-devel
-%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
+%ghost %{crate_instdir}/Cargo.toml
 
 %prep
 %autosetup -n %{crate}-%{version_no_tilde} -p1
+# remove bundled hidapi sources
+rm -rf 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
new file mode 100644
index 0000000..4bd92b9
--- /dev/null
+++ b/rust2rpm.conf
@@ -0,0 +1,8 @@
+[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/sources b/sources
index 7edd7b2..f15f8bd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (hidapi-1.2.6.crate) = 42a1b687431e72124f0c32972b038435d3ff6ca811fa5bc8c7f9f5fae9584beeb719b29aa393440a36beb1b6c8a473873715c5cb3099fd9fab53274327470e4c
+SHA512 (hidapi-1.4.1.crate) = b9ed7f9d812c0874374b93ea05d58db6845e55c46b0ce5d7d8c5357f85f9b4f2dcf3e9760c7f9c2a6f8a99235492252fcd19a4d298f3becaddfae022f000af4b

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-15 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-15 13:48 [rpms/rust-hidapi] epel10: Update to version 1.4.1; Fixes RHBZ#2036768 Fabio Valentini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox