openjdk: format
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
@@ -134,13 +134,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
pname = "openjdk" + lib.optionalString headless "-headless";
|
pname = "openjdk" + lib.optionalString headless "-headless";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
outputs =
|
outputs = [ "out" ] ++ lib.optionals (!atLeast11) [ "jre" ];
|
||||||
[
|
|
||||||
"out"
|
|
||||||
]
|
|
||||||
++ lib.optionals (!atLeast11) [
|
|
||||||
"jre"
|
|
||||||
];
|
|
||||||
|
|
||||||
inherit (source) src;
|
inherit (source) src;
|
||||||
|
|
||||||
@@ -247,18 +241,10 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
pkg-config
|
pkg-config
|
||||||
removeReferencesTo
|
removeReferencesTo
|
||||||
]
|
]
|
||||||
++ lib.optionals atLeast11 [
|
++ lib.optionals atLeast11 [ autoconf ]
|
||||||
autoconf
|
++ lib.optionals (!atLeast11) [ lndir ]
|
||||||
]
|
++ [ unzip ]
|
||||||
++ lib.optionals (!atLeast11) [
|
++ lib.optionals atLeast21 [ ensureNewerSourcesForZipFilesHook ];
|
||||||
lndir
|
|
||||||
]
|
|
||||||
++ [
|
|
||||||
unzip
|
|
||||||
]
|
|
||||||
++ lib.optionals atLeast21 [
|
|
||||||
ensureNewerSourcesForZipFilesHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[
|
[
|
||||||
@@ -272,9 +258,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
cups
|
cups
|
||||||
freetype
|
freetype
|
||||||
]
|
]
|
||||||
++ lib.optionals (atLeast11 && !atLeast21) [
|
++ lib.optionals (atLeast11 && !atLeast21) [ harfbuzz ]
|
||||||
harfbuzz
|
|
||||||
]
|
|
||||||
++ [
|
++ [
|
||||||
alsa-lib
|
alsa-lib
|
||||||
libjpeg
|
libjpeg
|
||||||
@@ -289,15 +273,9 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
libX11
|
libX11
|
||||||
libICE
|
libICE
|
||||||
]
|
]
|
||||||
++ lib.optionals (!atLeast11) [
|
++ lib.optionals (!atLeast11) [ libXext ]
|
||||||
libXext
|
++ [ libXrender ]
|
||||||
]
|
++ lib.optionals atLeast11 [ libXext ]
|
||||||
++ [
|
|
||||||
libXrender
|
|
||||||
]
|
|
||||||
++ lib.optionals atLeast11 [
|
|
||||||
libXext
|
|
||||||
]
|
|
||||||
++ [
|
++ [
|
||||||
libXtst
|
libXtst
|
||||||
libXt
|
libXt
|
||||||
@@ -316,9 +294,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
propagatedBuildInputs = lib.optionals (!atLeast11) [ setJavaClassPath ];
|
propagatedBuildInputs = lib.optionals (!atLeast11) [ setJavaClassPath ];
|
||||||
|
|
||||||
nativeInstallCheckInputs = lib.optionals atLeast23 [
|
nativeInstallCheckInputs = lib.optionals atLeast23 [ versionCheckHook ];
|
||||||
versionCheckHook
|
|
||||||
];
|
|
||||||
|
|
||||||
# JDK's build system attempts to specifically detect
|
# JDK's build system attempts to specifically detect
|
||||||
# and special-case WSL, and we don't want it to do that,
|
# and special-case WSL, and we don't want it to do that,
|
||||||
@@ -330,9 +306,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
# https://openjdk.org/groups/build/doc/building.html
|
# https://openjdk.org/groups/build/doc/building.html
|
||||||
configureFlags =
|
configureFlags =
|
||||||
[
|
[ "--with-boot-jdk=${jdk-bootstrap'.home}" ]
|
||||||
"--with-boot-jdk=${jdk-bootstrap'.home}"
|
|
||||||
]
|
|
||||||
++ (
|
++ (
|
||||||
if atLeast23 then
|
if atLeast23 then
|
||||||
[
|
[
|
||||||
@@ -344,9 +318,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
"--with-version-build=${versionBuild}"
|
"--with-version-build=${versionBuild}"
|
||||||
"--with-version-opt=nixos"
|
"--with-version-opt=nixos"
|
||||||
]
|
]
|
||||||
++ [
|
++ [ "--with-version-pre=" ]
|
||||||
"--with-version-pre="
|
|
||||||
]
|
|
||||||
else
|
else
|
||||||
[
|
[
|
||||||
"--with-update-version=${lib.removePrefix "${featureVersion}u" (lib.elemAt versionSplit 0)}"
|
"--with-update-version=${lib.removePrefix "${featureVersion}u" (lib.elemAt versionSplit 0)}"
|
||||||
@@ -365,9 +337,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
"--with-harfbuzz=system"
|
"--with-harfbuzz=system"
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
[
|
[ "--disable-freetype-bundling" ]
|
||||||
"--disable-freetype-bundling"
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
++ (
|
++ (
|
||||||
if atLeast11 then
|
if atLeast11 then
|
||||||
@@ -384,12 +354,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
"--with-giflib=system"
|
"--with-giflib=system"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
++ [
|
++ [ "--with-stdc++lib=dynamic" ]
|
||||||
"--with-stdc++lib=dynamic"
|
++ lib.optionals (featureVersion == "11") [ "--disable-warnings-as-errors" ]
|
||||||
]
|
|
||||||
++ lib.optionals (featureVersion == "11") [
|
|
||||||
"--disable-warnings-as-errors"
|
|
||||||
]
|
|
||||||
# OpenJDK 11 cannot be built by recent versions of Clang, as far as I can tell (see
|
# OpenJDK 11 cannot be built by recent versions of Clang, as far as I can tell (see
|
||||||
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260319). Known to
|
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260319). Known to
|
||||||
# compile with LLVM 12.
|
# compile with LLVM 12.
|
||||||
@@ -623,9 +589,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# TODO: The OpenJDK 8 derivation got this wrong.
|
# TODO: The OpenJDK 8 derivation got this wrong.
|
||||||
disallowedReferences = [
|
disallowedReferences = [ (if atLeast11 then jdk-bootstrap' else jdk-bootstrap) ];
|
||||||
(if atLeast11 then jdk-bootstrap' else jdk-bootstrap)
|
|
||||||
];
|
|
||||||
|
|
||||||
passthru =
|
passthru =
|
||||||
{
|
{
|
||||||
@@ -634,9 +598,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
inherit (source) updateScript;
|
inherit (source) updateScript;
|
||||||
}
|
}
|
||||||
// (if atLeast11 then { inherit gtk3; } else { inherit gtk2; })
|
// (if atLeast11 then { inherit gtk3; } else { inherit gtk2; })
|
||||||
// lib.optionalAttrs (!atLeast23) {
|
// lib.optionalAttrs (!atLeast23) { inherit architecture; };
|
||||||
inherit architecture;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Open-source Java Development Kit";
|
description = "Open-source Java Development Kit";
|
||||||
@@ -658,9 +620,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
"armv6l-linux"
|
"armv6l-linux"
|
||||||
"powerpc64le-linux"
|
"powerpc64le-linux"
|
||||||
]
|
]
|
||||||
++ lib.optionals atLeast17 [
|
++ lib.optionals atLeast17 [ "riscv64-linux" ];
|
||||||
"riscv64-linux"
|
|
||||||
];
|
|
||||||
# OpenJDK 8 was broken for musl at 2024-01-17. Tracking issue:
|
# OpenJDK 8 was broken for musl at 2024-01-17. Tracking issue:
|
||||||
# https://github.com/NixOS/nixpkgs/issues/281618
|
# https://github.com/NixOS/nixpkgs/issues/281618
|
||||||
# error: ‘isnanf’ was not declared in this scope
|
# error: ‘isnanf’ was not declared in this scope
|
||||||
|
|||||||
Reference in New Issue
Block a user