nixpkgs/pkgs/development/web/woff2/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

43 lines
1.1 KiB
Nix

{ brotli, cmake, pkg-config, fetchFromGitHub, lib, stdenv
, static ? stdenv.hostPlatform.isStatic
}:
stdenv.mkDerivation rec {
pname = "woff2";
version = "1.0.2";
src = fetchFromGitHub {
owner = "google";
repo = "woff2";
rev = "v${version}";
sha256 = "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y";
};
outputs = [ "out" "dev" "lib" ];
# Need to explicitly link to brotlicommon
patches = stdenv.lib.optional static ./brotli-static.patch;
nativeBuildInputs = [ cmake pkg-config ];
cmakeFlags = [
"-DCANONICAL_PREFIXES=ON"
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
] ++ stdenv.lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE";
propagatedBuildInputs = [ brotli ];
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 lib; {
description = "Webfont compression reference code";
homepage = "https://github.com/google/woff2";
license = licenses.mit;
maintainers = [ maintainers.hrdinka ];
platforms = platforms.unix;
};
}