diff --git a/pkgs/development/libraries/double-conversion/default.nix b/pkgs/development/libraries/double-conversion/default.nix index 4d8f623b36a4..ecd5ee67cf64 100644 --- a/pkgs/development/libraries/double-conversion/default.nix +++ b/pkgs/development/libraries/double-conversion/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, cmake, static ? false }: +{ stdenv, lib, fetchFromGitHub, cmake }: stdenv.mkDerivation rec { pname = "double-conversion"; @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ]; + cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; # Case sensitivity issue preConfigure = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix index fd35b697d7c2..3e79ebe15cff 100644 --- a/pkgs/development/libraries/fmt/default.nix +++ b/pkgs/development/libraries/fmt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake, enableShared ? true }: +{ stdenv, fetchFromGitHub, cmake }: stdenv.mkDerivation rec { version = "6.0.0"; @@ -17,16 +17,16 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DFMT_TEST=TRUE" - "-DBUILD_SHARED_LIBS=${if enableShared then "TRUE" else "FALSE"}" + "-DBUILD_SHARED_LIBS=TRUE" ]; enableParallelBuilding = true; doCheck = true; # preCheckHook ensures the test binaries can find libfmt.so - preCheck = if enableShared - then "export LD_LIBRARY_PATH=\"$PWD\"" - else ""; + preCheck = '' + export LD_LIBRARY_PATH="$PWD" + ''; meta = with stdenv.lib; { description = "Small, safe and fast formatting library"; diff --git a/pkgs/development/libraries/glog/default.nix b/pkgs/development/libraries/glog/default.nix index 7809dc088427..04846c3ab427 100644 --- a/pkgs/development/libraries/glog/default.nix +++ b/pkgs/development/libraries/glog/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, perl, static ? false }: +{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, perl }: stdenv.mkDerivation rec { pname = "glog"; @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ]; + cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; checkInputs = [ perl ]; doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm" diff --git a/pkgs/development/libraries/gtest/default.nix b/pkgs/development/libraries/gtest/default.nix index 4326be597246..bbc582f581c3 100644 --- a/pkgs/development/libraries/gtest/default.nix +++ b/pkgs/development/libraries/gtest/default.nix @@ -1,5 +1,4 @@ -{ stdenv, cmake, ninja, fetchFromGitHub -, static ? false }: +{ stdenv, cmake, ninja, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "gtest"; @@ -20,7 +19,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja ]; - cmakeFlags = stdenv.lib.optional (!static) "-DBUILD_SHARED_LIBS=ON"; + cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; meta = with stdenv.lib; { description = "Google's framework for writing C++ tests"; diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 041964bcacc2..8b23d3dadd2c 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -60,6 +60,7 @@ rec { "--enable-static" "--disable-shared" ]; + cmakeFlags = (args.cmakeFlags or []) ++ [ "-DBUILD_SHARED_LIBS:BOOL=OFF" ]; mesonFlags = (args.mesonFlags or []) ++ [ "-Ddefault_library=static" ]; }); }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2d14e15261aa..3a92f608c833 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10792,7 +10792,7 @@ in arrayfire = callPackage ../development/libraries/arrayfire {}; arrow-cpp = callPackage ../development/libraries/arrow-cpp ({ - gtest = gtest.override { static = true; }; + inherit (pkgsStatic) gtest; } // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = overrideCC stdenv buildPackages.gcc6; # hidden symbol `__divmoddi4' }); diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 40673426136a..90a097ff3a06 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -185,21 +185,12 @@ in { static = true; twisted = null; }; - double-conversion = super.double-conversion.override { - static = true; - }; gmp = super.gmp.override { withStatic = true; }; gflags = super.gflags.override { enableShared = false; }; - glog = super.glog.override { - static = true; - }; - gtest = super.gtest.override { - static = true; - }; cdo = super.cdo.override { enable_all_static = true; };