diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-01 00:34:29 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-05-03 02:30:23 +0200 |
| commit | e882d5315c4dceab0d0bb240918afd6719b37317 (patch) | |
| tree | c1969d1c4900f2edf96fbc84fcd2fe5485bce52f /gnu/packages/java.scm | |
| parent | c72142f4c46a3d9f6aa75fa29c8d4f06f40e407e (diff) | |
gnu: Add java-junixsocket-native-common@2.5.1.
* gnu/packages/java.scm (java-junixsocket-native-common-2.5.1): New variable.
Change-Id: I345adfba8b65a4b1574c787f368f19bed2ff90dc
Diffstat (limited to 'gnu/packages/java.scm')
| -rw-r--r-- | gnu/packages/java.scm | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 5f0ce62c33b..7740fd7cddf 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm | |||
| @@ -12484,6 +12484,82 @@ analysis.") | |||
| 12484 | compatible interface.") | 12484 | compatible interface.") |
| 12485 | (license license:asl2.0))) | 12485 | (license license:asl2.0))) |
| 12486 | 12486 | ||
| 12487 | (define-public java-junixsocket-native-common-2.5.1 | ||
| 12488 | (package | ||
| 12489 | (name "java-junixsocket-native-common") | ||
| 12490 | (version "2.5.1") | ||
| 12491 | (source junixsocket-source) | ||
| 12492 | (build-system ant-build-system) | ||
| 12493 | (arguments | ||
| 12494 | (list | ||
| 12495 | #:tests? #f | ||
| 12496 | #:jdk openjdk9 | ||
| 12497 | #:jar-name "junixsocket-native-common.jar" | ||
| 12498 | #:source-dir "junixsocket-native-common/src/main/java" | ||
| 12499 | #:phases | ||
| 12500 | #~(modify-phases %standard-phases | ||
| 12501 | (add-before 'build 'set-module-path | ||
| 12502 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 12503 | ;; javac needs compiler-annotations on the module path | ||
| 12504 | ;; (not classpath) for JPMS 'requires static' resolution. | ||
| 12505 | (let ((mod-dir (assoc-ref inputs | ||
| 12506 | "java-kohlschutter-compiler-annotations"))) | ||
| 12507 | (setenv "JDK_JAVAC_OPTIONS" | ||
| 12508 | (string-append "--module-path=" | ||
| 12509 | (car (find-files mod-dir "\\.jar$"))))))) | ||
| 12510 | (add-before 'build 'build-native | ||
| 12511 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 12512 | (let ((jdk (assoc-ref inputs "jdk")) | ||
| 12513 | (c-dir "junixsocket-native/src/main/c")) | ||
| 12514 | ;; Fix GCC incompatibility: _Pragma inside expressions | ||
| 12515 | ;; is a Clang extension, not supported by GCC. | ||
| 12516 | (substitute* (string-append c-dir "/ckmacros.h") | ||
| 12517 | (("# define CK_IGNORE_CAST_BEGIN \\\\") | ||
| 12518 | "# define CK_IGNORE_CAST_BEGIN") | ||
| 12519 | (("# define CK_IGNORE_CAST_END \\\\") | ||
| 12520 | "# define CK_IGNORE_CAST_END") | ||
| 12521 | (("_Pragma\\(\"GCC diagnostic.*cast.*\"\\)") "") | ||
| 12522 | (("_Pragma\\(\"GCC diagnostic push\"\\)") "") | ||
| 12523 | (("_Pragma\\(\"GCC diagnostic pop\"\\)") "")) | ||
| 12524 | (let ((so-file (string-append | ||
| 12525 | "junixsocket-native-common/src/main/" | ||
| 12526 | "resources/lib/amd64-Linux-clang/jni/" | ||
| 12527 | "libjunixsocket-native-" #$version ".so"))) | ||
| 12528 | (mkdir-p (dirname so-file)) | ||
| 12529 | (apply invoke "gcc" "-shared" "-fPIC" "-O2" | ||
| 12530 | "-Wno-int-to-pointer-cast" | ||
| 12531 | "-Wno-pointer-to-int-cast" | ||
| 12532 | "-Wno-bad-function-cast" | ||
| 12533 | "-Wno-cast-function-type" | ||
| 12534 | "-Wno-stringop-overflow" | ||
| 12535 | (string-append "-I" c-dir) | ||
| 12536 | (string-append "-I" c-dir "/jni") | ||
| 12537 | (string-append "-I" jdk "/include") | ||
| 12538 | (string-append "-I" jdk "/include/linux") | ||
| 12539 | "-o" so-file | ||
| 12540 | (find-files c-dir "\\.c$")))))) | ||
| 12541 | (add-after 'build 'add-native-to-jar | ||
| 12542 | (lambda _ | ||
| 12543 | (invoke "jar" "uf" | ||
| 12544 | "build/jar/junixsocket-native-common.jar" | ||
| 12545 | "-C" "junixsocket-native-common/src/main/resources" | ||
| 12546 | "lib"))) | ||
| 12547 | ;; The source pom.xml lists pre-built native library | ||
| 12548 | ;; NARs for every platform. We build the native code | ||
| 12549 | ;; from source, so none of those dependencies apply. | ||
| 12550 | (add-before 'install 'create-pom | ||
| 12551 | (generate-pom.xml "pom.xml" | ||
| 12552 | "com.kohlschutter.junixsocket" | ||
| 12553 | "junixsocket-native-common" #$version)) | ||
| 12554 | (replace 'install | ||
| 12555 | (install-from-pom "pom.xml"))))) | ||
| 12556 | (native-inputs (list java-kohlschutter-compiler-annotations-1)) | ||
| 12557 | (home-page "https://github.com/kohlschutter/junixsocket") | ||
| 12558 | (synopsis "Native JNI library for junixsocket") | ||
| 12559 | (description "This package provides the native JNI library for | ||
| 12560 | junixsocket, built from source for Linux.") | ||
| 12561 | (license license:asl2.0))) | ||
| 12562 | |||
| 12487 | (define-public java-lmax-disruptor | 12563 | (define-public java-lmax-disruptor |
| 12488 | (package | 12564 | (package |
| 12489 | (name "java-lmax-disruptor") | 12565 | (name "java-lmax-disruptor") |
