Fix jdk cross-compilation

This commit is contained in:
Simonas Kazlauskas
2023-02-23 21:48:51 +02:00
parent 0cedd21446
commit 1407a818f0
2 changed files with 20 additions and 2 deletions

18
jdk.nix Normal file
View File

@@ -0,0 +1,18 @@
{ buildPlatform, hostPlatform, jdk11, which, zip, buildPackages }:
if buildPlatform == hostPlatform
then jdk11
else (jdk11.override {
# libIDL does not compile in cross-compile scenarios.
enableGnome2 = false;
}).overrideAttrs (old: {
# lol, nixpkgs cant get pkgs right
# AUTOCONF = "${autoconf}/bin/autoconf";
nativeBuildInputs = old.nativeBuildInputs ++ [ which zip ];
depsBuildBuild = with buildPackages; [ stdenv.cc autoconf ];
configureFlags = old.configureFlags ++ [
"--with-jtreg=no"
"--disable-hotspot-gtest"
"--with-build-jdk=${buildPackages.jdk11}"
];
})