From a244885c63adf4d0c21702cd6a370dc656b9f353 Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Mon, 16 Dec 2019 13:16:38 +0100 Subject: [PATCH] snappy: add pkgsStatic support --- pkgs/development/libraries/snappy/default.nix | 9 ++++++--- pkgs/top-level/static.nix | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/snappy/default.nix b/pkgs/development/libraries/snappy/default.nix index f35f5bfc55a2..0ad1a4b28987 100644 --- a/pkgs/development/libraries/snappy/default.nix +++ b/pkgs/development/libraries/snappy/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake }: +{ stdenv, fetchFromGitHub, cmake, static ? false }: stdenv.mkDerivation rec { pname = "snappy"; @@ -17,7 +17,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" + "-DCMAKE_SKIP_BUILD_RPATH=OFF" + ]; postInstall = '' substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \ @@ -29,7 +32,7 @@ stdenv.mkDerivation rec { doCheck = true; meta = with stdenv.lib; { - homepage = https://google.github.io/snappy/; + homepage = "https://google.github.io/snappy/"; license = licenses.bsd3; description = "Compression/decompression library for very high speeds"; platforms = platforms.all; diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 1d3c4af50430..c75e5127534f 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -206,6 +206,9 @@ in { woff2 = super.woff2.override { static = true; }; + snappy = super.snappy.override { + static = true; + }; lz4 = super.lz4.override { enableShared = false; enableStatic = true;