about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/hadoop
diff options
context:
space:
mode:
authorillustris <rharikrishnan95@gmail.com>2022-07-14 07:26:13 +0530
committerpennae <82953136+pennae@users.noreply.github.com>2022-08-07 21:21:45 +0200
commit2e7c1a9f23f70fd878a4d0be2f0d06f91c743b0c (patch)
tree48b8b7cb8aeffb2cd309451f7a4ab08c2481ce07 /pkgs/applications/networking/cluster/hadoop
parent3e212a42d783230ec87e70dc1ca59fc0a5bb4630 (diff)
hadoop: combine per-platforms into one attrset
Diffstat (limited to 'pkgs/applications/networking/cluster/hadoop')
-rw-r--r--pkgs/applications/networking/cluster/hadoop/default.nix49
1 files changed, 27 insertions, 22 deletions
diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix
index 11974b6db1a6b..1d9b10bfc39b3 100644
--- a/pkgs/applications/networking/cluster/hadoop/default.nix
+++ b/pkgs/applications/networking/cluster/hadoop/default.nix
@@ -26,13 +26,13 @@ with lib;
 assert elem stdenv.system [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
 
 let
-  common = { pname, versions, untarDir ? "${pname}-${version}", hash, jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "", tests }:
+  common = { pname, platformAttrs, untarDir ? "${pname}-${version}", jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "", tests }:
     stdenv.mkDerivation rec {
       inherit pname jdk libPatches untarDir openssl;
-      version = versions.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
+      version = platformAttrs.${stdenv.system}.version or (throw "Unsupported system: ${stdenv.system}");
       src = fetchurl {
         url = "mirror://apache/hadoop/common/hadoop-${version}/hadoop-${version}" + optionalString stdenv.isAarch64 "-aarch64" + ".tar.gz";
-        hash = hash.${stdenv.system};
+        inherit (platformAttrs.${stdenv.system}) hash;
       };
       doCheck = true;
 
@@ -63,7 +63,7 @@ let
 
       passthru = { inherit tests; };
 
-      meta = {
+      meta = recursiveUpdate {
         homepage = "https://hadoop.apache.org/";
         description = "Framework for distributed processing of large data sets across clusters of computers";
         license = licenses.asl20;
@@ -81,8 +81,8 @@ let
           computers, each of which may be prone to failures.
         '';
         maintainers = with maintainers; [ illustris ];
-        platforms = attrNames hash;
-      };
+        platforms = attrNames platformAttrs;
+      } (attrByPath [ stdenv.system "meta" ] {} platformAttrs);
     };
 in
 {
@@ -90,19 +90,20 @@ in
   # https://cwiki.apache.org/confluence/display/HADOOP/Hadoop+Java+Versions
   hadoop_3_3 = common rec {
     pname = "hadoop";
-    versions = rec {
-      x86_64-linux = "3.3.3";
-      x86_64-darwin = x86_64-linux;
-      aarch64-linux = "3.3.1";
-      aarch64-darwin = aarch64-linux;
-    };
-    untarDir = "${pname}-${version}";
-    hash = rec {
-      x86_64-linux = "sha256-+nHGG7qkJxKa7wn+wCizTdVCxlrZD9zOxefvk9g7h2Q=";
-      x86_64-darwin = x86_64-linux;
-      aarch64-linux = "sha256-v1Om2pk0wsgKBghRD2wgTSHJoKd3jkm1wPKAeDcKlgI=";
-      aarch64-darwin = aarch64-linux;
+    platformAttrs = rec {
+        x86_64-linux = {
+          version = "3.3.3";
+          hash = "sha256-+nHGG7qkJxKa7wn+wCizTdVCxlrZD9zOxefvk9g7h2Q=";
+        };
+        x86_64-darwin = x86_64-linux;
+        aarch64-linux = {
+          version = "3.3.1";
+          hash = "sha256-v1Om2pk0wsgKBghRD2wgTSHJoKd3jkm1wPKAeDcKlgI=";
+          meta.knownVulnerabilities = [ "CVE-2021-37404" "CVE-2021-33036" ];
+        };
+        aarch64-darwin = aarch64-linux;
     };
+    untarDir = "${pname}-${platformAttrs.${stdenv.system}.version}";
     jdk = jdk11_headless;
     inherit openssl;
     # TODO: Package and add Intel Storage Acceleration Library
@@ -123,8 +124,10 @@ in
   };
   hadoop_3_2 = common rec {
     pname = "hadoop";
-    versions.x86_64-linux = "3.2.3";
-    hash.x86_64-linux = "sha256-Q2/a1LcKutpJoGySB0qlCcYE2bvC/HoG/dp9nBikuNU=";
+    platformAttrs.x86_64-linux = {
+      version = "3.2.3";
+      hash = "sha256-Q2/a1LcKutpJoGySB0qlCcYE2bvC/HoG/dp9nBikuNU=";
+    };
     jdk = jdk8_headless;
     # not using native libs because of broken openssl_1_0_2 dependency
     # can be manually overriden
@@ -132,8 +135,10 @@ in
   };
   hadoop2 = common rec {
     pname = "hadoop";
-    versions.x86_64-linux = "2.10.2";
-    hash.x86_64-linux = "sha256-xhA4zxqIRGNhIeBnJO9dLKf/gx/Bq+uIyyZwsIafEyo=";
+    platformAttrs.x86_64-linux = {
+      version = "2.10.2";
+      hash = "sha256-xhA4zxqIRGNhIeBnJO9dLKf/gx/Bq+uIyyZwsIafEyo=";
+    };
     jdk = jdk8_headless;
     tests = nixosTests.hadoop2;
   };