nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #75798 from tobim/pkgsStatic/arrow

arrow-cpp: add pkgsStatic support

authored by

Frederik Rietdijk and committed by
GitHub
960c24a9 62bfa887

+174 -75
+19 -10
pkgs/development/libraries/arrow-cpp/default.nix
··· 1 - { stdenv, fetchurl, fetchFromGitHub, fixDarwinDylibNames, autoconf, boost 1 + { stdenv, lib, fetchurl, fetchFromGitHub, fixDarwinDylibNames, autoconf, boost 2 2 , brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl 3 - , python, rapidjson, snappy, thrift, uriparser, which, zlib, zstd }: 3 + , python, rapidjson, snappy, thrift, uriparser, which, zlib, zstd 4 + , enableShared ? true }: 4 5 5 6 let 6 7 parquet-testing = fetchFromGitHub { ··· 35 34 patches = [ 36 35 # patch to fix python-test 37 36 ./darwin.patch 37 + ] ++ lib.optionals (!enableShared) [ 38 + # The shared jemalloc lib is unused and breaks in static mode due to missing -fpic. 39 + ./jemalloc-disable-shared.patch 38 40 ]; 39 41 40 42 nativeBuildInputs = [ 41 43 cmake 42 44 autoconf # for vendored jemalloc 43 45 flatbuffers 44 - ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; 46 + ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 45 47 buildInputs = [ 46 48 boost 47 49 brotli ··· 75 71 "-DARROW_DEPENDENCY_SOURCE=SYSTEM" 76 72 "-DARROW_PARQUET=ON" 77 73 "-DARROW_PLASMA=ON" 78 - "-DARROW_PYTHON=ON" 74 + # Disable Python for static mode because openblas is currently broken there. 75 + "-DARROW_PYTHON=${if enableShared then "ON" else "OFF"}" 79 76 "-Duriparser_SOURCE=SYSTEM" 80 - ] ++ stdenv.lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF"; 77 + ] ++ lib.optionals (!enableShared) [ 78 + "-DARROW_BUILD_SHARED=OFF" 79 + "-DARROW_TEST_LINKAGE=static" 80 + "-DOPENSSL_USE_STATIC_LIBS=ON" 81 + ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF"; 81 82 82 83 doInstallCheck = true; 83 84 PARQUET_TEST_DATA = 84 85 if doInstallCheck then "${parquet-testing}/data" else null; 85 86 installCheckInputs = [ perl which ]; 86 - installCheckPhase = (stdenv.lib.optionalString stdenv.isDarwin '' 87 + installCheckPhase = (lib.optionalString stdenv.isDarwin '' 87 88 for f in release/*test{,s}; do 88 89 install_name_tool -add_rpath "$out"/lib "$f" 89 90 done 90 91 '') 91 92 + (let 92 - excludedTests = stdenv.lib.optionals stdenv.isDarwin [ 93 + excludedTests = lib.optionals stdenv.isDarwin [ 93 94 # Some plasma tests need to be patched to use a shorter AF_UNIX socket 94 95 # path on Darwin. See https://github.com/NixOS/nix/pull/1085 95 96 "plasma-external-store-tests" ··· 108 99 meta = { 109 100 description = "A cross-language development platform for in-memory data"; 110 101 homepage = "https://arrow.apache.org/"; 111 - license = stdenv.lib.licenses.asl20; 112 - platforms = stdenv.lib.platforms.unix; 113 - maintainers = with stdenv.lib.maintainers; [ tobim veprbl ]; 102 + license = lib.licenses.asl20; 103 + platforms = lib.platforms.unix; 104 + maintainers = with lib.maintainers; [ tobim veprbl ]; 114 105 }; 115 106 }
+11
pkgs/development/libraries/arrow-cpp/jemalloc-disable-shared.patch
··· 1 + diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake 2 + --- a/cmake_modules/ThirdpartyToolchain.cmake 3 + +++ b/cmake_modules/ThirdpartyToolchain.cmake 4 + @@ -1428,6 +1428,7 @@ if(ARROW_JEMALLOC) 5 + "--with-jemalloc-prefix=je_arrow_" 6 + "--with-private-namespace=je_arrow_private_" 7 + "--without-export" 8 + + "--disable-shared" 9 + # Don't override operator new() 10 + "--disable-cxx" "--disable-libdl" 11 + # See https://github.com/jemalloc/jemalloc/issues/1237
+3 -3
pkgs/development/libraries/double-conversion/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, cmake }: 1 + { stdenv, lib, fetchFromGitHub, cmake, static ? false }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "double-conversion"; ··· 13 13 14 14 nativeBuildInputs = [ cmake ]; 15 15 16 - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; 16 + cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ]; 17 17 18 18 # Case sensitivity issue 19 19 preConfigure = lib.optionalString stdenv.isDarwin '' ··· 24 24 25 25 meta = with stdenv.lib; { 26 26 description = "Binary-decimal and decimal-binary routines for IEEE doubles"; 27 - homepage = https://github.com/google/double-conversion; 27 + homepage = "https://github.com/google/double-conversion"; 28 28 license = licenses.bsd3; 29 29 platforms = platforms.unix; 30 30 maintainers = with maintainers; [ abbradar ];
+3 -3
pkgs/development/libraries/gflags/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake }: 1 + { stdenv, fetchFromGitHub, cmake, enableShared ? true}: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "gflags"; ··· 17 17 preConfigure = "rm BUILD"; 18 18 19 19 cmakeFlags = [ 20 - "-DBUILD_SHARED_LIBS=ON" 21 - "-DBUILD_STATIC_LIBS=ON" 20 + "-DGFLAGS_BUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" 21 + "-DGFLAGS_BUILD_STATIC_LIBS=ON" 22 22 ]; 23 23 24 24 doCheck = false;
+5 -3
pkgs/development/libraries/glog/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, perl }: 1 + { stdenv, lib, fetchFromGitHub, fetchpatch, cmake, perl, static ? false }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "glog"; ··· 20 20 }) 21 21 ]; 22 22 23 - nativeBuildInputs = [ autoreconfHook ]; 23 + nativeBuildInputs = [ cmake ]; 24 + 25 + cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ]; 24 26 25 27 checkInputs = [ perl ]; 26 28 doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm" 27 29 28 30 meta = with stdenv.lib; { 29 - homepage = https://github.com/google/glog; 31 + homepage = "https://github.com/google/glog"; 30 32 license = licenses.bsd3; 31 33 description = "Library for application-level logging"; 32 34 platforms = platforms.unix;
+3
pkgs/development/libraries/science/math/openblas/default.nix
··· 115 115 nativeBuildInputs = [ 116 116 perl 117 117 which 118 + ]; 119 + 120 + depsBuildBuild = [ 118 121 buildPackages.gfortran 119 122 buildPackages.stdenv.cc 120 123 ];
+6 -3
pkgs/development/libraries/snappy/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake }: 1 + { stdenv, fetchFromGitHub, cmake, static ? false }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "snappy"; ··· 17 17 18 18 nativeBuildInputs = [ cmake ]; 19 19 20 - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ]; 20 + cmakeFlags = [ 21 + "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" 22 + "-DCMAKE_SKIP_BUILD_RPATH=OFF" 23 + ]; 21 24 22 25 postInstall = '' 23 26 substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \ ··· 32 29 doCheck = true; 33 30 34 31 meta = with stdenv.lib; { 35 - homepage = https://google.github.io/snappy/; 32 + homepage = "https://google.github.io/snappy/"; 36 33 license = licenses.bsd3; 37 34 description = "Compression/decompression library for very high speeds"; 38 35 platforms = platforms.all;
+22 -14
pkgs/development/libraries/thrift/default.nix
··· 1 - { stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkgconfig, bison 2 - , flex, twisted 3 - }: 1 + { stdenv, fetchurl, boost, zlib, libevent, openssl, python, cmake, pkgconfig 2 + , bison, flex, twisted, static ? false }: 4 3 5 4 stdenv.mkDerivation rec { 6 5 pname = "thrift"; ··· 10 11 sha256 = "0yai9c3bdsrkkjshgim7zk0i7malwfprg00l9774dbrkh2w4ilvs"; 11 12 }; 12 13 13 - #enableParallelBuilding = true; problems on hydra 14 - 15 14 # Workaround to make the python wrapper not drop this package: 16 15 # pythonFull.buildEnv.override { extraLibs = [ thrift ]; } 17 16 pythonPath = []; 18 17 19 - nativeBuildInputs = [ pkgconfig ]; 20 - buildInputs = [ 21 - boost zlib libevent openssl python bison flex twisted 22 - ]; 18 + nativeBuildInputs = [ cmake pkgconfig ]; 19 + buildInputs = [ boost zlib libevent openssl python bison flex ] 20 + ++ stdenv.lib.optional (!static) twisted; 23 21 24 22 preConfigure = "export PY_PREFIX=$out"; 25 23 26 - # TODO: package boost-test, so we can run the test suite. (Currently it fails 27 - # to find libboost_unit_test_framework.a.) 28 - configureFlags = [ "--enable-tests=no" ]; 29 - doCheck = false; 24 + cmakeFlags = [ 25 + # FIXME: Fails to link in static mode with undefined reference to 26 + # `boost::unit_test::unit_test_main(bool (*)(), int, char**)' 27 + "-DBUILD_TESTING:BOOL=${if static then "OFF" else "ON"}" 28 + ] ++ stdenv.lib.optionals static [ 29 + "-DWITH_STATIC_LIB:BOOL=ON" 30 + "-DOPENSSL_USE_STATIC_LIBS=ON" 31 + ]; 32 + 33 + doCheck = !static; 34 + checkPhase = '' 35 + runHook preCheck 36 + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib ctest -E PythonTestSSLSocket 37 + runHook postCheck 38 + ''; 39 + enableParallelChecking = false; 30 40 31 41 meta = with stdenv.lib; { 32 42 description = "Library for scalable cross-language services"; 33 - homepage = http://thrift.apache.org/; 43 + homepage = "http://thrift.apache.org/"; 34 44 license = licenses.asl20; 35 45 platforms = platforms.linux ++ platforms.darwin; 36 46 maintainers = [ maintainers.bjornfor ];
+36
pkgs/development/web/woff2/brotli-static.patch
··· 1 + diff a/cmake/FindBrotliDec.cmake b/cmake/FindBrotliDec.cmake 2 + --- a/cmake/FindBrotliDec.cmake 3 + +++ b/cmake/FindBrotliDec.cmake 4 + @@ -18,10 +18,10 @@ find_path(BROTLIDEC_INCLUDE_DIRS 5 + HINTS ${PC_BROTLIDEC_INCLUDEDIR} 6 + ) 7 + 8 + -find_library(BROTLIDEC_LIBRARIES 9 + - NAMES brotlidec 10 + - HINTS ${PC_BROTLIDEC_LIBDIR} 11 + -) 12 + +if(NOT BUILD_SHARED_LIBS) 13 + + set(_S "STATIC_") 14 + +endif() 15 + +set(BROTLIDEC_LIBRARIES ${PC_BROTLIDEC_${_S}LIBRARIES}) 16 + 17 + include(FindPackageHandleStandardArgs) 18 + find_package_handle_standard_args(BrotliDec 19 + diff a/cmake/FindBrotliEnc.cmake b/cmake/FindBrotliEnc.cmake 20 + --- a/cmake/FindBrotliEnc.cmake 21 + +++ b/cmake/FindBrotliEnc.cmake 22 + @@ -18,10 +18,10 @@ find_path(BROTLIENC_INCLUDE_DIRS 23 + HINTS ${PC_BROTLIENC_INCLUDEDIR} 24 + ) 25 + 26 + -find_library(BROTLIENC_LIBRARIES 27 + - NAMES brotlienc 28 + - HINTS ${PC_BROTLIENC_LIBDIR} 29 + -) 30 + +if(NOT BUILD_SHARED_LIBS) 31 + + set(_S "STATIC_") 32 + +endif() 33 + +set(BROTLIENC_LIBRARIES ${PC_BROTLIENC_${_S}LIBRARIES}) 34 + 35 + include(FindPackageHandleStandardArgs) 36 + find_package_handle_standard_args(BrotliEnc
+11 -5
pkgs/development/web/woff2/default.nix
··· 1 - { brotli, cmake, fetchFromGitHub, stdenv }: 1 + { brotli, cmake, pkgconfig, fetchFromGitHub, stdenv, static ? false }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "woff2"; ··· 13 13 14 14 outputs = [ "out" "dev" "lib" ]; 15 15 16 - nativeBuildInputs = [ cmake ]; 16 + # Need to explicitly link to brotlicommon 17 + patches = stdenv.lib.optional static ./brotli-static.patch; 18 + 19 + nativeBuildInputs = [ cmake pkgconfig ]; 20 + 21 + cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ] 22 + ++ stdenv.lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE"; 17 23 18 24 propagatedBuildInputs = [ brotli ]; 19 25 20 - # without this binaries only get built if shared libs are disable 21 - patchPhase = '' 26 + postPatch = '' 27 + # without this binaries only get built if shared libs are disable 22 28 sed 's@^if (NOT BUILD_SHARED_LIBS)$@if (TRUE)@g' -i CMakeLists.txt 23 29 ''; 24 30 25 31 meta = with stdenv.lib; { 26 32 description = "Webfont compression reference code"; 27 - homepage = https://github.com/google/woff2; 33 + homepage = "https://github.com/google/woff2"; 28 34 license = licenses.mit; 29 35 maintainers = [ maintainers.hrdinka ]; 30 36 platforms = platforms.unix;
+21 -30
pkgs/tools/compression/zstd/default.nix
··· 1 - { stdenv, fetchFromGitHub, fetchpatch, gnugrep 1 + { stdenv, fetchFromGitHub, fetchpatch, cmake, gnugrep 2 2 , fixDarwinDylibNames 3 3 , file 4 - , legacySupport ? false }: 4 + , legacySupport ? false 5 + , enableShared ? true }: 5 6 6 7 stdenv.mkDerivation rec { 7 8 pname = "zstd"; ··· 15 14 owner = "facebook"; 16 15 }; 17 16 17 + nativeBuildInputs = [ cmake ] 18 + ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; 19 + 18 20 patches = [ 19 - # All 3 from https://github.com/facebook/zstd/pull/1883 21 + # From https://github.com/facebook/zstd/pull/1883 20 22 (fetchpatch { 21 23 url = "https://github.com/facebook/zstd/commit/106278e7e5fafaea3b7deb4147bdc8071562d2f0.diff"; 22 24 sha256 = "13z7id1qbc05cv1rmak7c8xrchp7jh1i623bq5pwcihg57wzcyr8"; 23 - }) 24 - (fetchpatch { 25 - url = "https://github.com/facebook/zstd/commit/0ede342acc2c26f87ae962fa88e158904d4198c4.diff"; 26 - sha256 = "12l5xbvnzkvr76mvl1ls767paqfwbd9q1pzq44ckacfpz4f6iaap"; 27 - excludes = [ 28 - # I think line endings are causing problems, or something like that 29 - "programs/windres/generate_res.bat" 30 - ]; 31 - }) 32 - (fetchpatch { 33 - url = "https://github.com/facebook/zstd/commit/10552eaffef84c011f67af0e04f0780b50a5ab26.diff"; 34 - sha256 = "1s27ravar3rn7q8abybp9733jhpsfcaci51k04da94ahahvxwiqw"; 35 25 }) 36 26 ] # This I didn't upstream because if you use posix threads with MinGW it will 37 27 # work find, and I'm not sure how to write the condition. 38 28 ++ stdenv.lib.optional stdenv.hostPlatform.isWindows ./mcfgthreads-no-pthread.patch; 39 29 40 - nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; 41 - 42 - makeFlags = [ 43 - "ZSTD_LEGACY_SUPPORT=${if legacySupport then "1" else "0"}" 44 - ] ++ stdenv.lib.optional stdenv.hostPlatform.isWindows "OS=Windows"; 30 + cmakeFlags = [ 31 + "-DZSTD_BUILD_SHARED:BOOL=${if enableShared then "ON" else "OFF"}" 32 + "-DZSTD_LEGACY_SUPPORT:BOOL=${if legacySupport then "ON" else "OFF"}" 33 + "-DZSTD_BUILD_TESTS:BOOL=ON" 34 + ]; 35 + cmakeDir = "../build/cmake"; 36 + dontUseCmakeBuildDir = true; 37 + preConfigure = '' 38 + mkdir -p build_ && cd $_ 39 + ''; 45 40 46 41 checkInputs = [ file ]; 47 42 doCheck = true; 48 43 preCheck = '' 49 - substituteInPlace tests/playTests.sh \ 44 + substituteInPlace ../tests/playTests.sh \ 50 45 --replace 'MD5SUM="md5 -r"' 'MD5SUM="md5sum"' 51 46 ''; 52 47 53 - installFlags = [ 54 - "PREFIX=$(out)" 55 - ]; 56 - 57 - preInstall = '' 58 - substituteInPlace programs/zstdgrep \ 48 + preInstall = stdenv.lib.optionalString enableShared '' 49 + substituteInPlace ../programs/zstdgrep \ 59 50 --replace ":-grep" ":-${gnugrep}/bin/grep" \ 60 51 --replace ":-zstdcat" ":-$out/bin/zstdcat" 61 52 62 - substituteInPlace programs/zstdless \ 53 + substituteInPlace ../programs/zstdless \ 63 54 --replace "zstdcat" "$out/bin/zstdcat" 64 55 ''; 65 - 66 - enableParallelBuilding = true; 67 56 68 57 meta = with stdenv.lib; { 69 58 description = "Zstandard real-time compression algorithm";
+34 -4
pkgs/top-level/static.nix
··· 55 55 removeUnknownConfigureFlags = f: with self.lib; 56 56 remove "--disable-shared" 57 57 (remove "--enable-static" f); 58 - 58 + 59 59 ocamlFixPackage = b: 60 60 b.overrideAttrs (o: { 61 61 configurePlatforms = [ ]; ··· 63 63 buildInputs = o.buildInputs ++ o.nativeBuildInputs or [ ]; 64 64 propagatedNativeBuildInputs = o.propagatedBuildInputs or [ ]; 65 65 }); 66 - 66 + 67 67 ocamlStaticAdapter = _: super: 68 68 self.lib.mapAttrs 69 69 (_: p: if p ? overrideAttrs then ocamlFixPackage p else p) ··· 162 162 # --disable-shared flag 163 163 stdenv = super.stdenv; 164 164 }; 165 + arrow-cpp = super.arrow-cpp.override { 166 + enableShared = false; 167 + python = { pkgs = { python = null; numpy = null; }; }; 168 + }; 165 169 boost = super.boost.override { 166 170 enableStatic = true; 167 171 enableShared = false; ··· 174 170 # --disable-shared flag 175 171 stdenv = super.stdenv; 176 172 }; 173 + thrift = super.thrift.override { 174 + static = true; 175 + twisted = null; 176 + }; 177 + double-conversion = super.double-conversion.override { 178 + static = true; 179 + }; 177 180 gmp = super.gmp.override { 178 181 withStatic = true; 182 + }; 183 + gflags = super.gflags.override { 184 + enableShared = false; 185 + }; 186 + glog = super.glog.override { 187 + static = true; 188 + }; 189 + gtest = super.gtest.override { 190 + static = true; 179 191 }; 180 192 cdo = super.cdo.override { 181 193 enable_all_static = true; ··· 211 191 # it doesn’t like the --disable-shared flag 212 192 stdenv = super.stdenv; 213 193 }; 194 + woff2 = super.woff2.override { 195 + static = true; 196 + }; 197 + snappy = super.snappy.override { 198 + static = true; 199 + }; 214 200 lz4 = super.lz4.override { 215 201 enableShared = false; 216 202 enableStatic = true; ··· 235 209 kmod = super.kmod.override { 236 210 withStatic = true; 237 211 }; 238 - 212 + 239 213 curl = super.curl.override { 240 214 # a very sad story: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039 241 215 gssSupport = false; ··· 247 221 248 222 brotli = super.brotli.override { 249 223 staticOnly = true; 224 + }; 225 + 226 + zstd = super.zstd.override { 227 + enableShared = false; 250 228 }; 251 229 252 230 llvmPackages_8 = super.llvmPackages_8 // { ··· 271 241 ocaml-ng = self.lib.mapAttrs (_: set: 272 242 if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set 273 243 ) super.ocaml-ng; 274 - 244 + 275 245 python27 = super.python27.override { static = true; }; 276 246 }