diff --git a/flake.nix b/flake.nix index 324048c..c1ba270 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,8 @@ outputs = { flake-utils, nixpkgs, ... }: let overlay = final: prev: rec { - jdk-openhab = final.jdk11; - openhab = final.callPackage ./openhab.nix { inherit jdk-openhab; }; + jdk-openhab = final.callPackage ./jdk.nix {}; + openhab = final.callPackage ./openhab.nix { }; openhab-addons = final.callPackage ./openhab-addons.nix {}; }; pkgs = system: import nixpkgs { inherit system; overlays = [ overlay ]; }; diff --git a/jdk.nix b/jdk.nix new file mode 100644 index 0000000..d4d4126 --- /dev/null +++ b/jdk.nix @@ -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 can’t 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}" + ]; +})