diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-06-22 15:01:47 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-06-22 16:57:59 +0000 |
commit | 633cab0ecb07627706c6b523e219490f019eaab5 (patch) | |
tree | 4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/development/compilers/openjdk | |
parent | ffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff) | |
parent | 432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff) | |
download | nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2 nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip |
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts: # nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix # nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix # nixpkgs/pkgs/applications/window-managers/sway/default.nix # nixpkgs/pkgs/build-support/rust/default.nix # nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/openjdk')
19 files changed, 285 insertions, 45 deletions
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/11.nix b/nixpkgs/pkgs/development/compilers/openjdk/11.nix index f9dd7205659e..ef593422ff26 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/11.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/11.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, bash, pkg-config, autoconf, cpio, file, which, unzip -, zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2 +, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib, libpng, zlib, lcms2 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama , libXcursor, libXrandr, fontconfig, openjdk11-bootstrap , setJavaClassPath @@ -27,7 +27,7 @@ let nativeBuildInputs = [ pkg-config autoconf unzip ]; buildInputs = [ - cpio file which zip perl zlib cups freetype alsaLib libjpeg giflib + cpio file which zip perl zlib cups freetype alsa-lib libjpeg giflib libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig openjdk11-bootstrap ] ++ lib.optionals (!headless && enableGnome2) [ @@ -142,6 +142,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo asbachb ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/12.nix b/nixpkgs/pkgs/development/compilers/openjdk/12.nix index 8c12b5be7f2e..66aeff306e38 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/12.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/12.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip -, zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2 +, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib, libpng, zlib, lcms2 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama , libXcursor, libXrandr, fontconfig, openjdk11, fetchpatch , setJavaClassPath @@ -24,7 +24,7 @@ let nativeBuildInputs = [ pkg-config autoconf unzip ]; buildInputs = [ - cpio file which zip perl zlib cups freetype alsaLib libjpeg giflib + cpio file which zip perl zlib cups freetype alsa-lib libjpeg giflib libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig openjdk11 ] ++ lib.optionals (!headless && enableGnome2) [ @@ -151,6 +151,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/13.nix b/nixpkgs/pkgs/development/compilers/openjdk/13.nix index 7e4d9fc7d693..96a567895d6a 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/13.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/13.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip -, zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2 +, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib, libpng, zlib, lcms2 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama , libXcursor, libXrandr, fontconfig, openjdk13-bootstrap, fetchpatch , setJavaClassPath @@ -24,7 +24,7 @@ let nativeBuildInputs = [ pkg-config autoconf unzip ]; buildInputs = [ - cpio file which zip perl zlib cups freetype alsaLib libjpeg giflib + cpio file which zip perl zlib cups freetype alsa-lib libjpeg giflib libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig openjdk13-bootstrap ] ++ lib.optionals (!headless && enableGnome2) [ @@ -151,6 +151,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/14.nix b/nixpkgs/pkgs/development/compilers/openjdk/14.nix index d98d0e9f8ee6..fae27b8ca754 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/14.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/14.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip -, zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2 +, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib, libpng, zlib, lcms2 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama , libXcursor, libXrandr, fontconfig, openjdk14-bootstrap , setJavaClassPath @@ -24,7 +24,7 @@ let nativeBuildInputs = [ pkg-config autoconf unzip ]; buildInputs = [ - cpio file which zip perl zlib cups freetype alsaLib libjpeg giflib + cpio file which zip perl zlib cups freetype alsa-lib libjpeg giflib libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig openjdk14-bootstrap ] ++ lib.optionals (!headless && enableGnome2) [ @@ -147,6 +147,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/15.nix b/nixpkgs/pkgs/development/compilers/openjdk/15.nix index ddd523ad7871..11333b1ef66a 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/15.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/15.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip -, zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2 +, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib, libpng, zlib, lcms2 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama , libXcursor, libXrandr, fontconfig, openjdk15-bootstrap , setJavaClassPath @@ -22,9 +22,9 @@ let sha256 = "1h8n5figc9q0k9p8b0qggyhvqagvxanfih1lj5j492c74cd1mx1l"; }; - nativeBuildInputs = [ pkg-config autoconf ]; + nativeBuildInputs = [ pkg-config autoconf unzip zip file which ]; buildInputs = [ - cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib + cpio perl zlib cups freetype alsa-lib libjpeg giflib libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig openjdk15-bootstrap ] ++ lib.optionals (!headless && enableGnome2) [ @@ -147,6 +147,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/16.nix b/nixpkgs/pkgs/development/compilers/openjdk/16.nix index e35369e75c52..99033e8738c5 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/16.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/16.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, fetchFromGitHub, bash, pkg-config, autoconf, cpio -, file, which, unzip, zip, perl, cups, freetype, alsaLib, libjpeg, giflib +, file, which, unzip, zip, perl, cups, freetype, alsa-lib, libjpeg, giflib , libpng, zlib, lcms2, libX11, libICE, libXrender, libXext, libXt, libXtst , libXi, libXinerama, libXcursor, libXrandr, fontconfig, openjdk16-bootstrap , setJavaClassPath @@ -28,7 +28,7 @@ let nativeBuildInputs = [ pkg-config autoconf unzip ]; buildInputs = [ - cpio file which zip perl zlib cups freetype alsaLib libjpeg giflib + cpio file which zip perl zlib cups freetype alsa-lib libjpeg giflib libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig openjdk16-bootstrap ] ++ lib.optionals (!headless && enableGnome2) [ @@ -153,6 +153,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/8.nix b/nixpkgs/pkgs/development/compilers/openjdk/8.nix index 75dc722b1b22..7a69038d5e0a 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/8.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/8.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, pkg-config, lndir, bash, cpio, file, which, unzip, zip -, cups, freetype, alsaLib, cacert, perl, liberation_ttf, fontconfig, zlib +, cups, freetype, alsa-lib, cacert, perl, liberation_ttf, fontconfig, zlib , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr , libjpeg, giflib , openjdk8-bootstrap @@ -85,7 +85,7 @@ let nativeBuildInputs = [ pkg-config lndir unzip ]; buildInputs = [ - cpio file which zip perl openjdk8-bootstrap zlib cups freetype alsaLib + cpio file which zip perl openjdk8-bootstrap zlib cups freetype alsa-lib libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst libXi libXinerama libXcursor libXrandr fontconfig ] ++ lib.optionals (!headless && enableGnome2) [ @@ -106,6 +106,7 @@ let ./fix-java-home-jdk8.patch ./read-truststore-from-env-jdk8.patch ./currency-date-range-jdk8.patch + ./fix-library-path-jdk8.patch ] ++ lib.optionals (!headless && enableGnome2) [ ./swing-use-gtk-jdk8.patch ]; @@ -262,6 +263,7 @@ let description = "The open-source Java Development Kit"; maintainers = with maintainers; [ edwtjo ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ]; + mainProgram = "java"; }; passthru = { diff --git a/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix b/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix index 6bcd79b274be..5dd979e5521a 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix @@ -1,5 +1,23 @@ -{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }: +{ lib, stdenv, fetchurl, unzip, setJavaClassPath }: let + # Details from https://www.azul.com/downloads/?version=java-11-lts&os=macos&package=jdk + # Note that the latest build may differ by platform + dist = { + x86_64-darwin = { + arch = "x64"; + zuluVersion = "11.48.21"; + jdkVersion = "11.0.11"; + sha256 = "0v0n7h7i04pvna41wpdq2k9qiy70sbbqzqzvazfdvgm3gb22asw6"; + }; + + aarch64-darwin = { + arch = "aarch64"; + zuluVersion = "11.48.21"; + jdkVersion = "11.0.11"; + sha256 = "066whglrxx81c95grv2kxdbvyh32728ixhml2v44ildh549n4lhc"; + }; + }."${stdenv.hostPlatform.system}"; + jce-policies = fetchurl { # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK! url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip"; @@ -7,16 +25,16 @@ let }; jdk = stdenv.mkDerivation rec { - name = "zulu11.43.21-ca-jdk11.0.9"; + pname = "zulu${dist.zuluVersion}-ca-jdk"; + version = dist.jdkVersion; src = fetchurl { - url = "https://cdn.azul.com/zulu/bin/${name}-macosx_x64.tar.gz"; - sha256 = "1j19fb5mwdkfn6y8wfsnvxsz6wfpcab4xv439fqssxy520n6q4zs"; - curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-mac/"; + url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-ca-jdk${dist.jdkVersion}-macosx_${dist.arch}.tar.gz"; + inherit (dist) sha256; + curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/"; }; nativeBuildInputs = [ unzip ]; - buildInputs = [ freetype ]; installPhase = '' mkdir -p $out @@ -41,8 +59,6 @@ let mkdir -p $out/nix-support printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs - install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/lib/libfontmanager.dylib - # Set JAVA_HOME automatically. cat <<EOF >> $out/nix-support/setup-hook if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi diff --git a/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix b/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix index a5cd15817e9a..0941aa728ead 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix @@ -1,25 +1,43 @@ -{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }: +{ lib, stdenv, fetchurl, unzip, setJavaClassPath }: let + # Details from https://www.azul.com/downloads/?version=java-8-lts&os=macos&package=jdk + # Note that the latest build may differ by platform + dist = { + x86_64-darwin = { + arch = "x64"; + zuluVersion = "8.54.0.21"; + jdkVersion = "8.0.292"; + sha256 = "1pgl0bir4r5v349gkxk54k6v62w241q7vw4gjxhv2g6pfq6hv7in"; + }; + + aarch64-darwin = { + arch = "aarch64"; + zuluVersion = "8.54.0.21"; + jdkVersion = "8.0.292"; + sha256 = "05w89wfjlfbpqfjnv6wisxmaf13qb28b2223f9264jyx30qszw1c"; + }; + }."${stdenv.hostPlatform.system}"; + jce-policies = fetchurl { # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK! url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip"; sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0"; }; - jdk = stdenv.mkDerivation { + jdk = stdenv.mkDerivation rec { # @hlolli: Later version than 1.8.0_202 throws error when building jvmci. # dyld: lazy symbol binding failed: Symbol not found: _JVM_BeforeHalt # Referenced from: ../libjava.dylib Expected in: .../libjvm.dylib - name = "zulu1.8.0_202-8.36.0.1"; + pname = "zulu${dist.zuluVersion}-ca-jdk"; + version = dist.jdkVersion; src = fetchurl { - url = "https://cdn.azul.com/zulu/bin/zulu8.36.0.1-ca-jdk8.0.202-macosx_x64.zip"; - sha256 = "0s92l1wlf02vjx8dvrsla2kq7qwxnmgh325b38mgqy872016jm9p"; - curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-linux/"; + url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-ca-jdk${dist.jdkVersion}-macosx_${dist.arch}.tar.gz"; + inherit (dist) sha256; + curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/"; }; nativeBuildInputs = [ unzip ]; - buildInputs = [ freetype ]; installPhase = '' mkdir -p $out @@ -44,8 +62,6 @@ let mkdir -p $out/nix-support printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs - install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib - # Set JAVA_HOME automatically. cat <<EOF >> $out/nix-support/setup-hook if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi diff --git a/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix b/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix index 731ff4d56de2..509d1ab55227 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix @@ -1,5 +1,23 @@ -{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }: +{ lib, stdenv, fetchurl, unzip, setJavaClassPath }: let + # Details from https://www.azul.com/downloads/?version=java-16-sts&os=macos&package=jdk + # Note that the latest build may differ by platform + dist = { + x86_64-darwin = { + arch = "x64"; + zuluVersion = "16.30.15"; + jdkVersion = "16.0.1"; + sha256 = "1jihn125dmxr9y5h9jq89zywm3z6rbwv5q7msfzsf2wzrr13jh0z"; + }; + + aarch64-darwin = { + arch = "aarch64"; + zuluVersion = "16.30.19"; + jdkVersion = "16.0.1"; + sha256 = "1i0bcjx3acb5dhslf6cabdcnd6mrz9728vxw9hb4al5y3f5fll4w"; + }; + }."${stdenv.hostPlatform.system}"; + jce-policies = fetchurl { # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK! url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip"; @@ -7,17 +25,16 @@ let }; jdk = stdenv.mkDerivation rec { - pname = "zulu16.28.11-ca-jdk"; - version = "16.0.0"; + pname = "zulu${dist.zuluVersion}-ca-jdk"; + version = dist.jdkVersion; src = fetchurl { - url = "https://cdn.azul.com/zulu/bin/${pname}${version}-macosx_x64.tar.gz"; - sha256 = "6d47ef22dc56ce1f5a102ed39e21d9a97320f0bb786818e2c686393109d79bc5"; + url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-ca-jdk${dist.jdkVersion}-macosx_${dist.arch}.tar.gz"; + inherit (dist) sha256; curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/"; }; nativeBuildInputs = [ unzip ]; - buildInputs = [ freetype ]; installPhase = '' mkdir -p $out @@ -42,8 +59,6 @@ let mkdir -p $out/nix-support printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs - install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/lib/libfontmanager.dylib - # Set JAVA_HOME automatically. cat <<EOF >> $out/nix-support/setup-hook if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi diff --git a/nixpkgs/pkgs/development/compilers/openjdk/fix-library-path-jdk8.patch b/nixpkgs/pkgs/development/compilers/openjdk/fix-library-path-jdk8.patch new file mode 100644 index 000000000000..3780e95ea5b6 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/openjdk/fix-library-path-jdk8.patch @@ -0,0 +1,37 @@ +diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +index c477851c1b..ff5e28d95b 100644 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -368,13 +368,13 @@ void os::init_system_properties_values() { + // ... + // 7: The default directories, normally /lib and /usr/lib. + #if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390)) +-#define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" ++#define DEFAULT_LIBPATH "" + #else +-#define DEFAULT_LIBPATH "/lib:/usr/lib" ++#define DEFAULT_LIBPATH "" + #endif + + // Base path of extensions installed on the system. +-#define SYS_EXT_DIR "/usr/java/packages" ++#define SYS_EXT_DIR "" + #define EXTENSIONS_DIR "/lib/ext" + #define ENDORSED_DIR "/lib/endorsed" + +@@ -437,13 +437,13 @@ void os::init_system_properties_values() { + strlen(v) + 1 + + sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch) + sizeof(DEFAULT_LIBPATH) + 1, + mtInternal); +- sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib/%s:" DEFAULT_LIBPATH, v, v_colon, cpu_arch); ++ sprintf(ld_library_path, "%s", v); + Arguments::set_library_path(ld_library_path); + FREE_C_HEAP_ARRAY(char, ld_library_path, mtInternal); + } + + // Extensions directories. +- sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home()); ++ sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home()); + Arguments::set_ext_dirs(buf); + + // Endorsed standards default directory. diff --git a/nixpkgs/pkgs/development/compilers/openjdk/jre.nix b/nixpkgs/pkgs/development/compilers/openjdk/jre.nix index 436bd0468c52..78dec7885d93 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/jre.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/jre.nix @@ -1,6 +1,7 @@ { stdenv , jdk , lib +, callPackage , modules ? [ "java.base" ] }: @@ -29,6 +30,10 @@ let passthru = { home = "${jre}"; + tests = [ + (callPackage ./tests/test_jre_minimal.nix {}) + (callPackage ./tests/test_jre_minimal_with_logging.nix {}) + ]; }; }; in jre diff --git a/nixpkgs/pkgs/development/compilers/openjdk/jre_minimal_test1.nix b/nixpkgs/pkgs/development/compilers/openjdk/jre_minimal_test1.nix new file mode 100644 index 000000000000..eebd11fb2fdf --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/openjdk/jre_minimal_test1.nix @@ -0,0 +1,16 @@ +{ runCommand +, callPackage +, jdk +, jre_minimal +}: + +let + hello = callPackage tests/hello.nix { + jdk = jdk; + jre = jre_minimal; + }; +in + runCommand "test" {} '' + ${hello}/bin/hello | grep "Hello, world!" + touch $out + '' diff --git a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix index 8688831cdaac..228dbf9b14e9 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, writeText, gradleGen, pkg-config, perl, cmake -, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib, ffmpeg_3, python, ruby +, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib, ffmpeg, python, ruby , openjdk11-bootstrap }: let @@ -19,7 +19,7 @@ let sha256 = "1h7qsylr7rnwnbimqjyn3whszp9kv4h3gpicsrb3mradxc9yv194"; }; - buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsaLib ffmpeg_3 ]; + buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg ]; nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python ruby ]; dontUseCmakeConfigure = true; diff --git a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix index 655b29f6535d..c36cbaa03f95 100644 --- a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix +++ b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, writeText, openjdk11_headless, gradleGen -, pkg-config, perl, cmake, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib +, pkg-config, perl, cmake, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib , ffmpeg, python3, ruby }: let @@ -21,7 +21,7 @@ let sha256 = "019glq8rhn6amy3n5jc17vi2wpf1pxpmmywvyz1ga8n09w7xscq1"; }; - buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsaLib ffmpeg ]; + buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg ]; nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python3 ruby ]; dontUseCmakeConfigure = true; @@ -95,8 +95,9 @@ in makePackage { postFixup = '' # Remove references to bootstrap. + export openjdkOutPath='${openjdk11_headless.outPath}' find "$out" -name \*.so | while read lib; do - new_refs="$(patchelf --print-rpath "$lib" | sed -E 's,:?${lib.escape ["+"] openjdk11_headless.outPath}[^:]*,,')" + new_refs="$(patchelf --print-rpath "$lib" | perl -pe 's,:?\Q$ENV{openjdkOutPath}\E[^:]*,,')" patchelf --set-rpath "$new_refs" "$lib" done ''; diff --git a/nixpkgs/pkgs/development/compilers/openjdk/tests/hello-logging.nix b/nixpkgs/pkgs/development/compilers/openjdk/tests/hello-logging.nix new file mode 100644 index 000000000000..71f3a5543f7c --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/openjdk/tests/hello-logging.nix @@ -0,0 +1,47 @@ +{ jdk +, jre +, pkgs +}: + +/* 'Hello world' Java application derivation for use in tests */ +let + source = pkgs.writeTextDir "src/Hello.java" '' + import java.util.logging.Logger; + import java.util.logging.Level; + + class Hello { + static Logger logger = Logger.getLogger(Hello.class.getName()); + + public static void main(String[] args) { + logger.log(Level.INFO, "Hello, world!"); + } + } + ''; +in + pkgs.stdenv.mkDerivation { + pname = "hello"; + version = "1.0.0"; + + src = source; + + buildPhase = '' + runHook preBuildPhase + ${jdk}/bin/javac src/Hello.java + runHook postBuildPhase + ''; + installPhase = '' + runHook preInstallPhase + + mkdir -p $out/lib + cp src/Hello.class $out/lib + + mkdir -p $out/bin + cat >$out/bin/hello <<EOF; + #!/usr/bin/env sh + ${jre}/bin/java -cp $out/lib Hello + EOF + chmod a+x $out/bin/hello + + runHook postInstallPhase + ''; + } diff --git a/nixpkgs/pkgs/development/compilers/openjdk/tests/hello.nix b/nixpkgs/pkgs/development/compilers/openjdk/tests/hello.nix new file mode 100644 index 000000000000..bc5be4a9e9a9 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/openjdk/tests/hello.nix @@ -0,0 +1,42 @@ +{ jdk +, jre +, pkgs +}: + +/* 'Hello world' Java application derivation for use in tests */ +let + source = pkgs.writeTextDir "src/Hello.java" '' + class Hello { + public static void main(String[] args) { + System.out.println("Hello, world!"); + } + } + ''; +in + pkgs.stdenv.mkDerivation { + pname = "hello"; + version = "1.0.0"; + + src = source; + + buildPhase = '' + runHook preBuildPhase + ${jdk}/bin/javac src/Hello.java + runHook postBuildPhase + ''; + installPhase = '' + runHook preInstallPhase + + mkdir -p $out/lib + cp src/Hello.class $out/lib + + mkdir -p $out/bin + cat >$out/bin/hello <<EOF; + #!/usr/bin/env sh + ${jre}/bin/java -cp $out/lib Hello + EOF + chmod a+x $out/bin/hello + + runHook postInstallPhase + ''; + } diff --git a/nixpkgs/pkgs/development/compilers/openjdk/tests/test_jre_minimal.nix b/nixpkgs/pkgs/development/compilers/openjdk/tests/test_jre_minimal.nix new file mode 100644 index 000000000000..ed7b839cd22b --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/openjdk/tests/test_jre_minimal.nix @@ -0,0 +1,16 @@ +{ runCommand +, callPackage +, jdk +, jre_minimal +}: + +let + hello = callPackage ./hello.nix { + jdk = jdk; + jre = jre_minimal; + }; +in + runCommand "test" {} '' + ${hello}/bin/hello | grep "Hello, world!" + touch $out + '' diff --git a/nixpkgs/pkgs/development/compilers/openjdk/tests/test_jre_minimal_with_logging.nix b/nixpkgs/pkgs/development/compilers/openjdk/tests/test_jre_minimal_with_logging.nix new file mode 100644 index 000000000000..b9c417d3949c --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/openjdk/tests/test_jre_minimal_with_logging.nix @@ -0,0 +1,21 @@ +{ runCommand +, callPackage +, jdk +, jre_minimal +}: + +let + hello-logging = callPackage ./hello-logging.nix { + jdk = jdk; + jre = jre_minimal.override { + modules = [ + "java.base" + "java.logging" + ]; + }; + }; +in + runCommand "test" {} '' + ${hello-logging}/bin/hello &>/dev/stdout | grep "Hello, world!" + touch $out + '' |