diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-01 00:37:03 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-05-03 02:30:23 +0200 |
| commit | df6182e5c74705b32a40001f2ed7f6a66aecfa90 (patch) | |
| tree | 753b7ed6191a3b335cf0575ea4b15f297ee165eb /gnu/packages/java.scm | |
| parent | 297f6ae22c322866bfbdb2a30418ab00f938ff7d (diff) | |
gnu: Add java-native-access@5.14.0.
* gnu/packages/java.scm (java-native-access-5.14.0): New variable.
Change-Id: Iffc145c918ff8067023441add521869bd3b3933f
Diffstat (limited to 'gnu/packages/java.scm')
| -rw-r--r-- | gnu/packages/java.scm | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 009b8ca6b16..53ae947bdd0 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm | |||
| @@ -14720,6 +14720,71 @@ Java method invocation.") | |||
| 14720 | license:asl2.0 | 14720 | license:asl2.0 |
| 14721 | license:lgpl2.1+)))) | 14721 | license:lgpl2.1+)))) |
| 14722 | 14722 | ||
| 14723 | (define-public java-native-access-5.14.0 | ||
| 14724 | (package | ||
| 14725 | (inherit java-native-access) | ||
| 14726 | (name "java-native-access") | ||
| 14727 | (version "5.14.0") | ||
| 14728 | (source | ||
| 14729 | (origin | ||
| 14730 | (method git-fetch) | ||
| 14731 | (uri (git-reference | ||
| 14732 | (url "https://github.com/java-native-access/jna.git") | ||
| 14733 | (commit version))) | ||
| 14734 | (file-name (git-file-name name version)) | ||
| 14735 | (sha256 | ||
| 14736 | (base32 "0blf6ka69c3zywa74fjh8gykhzn3vgbvlxzy3v9znncb2a97v6bb")) | ||
| 14737 | (modules '((guix build utils))) | ||
| 14738 | (snippet | ||
| 14739 | `(begin | ||
| 14740 | (for-each delete-file (find-files "." ".*.jar")) | ||
| 14741 | (delete-file-recursively "native/libffi") | ||
| 14742 | (delete-file-recursively "dist"))))) | ||
| 14743 | (arguments | ||
| 14744 | `(#:tests? #f | ||
| 14745 | #:test-target "test" | ||
| 14746 | #:make-flags (list "-Ddynlink.native=true") | ||
| 14747 | #:phases | ||
| 14748 | (modify-phases %standard-phases | ||
| 14749 | (add-before 'build 'fix-build.xml | ||
| 14750 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 14751 | (let ((ant-jar (search-input-file inputs "/lib/ant.jar")) | ||
| 14752 | (asm-jar (search-input-file inputs "/share/java/asm9.jar"))) | ||
| 14753 | (substitute* "build.xml" | ||
| 14754 | (("lib/ant\\.jar") ant-jar) | ||
| 14755 | (("\\$lib/asm-8\\.0\\.1\\.jar") asm-jar) | ||
| 14756 | (("lib/asm-8\\.0\\.1\\.jar") asm-jar) | ||
| 14757 | (("<zipfileset") "<zipfileset erroronmissingarchive=\"false\"")) | ||
| 14758 | (substitute* "build-ant-tools.xml" | ||
| 14759 | (("lib/ant\\.jar") ant-jar) | ||
| 14760 | (("lib/asm-8\\.0\\.1\\.jar") asm-jar))) | ||
| 14761 | (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$")) | ||
| 14762 | "lib/junit.jar") | ||
| 14763 | (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core") | ||
| 14764 | "jar$")) | ||
| 14765 | "lib/hamcrest-core.jar"))) | ||
| 14766 | (add-before 'build 'build-native | ||
| 14767 | (lambda _ | ||
| 14768 | (invoke "ant" "-Ddynlink.native=true" "native"))) | ||
| 14769 | (add-before 'install 'create-pom | ||
| 14770 | (generate-pom.xml "pom.xml" "net.java.dev.jna" | ||
| 14771 | "jna-jpms" ,version)) | ||
| 14772 | (add-before 'install 'keep-only-jna-jpms | ||
| 14773 | (lambda _ | ||
| 14774 | ;; The build produces multiple jars. install-from-pom | ||
| 14775 | ;; expects exactly one. Remove all except jna-jpms.jar. | ||
| 14776 | (for-each delete-file | ||
| 14777 | (filter (lambda (f) | ||
| 14778 | (not (string-contains f "jna-jpms"))) | ||
| 14779 | (find-files "build" "\\.jar$"))) | ||
| 14780 | (for-each delete-file | ||
| 14781 | (find-files "lib" "\\.jar$")))) | ||
| 14782 | (replace 'install | ||
| 14783 | (install-from-pom "pom.xml"))))) | ||
| 14784 | (native-inputs | ||
| 14785 | (modify-inputs (package-native-inputs java-native-access) | ||
| 14786 | (prepend java-asm-9))))) | ||
| 14787 | |||
| 14723 | (define-public java-native-access-platform | 14788 | (define-public java-native-access-platform |
| 14724 | (package | 14789 | (package |
| 14725 | (inherit java-native-access) | 14790 | (inherit java-native-access) |
