diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2021-03-24 15:28:33 +0200 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2021-03-24 20:50:44 +0200 |
commit | 2aab587f842908a886e3bd08b028885dddd650e0 (patch) | |
tree | 87c0723a9ae2c69ab6920d90b6e87ad8510492fe /gnu/packages/java.scm | |
parent | 5664bcdcb0e4c10dfe48dd5e4730fc3c746a21e2 (diff) | |
parent | 65c46e79e0495fe4d32f6f2725d7233fff10fd70 (diff) | |
download | guix-2aab587f842908a886e3bd08b028885dddd650e0.tar.gz guix-2aab587f842908a886e3bd08b028885dddd650e0.zip |
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'gnu/packages/java.scm')
-rw-r--r-- | gnu/packages/java.scm | 120 |
1 files changed, 119 insertions, 1 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 7ba8b46226..37716e01d5 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -2696,10 +2696,101 @@ distribution."))) `(#:jar-name "java-openjfx-graphics.jar" #:source-dir "modules/graphics/src/main/java" #:tests? #f; require X - #:test-dir "modules/graphics/src/test")) + #:test-dir "modules/graphics/src/test" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'copy-missing-file + (lambda* (#:key inputs #:allow-other-keys) + (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c")) + (copy-file (assoc-ref inputs "JNativeSurface.c") target) + ;; XXX: looks like the missing file we found isn't *quite* + ;; compatible... + (substitute* target + (("case TYPE_INT_ARGB:") ""))))) + (add-after 'build 'build-native + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((jdk (assoc-ref inputs "jdk")) + (class-file->class-name + (lambda (class-file) + (string-map (lambda (c) + (if (char=? c #\/) #\. c)) + (string-drop-right class-file + (string-length ".class")))))) + (setenv "CPPFLAGS" + (string-append "-DINLINE=inline " + "-DLINUX " + "-I" jdk "/include " + "-I" jdk "/include/linux " + "-I " (getcwd) "/build/classes/include " + "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw")) + + ;; Instructions have been adapted from buildSrc/linux.gradle + (with-directory-excursion "build/classes" + ;; Build prism + (mkdir-p "include") + + ;; Generate headers for prism + (apply invoke "javah" "-d" "include" "-cp" "." + (map class-file->class-name + (append (find-files "com/sun/prism/impl" "\\.class$") + (find-files "com/sun/prism" "PresentableState.*\\.class$")))) + + ;; ...then for prism_sw + (apply invoke "javah" "-d" "include" "-cp" "." + (map class-file->class-name + (find-files "com/sun/pisces" "\\.class$"))) + + ;; ...and for prism_es2 + (apply invoke "javah" "-d" "include" "-cp" "." + (map class-file->class-name + (find-files "com/sun/prism/es2" "\\.class$"))))) + + (with-directory-excursion "netbeans/native-prism" + (invoke "make" "CONF=Release")) + (with-directory-excursion "netbeans/native-prism-sw" + (invoke "make" "CONF=Release")) + ;; TODO: This fails due to unknown EGL procedure names + #; + (with-directory-excursion "netbeans/native-prism-es2" + (invoke "make" "CONF=Release")) + + (let* ((out (assoc-ref outputs "out")) + (dir ,(match (%current-system) + ("i686-linux" + "i386") + ((or "armhf-linux" "aarch64-linux") + "arm") + ((or "x86_64-linux") + "amd64") + (_ "unknown"))) + (target (string-append out "/share/" dir "/"))) + (mkdir-p target) + (for-each (lambda (file) + (let ((new-name + (string-append "lib" + (string-map + (lambda (c) + (if (char=? c #\-) #\_ c)) + (string-drop (basename file) + (string-length "libnative-")))))) + (copy-file file + (string-append target new-name)))) + (find-files "netbeans" "\\.so$")))))))) (propagated-inputs `(("java-openjfx-base" ,java-openjfx-base) ("java-swt" ,java-swt))) + ;; XXX: for unknown reasons + ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing + ;; in this revision. + (native-inputs + `(("JNativeSurface.c" + ,(origin + (method url-fetch) + (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\ +/modules/graphics/src/main/native-prism-sw/JNativeSurface.c") + (sha256 + (base32 + "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm")))))) (description "OpenJFX is a client application platform for desktop, mobile and embedded systems built on Java. Its goal is to produce a modern, efficient, and fully featured toolkit for developing rich client @@ -2721,6 +2812,33 @@ modern, efficient, and fully featured toolkit for developing rich client applications. This package contains media-related classes for the OpenJFX distribution."))) +(define-public java-openjfx-controls + (package (inherit java-openjfx-build) + (name "java-openjfx-controls") + (propagated-inputs + `(("java-openjxf-graphics" ,java-openjfx-graphics))) + (arguments + `(#:jar-name "java-openjfx-controls.jar" + #:source-dir "modules/controls/src/main/java" + #:test-dir "modules/controls/src/test" + ;; TODO: tests require com.sun.javafx.pgstub, + ;; javafx.collections.MockSetObserver, and + ;; com.sun.javafx.binding.ExpressionHelperUtility + #:tests? #false + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'copy-resources + (lambda _ + (copy-recursively "modules/controls/src/test/resources" + "build/test-classes") + (copy-recursively "modules/controls/src/main/resources" + "build/classes")))))) + (description "OpenJFX is a client application platform for desktop, +mobile and embedded systems built on Java. Its goal is to produce a +modern, efficient, and fully featured toolkit for developing rich client +applications. This package contains UI control classes for the +OpenJFX distribution."))) + (define-public javacc-4 (package (name "javacc") |