about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/harfbuzz
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/harfbuzz
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/harfbuzz')
-rw-r--r--nixpkgs/pkgs/development/libraries/harfbuzz/default.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
new file mode 100644
index 000000000000..7a7624c96753
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
@@ -0,0 +1,71 @@
+{ stdenv, fetchurl, pkgconfig, glib, freetype, cairo, libintl
+, icu, graphite2, harfbuzz # The icu variant uses and propagates the non-icu one.
+, ApplicationServices, CoreText
+, withCoreText ? false
+, withIcu ? false # recommended by upstream as default, but most don't needed and it's big
+, withGraphite2 ? true # it is small and major distros do include it
+, python
+}:
+
+let
+  version = "2.1.0";
+  inherit (stdenv.lib) optional optionals optionalString;
+in
+
+stdenv.mkDerivation {
+  name = "harfbuzz${optionalString withIcu "-icu"}-${version}";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.bz2";
+    sha256 = "1y8jzm76wj8pcj3z47fikhasipyizd6w9r20yc7p139jqxp4jnwf";
+  };
+
+  postPatch = ''
+    patchShebangs src/gen-def.py
+    patchShebangs test
+  '';
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  configureFlags = [
+    # not auto-detected by default
+    "--with-graphite2=${if withGraphite2 then "yes" else "no"}"
+    "--with-icu=${if withIcu then "yes" else "no"}"
+  ]
+    ++ stdenv.lib.optional withCoreText "--with-coretext=yes";
+
+  nativeBuildInputs = [ pkgconfig libintl ];
+
+  buildInputs = [ glib freetype cairo ] # recommended by upstream
+    ++ stdenv.lib.optionals withCoreText [ ApplicationServices CoreText ];
+
+  propagatedBuildInputs = []
+    ++ optional withGraphite2 graphite2
+    ++ optionals withIcu [ icu harfbuzz ];
+
+  checkInputs = [ python ];
+  doInstallCheck = false; # fails, probably a bug
+
+  # Slightly hacky; some pkgs expect them in a single directory.
+  postInstall = optionalString withIcu ''
+    rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc"
+    ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la
+    ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc
+    ${optionalString stdenv.isDarwin ''
+      ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.dylib
+      ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib
+    ''}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An OpenType text shaping engine";
+    homepage = http://www.freedesktop.org/wiki/Software/HarfBuzz;
+    downloadPage = "https://www.freedesktop.org/software/harfbuzz/release/";
+    maintainers = [ maintainers.eelco ];
+    license = licenses.mit;
+    platforms = with platforms; linux ++ darwin;
+    inherit version;
+    updateWalker = true;
+  };
+}