From 799d7434e2a49407b6506cecb21d3f1fd3d3ae4c Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Wed, 23 Feb 2022 22:53:31 -0500 Subject: [PATCH] hadoop: link native libraries on Darwin even though they're not used to simplify expression --- .../networking/cluster/hadoop/default.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 1a0a6dafec46..901987d08769 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -22,7 +22,7 @@ with lib; assert elem stdenv.system [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; let - common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl, nativeLibs ? [ ], libPatches ? "" }: + common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "" }: let platformUrlSuffix = optionalString stdenv.isAarch64 "-aarch64"; in @@ -89,6 +89,7 @@ in aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; aarch64-darwin = aarch64-linux; }; + inherit openssl; nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; libPatches = '' @@ -97,13 +98,8 @@ in ln -s ${getLib zlib}/lib/libz.so.1 $out/lib/${untarDir}/lib/native/ ln -s ${getLib zstd}/lib/libzstd.so.1 $out/lib/${untarDir}/lib/native/ ln -s ${getLib bzip2}/lib/libbz2.so.1 $out/lib/${untarDir}/lib/native/ - patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0 - ''; + '' + optionalString stdenv.isLinux "patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0"; jdk = jdk11_headless; - } // optionalAttrs stdenv.isDarwin { - openssl = null; - nativeLibs = [ ]; - libPatches = ""; }); hadoop_3_2 = common rec { pname = "hadoop"; @@ -114,7 +110,6 @@ in jdk = jdk8_headless; # not using native libs because of broken openssl_1_0_2 dependency # can be manually overriden - openssl = null; }; hadoop2 = common rec { pname = "hadoop"; @@ -123,6 +118,5 @@ in x86_64-linux = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97"; }; jdk = jdk8_headless; - openssl = null; }; }