summary refs log tree commit diff
path: root/pkgs/development/web/woff2/default.nix
diff options
context:
space:
mode:
authorTobias Mayer <tobim@fastmail.fm>2019-12-16 13:12:48 +0100
committerTobias Mayer <tobim@fastmail.fm>2019-12-29 23:30:21 +0100
commit0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5 (patch)
treec12da38cd71abd6860506fc0b2a939b0035f0e31 /pkgs/development/web/woff2/default.nix
parent812ccd8e4c2d8b9bfe87e20251435140676b6b6b (diff)
downloadnixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.tar
nixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.tar.gz
nixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.tar.bz2
nixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.tar.lz
nixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.tar.xz
nixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.tar.zst
nixpkgs-0aeacdeaae6fc6f7d0d6af71ef6a5af2661e9fd5.zip
woff2: add pkgsStatic support
Diffstat (limited to 'pkgs/development/web/woff2/default.nix')
-rw-r--r--pkgs/development/web/woff2/default.nix16
1 files changed, 11 insertions, 5 deletions
diff --git a/pkgs/development/web/woff2/default.nix b/pkgs/development/web/woff2/default.nix
index b77184e5652..ff0484547fc 100644
--- a/pkgs/development/web/woff2/default.nix
+++ b/pkgs/development/web/woff2/default.nix
@@ -1,4 +1,4 @@
-{ brotli, cmake, fetchFromGitHub, stdenv }:
+{ brotli, cmake, pkgconfig, fetchFromGitHub, stdenv, static ? false }:
 
 stdenv.mkDerivation rec {
   pname = "woff2";
@@ -13,18 +13,24 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "lib" ];
 
-  nativeBuildInputs = [ cmake ];
+  # Need to explicitly link to brotlicommon
+  patches = stdenv.lib.optional static ./brotli-static.patch;
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ]
+    ++ stdenv.lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE";
 
   propagatedBuildInputs = [ brotli ];
 
-  # without this binaries only get built if shared libs are disable
-  patchPhase = ''
+  postPatch = ''
+    # without this binaries only get built if shared libs are disable
     sed 's@^if (NOT BUILD_SHARED_LIBS)$@if (TRUE)@g' -i CMakeLists.txt
   '';
 
   meta = with stdenv.lib; {
     description = "Webfont compression reference code";
-    homepage = https://github.com/google/woff2;
+    homepage = "https://github.com/google/woff2";
     license = licenses.mit;
     maintainers = [ maintainers.hrdinka ];
     platforms = platforms.unix;