openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
{ stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype
|
2016-10-02 17:44:21 +01:00
|
|
|
, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib, lndir
|
2018-06-18 23:25:41 +01:00
|
|
|
, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr
|
2016-10-02 17:44:21 +01:00
|
|
|
, libjpeg, giflib
|
2015-09-14 17:27:20 +01:00
|
|
|
, setJavaClassPath
|
|
|
|
, minimal ? false
|
2015-11-03 13:21:42 +00:00
|
|
|
, enableInfinality ? true # font rendering patch
|
2016-10-02 17:44:21 +01:00
|
|
|
, enableGnome2 ? true, gtk2, gnome_vfs, glib, GConf
|
2015-09-14 17:27:20 +01:00
|
|
|
}:
|
2015-06-07 05:55:09 +01:00
|
|
|
|
2015-01-18 20:57:50 +00:00
|
|
|
let
|
2015-09-10 17:37:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The JRE libraries are in directories that depend on the CPU.
|
|
|
|
*/
|
|
|
|
architecture =
|
2018-02-20 22:44:40 +00:00
|
|
|
if stdenv.hostPlatform.system == "i686-linux" then
|
2015-09-10 17:37:27 +01:00
|
|
|
"i386"
|
2018-02-20 22:44:40 +00:00
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
2015-09-10 17:37:27 +01:00
|
|
|
"amd64"
|
|
|
|
else
|
|
|
|
throw "openjdk requires i686-linux or x86_64 linux";
|
|
|
|
|
2019-04-17 13:49:47 +01:00
|
|
|
update = "212";
|
2019-01-21 17:19:17 +00:00
|
|
|
build = "ga";
|
2015-07-18 02:00:40 +01:00
|
|
|
baseurl = "http://hg.openjdk.java.net/jdk8u/jdk8u";
|
2019-01-21 17:19:17 +00:00
|
|
|
repover = "jdk8u${update}-${build}";
|
2015-01-18 20:57:50 +00:00
|
|
|
jdk8 = fetchurl {
|
|
|
|
url = "${baseurl}/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "00rl33h4cl4b4p3hcid765h38x2jdkb14ylh8k1zhnd0ka76crgg";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
langtools = fetchurl {
|
|
|
|
url = "${baseurl}/langtools/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "0va6g2dccf1ph6mpwxswbks5axp7zz258cl89qq9r8jn4ni04agw";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
hotspot = fetchurl {
|
|
|
|
url = "${baseurl}/hotspot/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "0sgr9df10hs49pjld6c6kr374v4zwd9s52pc3drz68zrlk71ja4s";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
corba = fetchurl {
|
|
|
|
url = "${baseurl}/corba/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "1hq0sr4k4k4iv815kg72i9lvd7n7mn5pmw96ckk9p1rnyagn9z03";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
jdk = fetchurl {
|
|
|
|
url = "${baseurl}/jdk/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "1fc59jrbfq8l067mggzy5dnrvni7lwaqd7hahs4nqv87kyrfg545";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
jaxws = fetchurl {
|
|
|
|
url = "${baseurl}/jaxws/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "1ka2fvyxdmpfhk814s314gx53yvdr19vpsqygx283v9nbq90l1yg";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
jaxp = fetchurl {
|
|
|
|
url = "${baseurl}/jaxp/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "15vlgs5v2ax8sqwh7bg50fnlrwlpnkp0myzrvpqs1mcza8pyasp8";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
|
|
|
nashorn = fetchurl {
|
|
|
|
url = "${baseurl}/nashorn/archive/${repover}.tar.gz";
|
2019-04-17 13:49:47 +01:00
|
|
|
sha256 = "1jzn0yi0v6lda5y8ib07g1p6zymnbcx9yy6iz8niggpm7205y93h";
|
2015-01-18 20:57:50 +00:00
|
|
|
};
|
2015-03-26 18:02:11 +00:00
|
|
|
openjdk8 = stdenv.mkDerivation {
|
2019-04-17 13:49:47 +01:00
|
|
|
name = "openjdk-8u${update}-${build}";
|
2015-06-08 05:01:17 +01:00
|
|
|
|
|
|
|
srcs = [ jdk8 langtools hotspot corba jdk jaxws jaxp nashorn ];
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
outputs = [ "out" "jre" ];
|
|
|
|
|
2015-10-11 16:11:19 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2015-06-08 05:01:17 +01:00
|
|
|
buildInputs = [
|
2016-10-02 17:44:21 +01:00
|
|
|
cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib
|
|
|
|
libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst
|
2018-06-18 23:25:41 +01:00
|
|
|
libXi libXinerama libXcursor libXrandr lndir fontconfig
|
2016-10-02 17:44:21 +01:00
|
|
|
] ++ lib.optionals (!minimal && enableGnome2) [
|
|
|
|
gtk2 gnome_vfs GConf glib
|
2015-06-08 05:01:17 +01:00
|
|
|
];
|
|
|
|
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
#move the seven other source dirs under the main jdk8u directory,
|
|
|
|
#with version suffixes removed, as the remainder of the build will expect
|
2015-06-08 05:01:17 +01:00
|
|
|
prePatch = ''
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
mainDir=$(find . -maxdepth 1 -name jdk8u\*);
|
|
|
|
find . -maxdepth 1 -name \*jdk\* -not -name jdk8u\* | awk -F- '{print $1}' | while read p; do
|
|
|
|
mv $p-* $mainDir/$p
|
2015-06-08 05:01:17 +01:00
|
|
|
done
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
cd $mainDir
|
2015-06-08 05:01:17 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./fix-java-home-jdk8.patch
|
|
|
|
./read-truststore-from-env-jdk8.patch
|
|
|
|
./currency-date-range-jdk8.patch
|
2016-10-02 17:44:21 +01:00
|
|
|
] ++ lib.optionals (!minimal && enableInfinality) [
|
2015-11-03 13:21:42 +00:00
|
|
|
./004_add-fontconfig.patch
|
|
|
|
./005_enable-infinality.patch
|
2016-10-02 21:13:18 +01:00
|
|
|
] ++ lib.optionals (!minimal && enableGnome2) [
|
2018-03-30 04:14:23 +01:00
|
|
|
./swing-use-gtk-jdk8.patch
|
2016-10-02 17:44:21 +01:00
|
|
|
];
|
2015-06-08 05:01:17 +01:00
|
|
|
|
2019-04-17 11:42:07 +01:00
|
|
|
# Hotspot cares about the host(!) version otherwise
|
|
|
|
DISABLE_HOTSPOT_OS_VERSION_CHECK = "ok";
|
|
|
|
|
2015-06-08 05:01:17 +01:00
|
|
|
preConfigure = ''
|
|
|
|
chmod +x configure
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
substituteInPlace configure --replace /bin/bash "${bash}/bin/bash"
|
2019-01-15 22:41:31 +00:00
|
|
|
substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "${stdenv.shell}"
|
2017-07-28 02:29:39 +01:00
|
|
|
substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path"
|
2017-08-15 19:18:27 +01:00
|
|
|
''
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1306558
|
2017-08-31 04:00:12 +01:00
|
|
|
# https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716
|
2017-08-15 19:18:27 +01:00
|
|
|
+ stdenv.lib.optionalString stdenv.cc.isGNU ''
|
2017-08-31 04:00:12 +01:00
|
|
|
NIX_CFLAGS_COMPILE+=" -fno-lifetime-dse -fno-delete-null-pointer-checks -std=gnu++98 -Wno-error"
|
2015-06-08 05:01:17 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-boot-jdk=${bootjdk.home}"
|
|
|
|
"--with-update-version=${update}"
|
|
|
|
"--with-build-number=${build}"
|
|
|
|
"--with-milestone=fcs"
|
|
|
|
"--enable-unlimited-crypto"
|
|
|
|
"--disable-debug-symbols"
|
|
|
|
"--disable-freetype-bundling"
|
2016-10-02 17:44:21 +01:00
|
|
|
"--with-zlib=system"
|
|
|
|
"--with-giflib=system"
|
|
|
|
"--with-stdc++lib=dynamic"
|
2016-08-20 16:29:19 +01:00
|
|
|
|
|
|
|
# glibc 2.24 deprecated readdir_r so we need this
|
|
|
|
# See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html
|
|
|
|
"--with-extra-cflags=\"-Wno-error=deprecated-declarations\""
|
2016-10-02 17:44:21 +01:00
|
|
|
] ++ lib.optional minimal "--disable-headful";
|
2015-06-08 05:01:17 +01:00
|
|
|
|
2016-10-02 17:44:21 +01:00
|
|
|
NIX_LDFLAGS= lib.optionals (!minimal) [
|
|
|
|
"-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic"
|
|
|
|
] ++ lib.optionals (!minimal && enableGnome2) [
|
|
|
|
"-lgtk-x11-2.0" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2"
|
|
|
|
];
|
2015-06-08 05:01:17 +01:00
|
|
|
|
2016-10-02 17:44:21 +01:00
|
|
|
buildFlags = [ "all" ];
|
2015-06-08 05:01:17 +01:00
|
|
|
|
2018-04-25 04:20:18 +01:00
|
|
|
doCheck = false; # fails with "No rule to make target 'y'."
|
|
|
|
|
2015-06-08 05:01:17 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk
|
|
|
|
|
2015-09-14 17:27:20 +01:00
|
|
|
cp -av build/*/images/j2sdk-image/* $out/lib/openjdk
|
2015-04-24 23:22:41 +01:00
|
|
|
|
2016-09-01 20:00:41 +01:00
|
|
|
# Remove some broken manpages.
|
|
|
|
rm -rf $out/lib/openjdk/man/ja*
|
|
|
|
|
|
|
|
# Mirror some stuff in top-level.
|
|
|
|
mkdir $out/include $out/share/man
|
|
|
|
ln -s $out/lib/openjdk/include/* $out/include/
|
|
|
|
ln -s $out/lib/openjdk/man/* $out/share/man/
|
2015-06-08 05:01:17 +01:00
|
|
|
|
|
|
|
# jni.h expects jni_md.h to be in the header search path.
|
2015-09-14 17:27:20 +01:00
|
|
|
ln -s $out/include/linux/*_md.h $out/include/
|
2015-06-08 05:01:17 +01:00
|
|
|
|
|
|
|
# Remove crap from the installation.
|
|
|
|
rm -rf $out/lib/openjdk/demo $out/lib/openjdk/sample
|
2016-10-02 17:44:21 +01:00
|
|
|
${lib.optionalString minimal ''
|
|
|
|
rm $out/lib/openjdk/jre/lib/${architecture}/{libjsound,libjsoundalsa,libsplashscreen,libawt*,libfontmanager}.so
|
|
|
|
rm $out/lib/openjdk/jre/bin/policytool
|
|
|
|
rm $out/lib/openjdk/bin/{policytool,appletviewer}
|
|
|
|
''}
|
2015-06-08 05:01:17 +01:00
|
|
|
|
|
|
|
# Move the JRE to a separate output and setup fallback fonts
|
|
|
|
mv $out/lib/openjdk/jre $jre/lib/openjdk/
|
|
|
|
mkdir $out/lib/openjdk/jre
|
2016-10-02 17:44:21 +01:00
|
|
|
${lib.optionalString (!minimal) ''
|
|
|
|
mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback
|
|
|
|
lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback
|
|
|
|
''}
|
2015-06-08 05:01:17 +01:00
|
|
|
lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre
|
|
|
|
|
|
|
|
rm -rf $out/lib/openjdk/jre/bina
|
|
|
|
ln -s $out/lib/openjdk/bin $out/lib/openjdk/jre/bin
|
|
|
|
|
2016-01-23 08:54:07 +00:00
|
|
|
# Make sure cmm/*.pf are not symlinks:
|
|
|
|
# https://youtrack.jetbrains.com/issue/IDEA-147272
|
|
|
|
rm -rf $out/lib/openjdk/jre/lib/cmm
|
|
|
|
ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm
|
|
|
|
|
2015-06-08 05:01:17 +01:00
|
|
|
# Remove duplicate binaries.
|
|
|
|
for i in $(cd $out/lib/openjdk/bin && echo *); do
|
|
|
|
if [ "$i" = java ]; then continue; fi
|
|
|
|
if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then
|
|
|
|
ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Generate certificates.
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
(
|
|
|
|
cd $jre/lib/openjdk/jre/lib/security
|
|
|
|
rm cacerts
|
|
|
|
perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt
|
|
|
|
)
|
2015-06-08 05:01:17 +01:00
|
|
|
|
|
|
|
ln -s $out/lib/openjdk/bin $out/bin
|
|
|
|
ln -s $jre/lib/openjdk/jre/bin $jre/bin
|
2016-09-01 19:47:19 +01:00
|
|
|
ln -s $jre/lib/openjdk/jre $out/jre
|
2015-06-08 05:01:17 +01:00
|
|
|
'';
|
|
|
|
|
2015-09-14 17:27:20 +01:00
|
|
|
# FIXME: this is unnecessary once the multiple-outputs branch is merged.
|
|
|
|
preFixup = ''
|
2018-07-08 03:25:38 +01:00
|
|
|
prefix=$jre stripDirs "$STRIP" "$stripDebugList" "''${stripDebugFlags:--S}"
|
2015-09-14 17:27:20 +01:00
|
|
|
patchELF $jre
|
2017-11-17 18:26:21 +00:00
|
|
|
propagatedBuildInputs+=" $jre"
|
2015-09-14 17:27:20 +01:00
|
|
|
|
|
|
|
# Propagate the setJavaClassPath setup hook from the JRE so that
|
|
|
|
# any package that depends on the JRE has $CLASSPATH set up
|
|
|
|
# properly.
|
|
|
|
mkdir -p $jre/nix-support
|
2017-11-17 18:26:21 +00:00
|
|
|
printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
|
2015-09-14 17:27:20 +01:00
|
|
|
|
|
|
|
# Set JAVA_HOME automatically.
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
cat <<EOF > $out/nix-support/setup-hook
|
|
|
|
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
2015-06-08 08:00:12 +01:00
|
|
|
postFixup = ''
|
|
|
|
# Build the set of output library directories to rpath against
|
|
|
|
LIBDIRS=""
|
|
|
|
for output in $outputs; do
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS"
|
2015-06-08 08:00:12 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
# Add the local library paths to remove dependencies on the bootstrap
|
|
|
|
for output in $outputs; do
|
openjdk9: init at 9.0.0+180
* openjdk 8: code cleanup
as recommended by 0xABAB in #27194
* openjdk 9: init at ea build 176
this starts with copy of 8.nix and just updates hashes and replaces 8
with 9. it also tweaks the version handling because we aren't dealing
with an update version yet.
* openjdk 9: adapt patches from openjdk 8
fix-java-home: surrounding code changed slightly
swing-use-gtk-jdk9: location of the file being patched changed due to
modularization
read-truststore-from-env: the code that handles the trustStore was
refactored out into a helper class in upstream commit
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/904861872c0e
adlc_updater: this isn't present anymore
* openjdk 9: make two more warnings-as-errors non-fatal
this requires that we switch to configureFlagsArray to deal with
whitespace
the errors being suppressed are show below:
* For target support_native_java.desktop_libawt_xawt_awt_Robot.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c: In function 'isXCompositeDisplay':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
^
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:152:50: error: embedded '\0' in format
[-Werror=format-contains-nul]
cc1: all warnings being treated as errors
* For target support_native_jdk.hotspot.agent_libsa_ps_core.o:
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function 'read_exec_segments':
/tmp/nix-build-openjdk-9ea-b176.drv-0/jdk9-jdk-9+176/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:834:7: error: ignoring return value of 'pread', declared
with attribute warn_unused_result [-Werror=unused-result]
pread(ph->core->exec_fd, interp_name, exec_php->p_filesz, exec_php->p_offset);
^
cc1: all warnings being treated as errors
* openjdk 9: ea+176 -> ea+180
* openjdk 9: TODO disable infinality patches, at least to start
the code being patched here seems to have changed substantially or
perhaps even disappeared altogether. need to investigate whether
these patches are still relevant.
* openjdk 9: update installPhase for modularization
* separate jdk and jre images are now present under build/*/images
* samples have been removed (JEP 298)
-- TODO that JEP says demos will be gone too, but it seems some are still present?
* bina directory is no longer present
* openjdk 9: TODO handle *.pf files or purge this code completely
* openjdk 9: update minimal jre components
in particular, the name of the config option for headless has changed,
per https://bugs.openjdk.java.net/browse/JDK-8163102
* TODO about echo -n vs printWords, #27427
2017-09-22 13:27:34 +01:00
|
|
|
OUTPUTDIR=$(eval echo \$$output)
|
|
|
|
BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
|
2015-06-08 08:00:12 +01:00
|
|
|
echo "$BINLIBS" | while read i; do
|
|
|
|
patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
|
|
|
|
patchelf --shrink-rpath "$i" || true
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
# Test to make sure that we don't depend on the bootstrap
|
|
|
|
for output in $outputs; do
|
|
|
|
if grep -q -r '${bootjdk}' $(eval echo \$$output); then
|
|
|
|
echo "Extraneous references to ${bootjdk} detected"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2015-06-08 05:01:17 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://openjdk.java.net/;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
description = "The open-source Java Development Kit";
|
2017-08-31 04:00:12 +01:00
|
|
|
maintainers = with maintainers; [ edwtjo nequissimus ];
|
2015-06-08 05:01:17 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
|
2015-09-10 17:37:27 +01:00
|
|
|
passthru = {
|
|
|
|
inherit architecture;
|
|
|
|
home = "${openjdk8}/lib/openjdk";
|
|
|
|
};
|
2015-06-08 05:01:17 +01:00
|
|
|
};
|
|
|
|
in openjdk8
|