mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 21:50:55 +00:00
Merge pull request #76659 from veprbl/pr/cmake_static_adapter
pkgsStatic: set BUILD_SHARED_LIBS=OFF for cmake
This commit is contained in:
commit
f4b4ef130a
|
@ -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 ''
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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" ];
|
||||
});
|
||||
};
|
||||
|
|
|
@ -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'
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue