diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2024-04-07 19:54:22 +0200 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2024-04-07 21:40:20 +0200 |
| commit | 3571e4752501fb0f7da7785a3834009f522eb24c (patch) | |
| tree | 02da6356d5707052bcfab8822d9911ed0449e27d /gnu/packages/libusb.scm | |
| parent | 81b2765140d8e7539a13ed2164ad22a6fee16f56 (diff) | |
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
Diffstat (limited to 'gnu/packages/libusb.scm')
| -rw-r--r-- | gnu/packages/libusb.scm | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 7c128425831..948d5dbccc9 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm | |||
| @@ -206,7 +206,7 @@ Go-like binding.") | |||
| 206 | (define-public java-usb4java | 206 | (define-public java-usb4java |
| 207 | (package | 207 | (package |
| 208 | (name "java-usb4java") | 208 | (name "java-usb4java") |
| 209 | (version "1.2.0") | 209 | (version "1.3.0") |
| 210 | (source (origin | 210 | (source (origin |
| 211 | (method git-fetch) | 211 | (method git-fetch) |
| 212 | (uri (git-reference | 212 | (uri (git-reference |
| @@ -215,43 +215,38 @@ Go-like binding.") | |||
| 215 | (file-name (git-file-name name version)) | 215 | (file-name (git-file-name name version)) |
| 216 | (sha256 | 216 | (sha256 |
| 217 | (base32 | 217 | (base32 |
| 218 | "0aip6k24czz5g58qwb963mpick0b6ks774drfpdd8gcdvj9iv87j")))) | 218 | "0fwf8d2swgm8pmvssy53ixnc0pb5bfvc8iy42mf3dwgvr1zzvgmv")))) |
| 219 | (build-system ant-build-system) | 219 | (build-system ant-build-system) |
| 220 | (arguments | 220 | (arguments |
| 221 | `(#:jar-name "usb4java.jar" | 221 | (list |
| 222 | #:phases | 222 | #:jar-name "usb4java.jar" |
| 223 | (modify-phases %standard-phases | 223 | #:phases |
| 224 | ;; Usually, native libusb4java libraries for all supported systems | 224 | #~(modify-phases %standard-phases |
| 225 | ;; would be included in the jar and extracted at runtime. Since we | 225 | ;; Usually, native libusb4java libraries for all supported systems |
| 226 | ;; build everything from source we cannot just bundle pre-built | 226 | ;; would be included in the jar and extracted at runtime. Since we |
| 227 | ;; binaries for other systems. Instead, we patch the loader to | 227 | ;; build everything from source we cannot just bundle pre-built |
| 228 | ;; directly return the appropriate library for this system. The | 228 | ;; binaries for other systems. Instead, we patch the loader to |
| 229 | ;; downside is that the jar will only work on the same architecture | 229 | ;; directly return the appropriate library for this system. The |
| 230 | ;; that it was built on. | 230 | ;; downside is that the jar will only work on the same architecture |
| 231 | (add-after 'unpack 'copy-libusb4java | 231 | ;; that it was built on. |
| 232 | (lambda* (#:key inputs #:allow-other-keys) | 232 | (add-after 'unpack 'copy-libusb4java |
| 233 | (substitute* "src/main/java/org/usb4java/Loader.java" | 233 | (lambda* (#:key inputs #:allow-other-keys) |
| 234 | (("private static String extractLibrary" line) | 234 | (substitute* "src/main/java/org/usb4java/Loader.java" |
| 235 | (string-append | 235 | (("private static String extractLibrary" line) |
| 236 | line "(final String a, final String b) {" | 236 | (string-append |
| 237 | "return \"" | 237 | line "(final String a, final String b) {" |
| 238 | (assoc-ref inputs "libusb4java") "/lib/libusb4java.so" | 238 | "return \"" |
| 239 | "\"; }\n" | 239 | (search-input-file inputs "/lib/libusb4java.so") |
| 240 | "private static String _extractLibrary"))) | 240 | "\"; }\n" |
| 241 | #t)) | 241 | "private static String _extractLibrary"))))) |
| 242 | (add-after 'unpack 'disable-broken-tests | 242 | (add-after 'unpack 'disable-broken-tests |
| 243 | (lambda _ | 243 | (lambda _ |
| 244 | (with-directory-excursion "src/test/java/org/usb4java" | 244 | (with-directory-excursion "src/test/java/org/usb4java" |
| 245 | ;; These tests should only be run when USB devices are present. | 245 | ;; These tests should only be run when USB devices are present. |
| 246 | (substitute* '("LibUsbGlobalTest.java" | 246 | (substitute* '("LibUsbGlobalTest.java" |
| 247 | "TransferTest.java") | 247 | "TransferTest.java") |
| 248 | (("this.context = new Context\\(\\);") | 248 | (("this.context = new Context\\(\\);") |
| 249 | "this.context = null;") | 249 | "this.context = null;")))))))) |
| 250 | (("LibUsb.init") "//")) | ||
| 251 | (substitute* "DeviceListIteratorTest.java" | ||
| 252 | (("this.iterator.remove" line) | ||
| 253 | (string-append "assumeUsbTestsEnabled();" line)))) | ||
| 254 | #t))))) | ||
| 255 | (inputs | 250 | (inputs |
| 256 | (list libusb4java java-commons-lang3 java-junit java-hamcrest-core)) | 251 | (list libusb4java java-commons-lang3 java-junit java-hamcrest-core)) |
| 257 | (home-page "http://usb4java.org/") | 252 | (home-page "http://usb4java.org/") |
