@ -1,28 +1,34 @@
{ stdenv , fetchurl , pkgconfig , glib , freetype , cairo , libintl
{ stdenv , fetchFromGitHub , pkgconfig , glib , freetype , cairo , libintl
, meson , ninja
, gobject-introspection
, 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
, python3
, gtk-doc , docbook-xsl-nons , docbook_xml_dtd_43
} :
let
version = " 2 . 6 . 7 " ;
version = " 2 . 7 . 1 " ;
inherit ( stdenv . lib ) optional optionals optionalString ;
mesonFeatureFlag = opt : b :
" - D ${ opt } = ${ if b then " e n a b l e d " else " d i s a b l e d " } " ;
in
stdenv . mkDerivation {
name = " h a r f b u z z ${ optionalString withIcu " - i c u " } - ${ version } " ;
src = fetchurl {
url = " h t t p s : / / w w w . f r e e d e s k t o p . o r g / s o f t w a r e / h a r f b u z z / r e l e a s e / h a r f b u z z - ${ version } . t a r . x z " ;
sha256 = " 0 6 5 j g 6 s 8 x i x 4 5 s 4 m s j 0 l 2 r 0 i y c w 5 y y y j d y l r i p v 7 p y f z d k 8 8 3 r 2 9 " ;
src = fetchFromGitHub {
owner = " h a r f b u z z " ;
repo = " h a r f b u z z " ;
rev = version ;
sha256 = " 1 7 2 j m w p 6 6 6 x b s 6 y y 1 p c 2 4 9 5 g n k z 8 x w 1 1 b 8 z k z 3 j 1 9 j x l v v p 4 m x c s " ;
} ;
postPatch = ''
patchShebangs src/gen-def.p y
patchShebangs src /* . p y
patchShebangs test
'' + s t d e n v . l i b . o p t i o n a l S t r i n g s t d e n v . i s D a r w i n ''
# ApplicationServices.framework headers have cast-align warnings.
@ -30,22 +36,25 @@ stdenv.mkDerivation {
- - replace ' #pragma GCC diagnostic error "-Wcast-align"' ""
'' ;
outputs = [ " o u t " " d e v " ] ;
outputs = [ " o u t " " d e v " " d e v d o c " ] ;
outputBin = " d e v " ;
configureFlags = [
# not auto-detected by default
" - - w i t h - g r a p h i t e 2 = ${ if withGraphite2 then " y e s " else " n o " } "
" - - w i t h - i c u = ${ if withIcu then " y e s " else " n o " } "
" - - w i t h - g o b j e c t = y e s "
" - - e n a b l e - i n t r o s p e c t i o n = y e s "
]
++ stdenv . lib . optional withCoreText " - - w i t h - c o r e t e x t = y e s " ;
mesonFlags = [
( mesonFeatureFlag " g r a p h i t e " withGraphite2 )
( mesonFeatureFlag " i c u " withIcu )
( mesonFeatureFlag " c o r e t e x t " withCoreText )
] ;
nativeBuildInputs = [
meson
ninja
gobject-introspection
libintl
pkgconfig
python3
gtk-doc
docbook-xsl-nons
docbook_xml_dtd_43
] ;
buildInputs = [ glib freetype cairo ] # recommended by upstream
@ -55,11 +64,10 @@ stdenv.mkDerivation {
++ optional withGraphite2 graphite2
++ optionals withIcu [ icu harfbuzz ] ;
checkInputs = [ python ] ;
doInstallCheck = false ; # fails, probably a bug
doCheck = true ;
# Slightly hacky; some pkgs expect them in a single directory.
postInstall = optionalString withIcu ''
postFixup = optionalString withIcu ''
rm " $ o u t " /lib/libharfbuzz. * " $ d e v / l i b / p k g c o n f i g / h a r f b u z z . p c "
ln - s { ' ${ harfbuzz . out } ' , " $ o u t " } /lib/libharfbuzz.la
ln - s { ' ${ harfbuzz . dev } ' , " $ d e v " } /lib/pkgconfig/harfbuzz.pc
@ -71,12 +79,9 @@ stdenv.mkDerivation {
meta = with stdenv . lib ; {
description = " A n O p e n T y p e t e x t s h a p i n g e n g i n e " ;
homepage = " h t t p : / / w w w . f r e e d e s k t o p . o r g / w i k i / S o f t w a r e / H a r f B u z z " ;
downloadPage = " h t t p s : / / w w w . f r e e d e s k t o p . o r g / s o f t w a r e / h a r f b u z z / r e l e a s e / " ;
homepage = " h t t p s : / / h a r f b u z z . g i t h u b . i o / " ;
maintainers = [ maintainers . eelco ] ;
license = licenses . mit ;
platforms = with platforms ; linux ++ darwin ;
inherit version ;
updateWalker = true ;
} ;
}