From 7ebd5999bd11a3c0be4ebdd536131c8baf6b41f9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 13 Feb 2019 00:07:13 -0500 Subject: [PATCH] brotli: add staticOnly option --- pkgs/tools/compression/brotli/default.nix | 10 ++++++++-- pkgs/top-level/static.nix | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/compression/brotli/default.nix b/pkgs/tools/compression/brotli/default.nix index 33b6f12cd46c..229c6c8b8e4e 100644 --- a/pkgs/tools/compression/brotli/default.nix +++ b/pkgs/tools/compression/brotli/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake }: +{ stdenv, fetchFromGitHub, cmake, fetchpatch, staticOnly ? false }: # ?TODO: there's also python lib in there @@ -15,7 +15,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = []; + patches = stdenv.lib.optional staticOnly (fetchpatch { + url = "https://github.com/google/brotli/pull/655/commits/7289e5a378ba13801996a84d89d8fe95c3fc4c11.patch"; + sha256 = "1bghbdvj24jrvb0sqfdif9vwg7wx6pn8dvl6flkrcjkhpj0gi0jg"; + }); + + cmakeFlags = [] + ++ stdenv.lib.optional staticOnly "-DBUILD_SHARED_LIBS=OFF"; outputs = [ "out" "dev" "lib" ]; diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index f3c524378ea9..6a311b4c9d23 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -159,6 +159,10 @@ in { }; }; + brotli = super.brotli.override { + staticOnly = true; + }; + llvmPackages_8 = super.llvmPackages_8 // { libraries = super.llvmPackages_8.libraries // rec { libcxxabi = super.llvmPackages_8.libraries.libcxxabi.override {