gnu: java-usb4java: Update to 1.3.0.

* gnu/packages/libusb.scm (java-usb4java): Update to 1.3.0.
[arguments]: Use plain list; use SEARCH-INPUT-FILE; adjust
'disable-broken-tests; remove trailing #T from build phases.

Change-Id: Ia5cd72b7c6c0426bcd95804802d14f3e5c728e1c
This commit is contained in:
Ricardo Wurmus 2024-04-07 19:54:22 +02:00
parent 81b2765140
commit 3571e47525
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -206,7 +206,7 @@ (define-public go-github-com-google-gousb
(define-public java-usb4java (define-public java-usb4java
(package (package
(name "java-usb4java") (name "java-usb4java")
(version "1.2.0") (version "1.3.0")
(source (origin (source (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
@ -215,43 +215,38 @@ (define-public java-usb4java
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"0aip6k24czz5g58qwb963mpick0b6ks774drfpdd8gcdvj9iv87j")))) "0fwf8d2swgm8pmvssy53ixnc0pb5bfvc8iy42mf3dwgvr1zzvgmv"))))
(build-system ant-build-system) (build-system ant-build-system)
(arguments (arguments
`(#:jar-name "usb4java.jar" (list
#:phases #:jar-name "usb4java.jar"
(modify-phases %standard-phases #:phases
;; Usually, native libusb4java libraries for all supported systems #~(modify-phases %standard-phases
;; would be included in the jar and extracted at runtime. Since we ;; Usually, native libusb4java libraries for all supported systems
;; build everything from source we cannot just bundle pre-built ;; would be included in the jar and extracted at runtime. Since we
;; binaries for other systems. Instead, we patch the loader to ;; build everything from source we cannot just bundle pre-built
;; directly return the appropriate library for this system. The ;; binaries for other systems. Instead, we patch the loader to
;; downside is that the jar will only work on the same architecture ;; directly return the appropriate library for this system. The
;; that it was built on. ;; downside is that the jar will only work on the same architecture
(add-after 'unpack 'copy-libusb4java ;; that it was built on.
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'copy-libusb4java
(substitute* "src/main/java/org/usb4java/Loader.java" (lambda* (#:key inputs #:allow-other-keys)
(("private static String extractLibrary" line) (substitute* "src/main/java/org/usb4java/Loader.java"
(string-append (("private static String extractLibrary" line)
line "(final String a, final String b) {" (string-append
"return \"" line "(final String a, final String b) {"
(assoc-ref inputs "libusb4java") "/lib/libusb4java.so" "return \""
"\"; }\n" (search-input-file inputs "/lib/libusb4java.so")
"private static String _extractLibrary"))) "\"; }\n"
#t)) "private static String _extractLibrary")))))
(add-after 'unpack 'disable-broken-tests (add-after 'unpack 'disable-broken-tests
(lambda _ (lambda _
(with-directory-excursion "src/test/java/org/usb4java" (with-directory-excursion "src/test/java/org/usb4java"
;; These tests should only be run when USB devices are present. ;; These tests should only be run when USB devices are present.
(substitute* '("LibUsbGlobalTest.java" (substitute* '("LibUsbGlobalTest.java"
"TransferTest.java") "TransferTest.java")
(("this.context = new Context\\(\\);") (("this.context = new Context\\(\\);")
"this.context = null;") "this.context = null;"))))))))
(("LibUsb.init") "//"))
(substitute* "DeviceListIteratorTest.java"
(("this.iterator.remove" line)
(string-append "assumeUsbTestsEnabled();" line))))
#t)))))
(inputs (inputs
(list libusb4java java-commons-lang3 java-junit java-hamcrest-core)) (list libusb4java java-commons-lang3 java-junit java-hamcrest-core))
(home-page "http://usb4java.org/") (home-page "http://usb4java.org/")