about summary refs log tree commit diff
path: root/pkgs/development/libraries/freetype/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/freetype/default.nix')
-rw-r--r--pkgs/development/libraries/freetype/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index cd7ac64da150..3fccce02def4 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, fetchurl, copyPathsToStore
 , hostPlatform
-, pkgconfig, which
+, pkgconfig, which, makeWrapper
 , zlib, bzip2, libpng, gnumake, glib
 
 , # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering).
@@ -38,7 +38,7 @@ in stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
   # dependence on harfbuzz is looser than the reverse dependence
-  nativeBuildInputs = [ pkgconfig which ]
+  nativeBuildInputs = [ pkgconfig which makeWrapper ]
     # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
     ++ optional (!stdenv.isLinux) gnumake;
 
@@ -58,7 +58,10 @@ in stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  postInstall = glib.flattenInclude;
+  postInstall = glib.flattenInclude + ''
+    wrapProgram "$dev/bin/freetype-config" \
+      --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig"
+  '';
 
   crossAttrs = stdenv.lib.optionalAttrs (hostPlatform.libc or null != "msvcrt") {
     # Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead