diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/pango')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pango/default.nix | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/pango/default.nix b/nixpkgs/pkgs/development/libraries/pango/default.nix new file mode 100644 index 000000000000..6ce22a8c1c68 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/pango/default.nix @@ -0,0 +1,120 @@ +{ lib +, stdenv +, fetchurl +, pkg-config +, cairo +, harfbuzz +, libintl +, libthai +, darwin +, fribidi +, gnome +, gi-docgen +, makeFontsConf +, freefont_ttf +, meson +, ninja +, glib +, python3 +, gobject-introspection +, x11Support? !stdenv.isDarwin, libXft +}: + +stdenv.mkDerivation rec { + pname = "pango"; + version = "1.50.8"; + + outputs = [ "bin" "out" "dev" "devdoc" ]; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "z2JvWd0UbAIxdMQDSSDpZn8dJawsFWlRbWMTbDESVfo="; + }; + + depsBuildBuild = [ + pkg-config + ]; + + nativeBuildInputs = [ + meson ninja + glib # for glib-mkenum + pkg-config + gobject-introspection + gi-docgen + python3 + ]; + + buildInputs = [ + fribidi + libthai + gobject-introspection + ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + ApplicationServices + Carbon + CoreGraphics + CoreText + ]); + + propagatedBuildInputs = [ + cairo + glib + libintl + harfbuzz + ] ++ lib.optionals x11Support [ + libXft + ]; + + mesonFlags = [ + "-Dgtk_doc=true" + ] ++ lib.optionals (!x11Support) [ + "-Dxft=disabled" # only works with x11 + ]; + + # Fontconfig error: Cannot load default config file + FONTCONFIG_FILE = makeFontsConf { + fontDirectories = [ freefont_ttf ]; + }; + + # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) + # it should be a build-time dep for build + # TODO: send upstream + postPatch = '' + substituteInPlace meson.build \ + --replace "dependency('gi-docgen', ver" "dependency('gi-docgen', native:true, ver" + + substituteInPlace docs/meson.build \ + --replace "'gi-docgen', req" "'gi-docgen', native:true, req" + ''; + + doCheck = false; # test-font: FAIL + + postFixup = '' + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" + ''; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "A library for laying out and rendering of text, with an emphasis on internationalization"; + + longDescription = '' + Pango is a library for laying out and rendering of text, with an + emphasis on internationalization. Pango can be used anywhere + that text layout is needed, though most of the work on Pango so + far has been done in the context of the GTK widget toolkit. + Pango forms the core of text and font handling for GTK. + ''; + + homepage = "https://www.pango.org/"; + license = licenses.lgpl2Plus; + + maintainers = with maintainers; [ raskin ] ++ teams.gnome.members; + platforms = platforms.linux ++ platforms.darwin; + }; +} |