2013-11-24 12:51:12 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, freetype, cairo, libintlOrEmpty
|
2015-10-05 18:26:54 +01:00
|
|
|
, icu, graphite2, harfbuzz # The icu variant uses and propagates the non-icu one.
|
2013-11-24 12:51:12 +00:00
|
|
|
, withIcu ? false # recommended by upstream as default, but most don't needed and it's big
|
2014-06-01 06:51:16 +01:00
|
|
|
, withGraphite2 ? true # it is small and major distros do include it
|
2013-11-24 12:51:12 +00:00
|
|
|
}:
|
|
|
|
|
2015-10-05 18:26:54 +01:00
|
|
|
let
|
2016-01-19 08:55:31 +00:00
|
|
|
version = "1.1.2";
|
2015-10-05 18:26:54 +01:00
|
|
|
inherit (stdenv.lib) optional optionals optionalString;
|
|
|
|
in
|
2012-09-27 22:23:36 +01:00
|
|
|
|
2015-10-05 18:26:54 +01:00
|
|
|
stdenv.mkDerivation {
|
2015-11-20 13:32:58 +00:00
|
|
|
name = "harfbuzz${optionalString withIcu "-icu"}-${version}";
|
2012-09-27 22:23:36 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-10-05 18:26:54 +01:00
|
|
|
url = "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.bz2";
|
2015-12-30 10:37:20 +00:00
|
|
|
sha256 = "07s6z3hbrb4rdfgzmln169wxz4nm5y7qbr02ik5c7drxpn85fb2a";
|
2012-09-27 22:23:36 +01:00
|
|
|
};
|
|
|
|
|
2015-10-28 17:56:00 +00:00
|
|
|
outputs = [ "dev" "out" ];
|
2015-10-05 18:26:54 +01:00
|
|
|
outputBin = "dev";
|
2015-07-26 12:43:49 +01:00
|
|
|
|
2013-11-24 12:51:12 +00:00
|
|
|
configureFlags = [
|
|
|
|
( "--with-graphite2=" + (if withGraphite2 then "yes" else "no") ) # not auto-detected by default
|
|
|
|
( "--with-icu=" + (if withIcu then "yes" else "no") )
|
|
|
|
];
|
|
|
|
|
2015-10-05 18:26:54 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ glib freetype cairo ] # recommended by upstream
|
2013-10-14 07:36:39 +01:00
|
|
|
++ libintlOrEmpty;
|
|
|
|
propagatedBuildInputs = []
|
2015-10-05 18:26:54 +01:00
|
|
|
++ optional withGraphite2 graphite2
|
|
|
|
++ optionals withIcu [ icu harfbuzz ]
|
2013-10-14 07:36:39 +01:00
|
|
|
;
|
2012-09-27 22:23:36 +01:00
|
|
|
|
2015-10-05 18:26:54 +01:00
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2012-09-27 22:23:36 +01:00
|
|
|
description = "An OpenType text shaping engine";
|
|
|
|
homepage = http://www.freedesktop.org/wiki/Software/HarfBuzz;
|
2015-10-05 18:26:54 +01:00
|
|
|
maintainers = [ maintainers.eelco ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2012-09-27 22:23:36 +01:00
|
|
|
};
|
|
|
|
}
|