From 8886c89d0eff3a192ed9f98a13849f76e73c5073 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 10 Oct 2022 10:57:08 +0200 Subject: [PATCH] {temurin,adoptopenjdk}-bin: use alpine_linux os for musl libc --- .../compilers/adoptopenjdk-bin/jdk11-linux.nix | 11 ++++++----- .../compilers/adoptopenjdk-bin/jdk13-linux.nix | 11 ++++++----- .../compilers/adoptopenjdk-bin/jdk14-linux.nix | 11 ++++++----- .../compilers/adoptopenjdk-bin/jdk15-linux.nix | 11 ++++++----- .../compilers/adoptopenjdk-bin/jdk16-linux.nix | 11 ++++++----- .../compilers/adoptopenjdk-bin/jdk17-linux.nix | 7 ++++--- .../compilers/adoptopenjdk-bin/jdk8-linux.nix | 11 ++++++----- pkgs/development/compilers/temurin-bin/jdk-linux.nix | 5 +++-- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/java-packages.nix | 2 +- 10 files changed, 45 insertions(+), 37 deletions(-) diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix index da5e9c49d236..fcad50017dba 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix @@ -1,11 +1,12 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.linux.jdk.hotspot; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.linux.jre.hotspot; }; - jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.linux.jdk.openj9; }; - jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.linux.jre.openj9; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.${variant}.jdk.hotspot; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.${variant}.jre.hotspot; }; + jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.${variant}.jdk.openj9; }; + jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.${variant}.jre.openj9; }; } diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk13-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk13-linux.nix index f503b03a833c..6c57b542e65b 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk13-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk13-linux.nix @@ -1,11 +1,12 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.linux.jdk.hotspot; knownVulnerabilities = ["Support ended"]; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.linux.jre.hotspot; knownVulnerabilities = ["Support ended"]; }; - jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.linux.jdk.openj9; knownVulnerabilities = ["Support ended"]; }; - jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.linux.jre.openj9; knownVulnerabilities = ["Support ended"]; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.${variant}.jdk.hotspot; knownVulnerabilities = ["Support ended"]; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.${variant}.jre.hotspot; knownVulnerabilities = ["Support ended"]; }; + jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.${variant}.jdk.openj9; knownVulnerabilities = ["Support ended"]; }; + jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.${variant}.jre.openj9; knownVulnerabilities = ["Support ended"]; }; } diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk14-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk14-linux.nix index a55a708b3726..573fc17b51be 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk14-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk14-linux.nix @@ -1,11 +1,12 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.linux.jdk.hotspot; knownVulnerabilities = ["Support ended"]; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.linux.jre.hotspot; knownVulnerabilities = ["Support ended"]; }; - jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.linux.jdk.openj9; knownVulnerabilities = ["Support ended"]; }; - jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.linux.jre.openj9; knownVulnerabilities = ["Support ended"]; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.${variant}.jdk.hotspot; knownVulnerabilities = ["Support ended"]; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.${variant}.jre.hotspot; knownVulnerabilities = ["Support ended"]; }; + jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.${variant}.jdk.openj9; knownVulnerabilities = ["Support ended"]; }; + jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.${variant}.jre.openj9; knownVulnerabilities = ["Support ended"]; }; } diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk15-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk15-linux.nix index e248555a6d02..7c6d1d36021e 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk15-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk15-linux.nix @@ -1,11 +1,12 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.linux.jdk.hotspot; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.linux.jre.hotspot; }; - jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.linux.jdk.openj9; }; - jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.linux.jre.openj9; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.${variant}.jdk.hotspot; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.${variant}.jre.hotspot; }; + jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.${variant}.jdk.openj9; }; + jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.${variant}.jre.openj9; }; } diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk16-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk16-linux.nix index 794545ea80a0..3d803901d341 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk16-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk16-linux.nix @@ -1,11 +1,12 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.linux.jdk.hotspot; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.linux.jre.hotspot; }; - jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.linux.jdk.openj9; }; - jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.linux.jre.openj9; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.${variant}.jdk.hotspot; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.${variant}.jre.hotspot; }; + jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.${variant}.jdk.openj9; }; + jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.${variant}.jre.openj9; }; } diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk17-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk17-linux.nix index f162d8d29687..e069a8521d72 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk17-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk17-linux.nix @@ -1,9 +1,10 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk17.linux.jdk.hotspot; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk17.linux.jre.hotspot; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk17.${variant}.jdk.hotspot; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk17.${variant}.jre.hotspot; }; } diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk8-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk8-linux.nix index 67b50220ba2d..2b0cac664983 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk8-linux.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk8-linux.nix @@ -1,11 +1,12 @@ -{ lib }: +{ stdenv, lib }: let + variant = if stdenv.hostPlatform.isMusl then "alpine_linux" else "linux"; sources = lib.importJSON ./sources.json; in { - jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.linux.jdk.hotspot; }; - jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.linux.jre.hotspot; }; - jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.linux.jdk.openj9; }; - jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.linux.jre.openj9; }; + jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.${variant}.jdk.hotspot; }; + jre-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.${variant}.jre.hotspot; }; + jdk-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.${variant}.jdk.openj9; }; + jre-openj9 = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.${variant}.jre.openj9; }; } diff --git a/pkgs/development/compilers/temurin-bin/jdk-linux.nix b/pkgs/development/compilers/temurin-bin/jdk-linux.nix index 4c0306d5aba4..df136f8d0c16 100644 --- a/pkgs/development/compilers/temurin-bin/jdk-linux.nix +++ b/pkgs/development/compilers/temurin-bin/jdk-linux.nix @@ -1,7 +1,8 @@ -{ lib, callPackage }: +{ stdenv, lib, callPackage }: let - sources = (lib.importJSON ./sources.json).hotspot.linux; + variant = if stdenv.hostPlatform.isMusl then "alpine-linux" else "linux"; + sources = (lib.importJSON ./sources.json).hotspot.${variant}; common = opts: callPackage (import ./jdk-linux-base.nix opts) {}; in { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index da14b2debfe4..228de64830de 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13197,7 +13197,7 @@ with pkgs; semeru-bin = semeru-bin-17; semeru-jre-bin = semeru-jre-bin-17; - adoptopenjdk-bin-17-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk17-linux.nix { inherit lib; }; + adoptopenjdk-bin-17-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk17-linux.nix { inherit stdenv lib; }; adoptopenjdk-bin-17-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk17-darwin.nix { inherit lib; }; adoptopenjdk-hotspot-bin-17 = if stdenv.isLinux diff --git a/pkgs/top-level/java-packages.nix b/pkgs/top-level/java-packages.nix index ba69287fa8dc..8a419a6a0960 100644 --- a/pkgs/top-level/java-packages.nix +++ b/pkgs/top-level/java-packages.nix @@ -28,7 +28,7 @@ in { }; mkAdoptopenjdk = path-linux: path-darwin: let - package-linux = import path-linux { inherit lib; }; + package-linux = import path-linux { inherit stdenv lib; }; package-darwin = import path-darwin { inherit lib; }; package = if stdenv.isLinux then package-linux