forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / pango / default.nix
blobfcdf8f27f9811d664b897a2e046eed12273d6ee5
1 { lib
2 , stdenv
3 , fetchurl
4 , pkg-config
5 , cairo
6 , harfbuzz
7 , libintl
8 , libthai
9 , darwin
10 , fribidi
11 , gnome
12 , gi-docgen
13 , makeFontsConf
14 , freefont_ttf
15 , meson
16 , ninja
17 , glib
18 , python3
19 , x11Support? !stdenv.hostPlatform.isDarwin, libXft
20 , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
21 , buildPackages, gobject-introspection
22 , testers
25 stdenv.mkDerivation (finalAttrs: {
26   pname = "pango";
27   version = "1.54.0";
29   outputs = [ "bin" "out" "dev" ] ++ lib.optional withIntrospection "devdoc";
31   src = fetchurl {
32     url = with finalAttrs; "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
33     hash = "sha256-ip7tdQIe5zTX/A/fOmXDu6Ud/v5K5RqbQUpgxwstHtg=";
34   };
36   depsBuildBuild = [
37     pkg-config
38   ];
40   nativeBuildInputs = [
41     meson ninja
42     glib # for glib-mkenum
43     pkg-config
44     python3
45   ] ++ lib.optionals withIntrospection [
46     gi-docgen
47     gobject-introspection
48   ];
50   buildInputs = [
51     fribidi
52     libthai
53   ] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
54     ApplicationServices
55     Carbon
56     CoreGraphics
57     CoreText
58   ]);
60   propagatedBuildInputs = [
61     cairo
62     glib
63     libintl
64     harfbuzz
65   ] ++ lib.optionals x11Support [
66     libXft
67   ];
69   mesonFlags = [
70     (lib.mesonBool "documentation" withIntrospection)
71     (lib.mesonEnable "introspection" withIntrospection)
72     (lib.mesonEnable "xft" x11Support)
73   ];
75   # Fontconfig error: Cannot load default config file
76   FONTCONFIG_FILE = makeFontsConf {
77     fontDirectories = [ freefont_ttf ];
78   };
80   # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
81   # it should be a build-time dep for build
82   # TODO: send upstream
83   postPatch = ''
84     substituteInPlace docs/meson.build \
85       --replace "'gi-docgen', req" "'gi-docgen', native:true, req"
86   '';
88   doCheck = false; # test-font: FAIL
90   postFixup = ''
91     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
92     moveToOutput "share/doc" "$devdoc"
93   '';
95   passthru = {
96     updateScript = gnome.updateScript {
97       packageName = finalAttrs.pname;
98       # 1.90 is alpha for API 2.
99       freeze = "1.90.0";
100     };
101     tests = {
102       pkg-config = testers.hasPkgConfigModules {
103         package = finalAttrs.finalPackage;
104       };
105     };
106   };
108   meta = with lib; {
109     description = "Library for laying out and rendering of text, with an emphasis on internationalization";
111     longDescription = ''
112       Pango is a library for laying out and rendering of text, with an
113       emphasis on internationalization.  Pango can be used anywhere
114       that text layout is needed, though most of the work on Pango so
115       far has been done in the context of the GTK widget toolkit.
116       Pango forms the core of text and font handling for GTK.
117     '';
119     homepage = "https://www.pango.org/";
120     license = licenses.lgpl2Plus;
122     maintainers = with maintainers; [ raskin ] ++ teams.gnome.members;
123     platforms = platforms.unix;
125     pkgConfigModules = [
126       "pango"
127       "pangocairo"
128       "pangofc"
129       "pangoft2"
130       "pangoot"
131       "pangoxft"
132     ];
133   };