gurobi: 12.0.0 -> 12.0.1 (#377852)
[NixPkgs.git] / pkgs / development / libraries / gtksourceview / 5.x.nix
blob7d951f7bc77e80fbfb7bbe7364c56e0642f342bb
2   lib,
3   stdenv,
4   fetchurl,
5   meson,
6   ninja,
7   pkg-config,
8   glib,
9   pcre2,
10   gtk4,
11   pango,
12   fribidi,
13   vala,
14   gi-docgen,
15   libxml2,
16   perl,
17   gettext,
18   gnome,
19   gobject-introspection,
20   dbus,
21   xvfb-run,
22   shared-mime-info,
23   testers,
26 stdenv.mkDerivation (finalAttrs: {
27   pname = "gtksourceview";
28   version = "5.14.2";
30   outputs = [
31     "out"
32     "dev"
33     "devdoc"
34   ];
36   src = fetchurl {
37     url = "mirror://gnome/sources/gtksourceview/${lib.versions.majorMinor finalAttrs.version}/gtksourceview-${finalAttrs.version}.tar.xz";
38     hash = "sha256-Gm04emgHX4rv1OdSz0hxd8SmgjsU/4pDSYaFiurvYmQ=";
39   };
41   patches = [
42     # By default, the library loads syntaxes from XDG_DATA_DIRS and user directory
43     # but not from its own datadr (it assumes it will be in XDG_DATA_DIRS).
44     # Since this is not generally true with Nix, let’s add $out/share unconditionally.
45     ./4.x-nix_share_path.patch
46   ];
48   nativeBuildInputs = [
49     meson
50     ninja
51     pkg-config
52     gettext
53     perl
54     gobject-introspection
55     vala
56     gi-docgen
57     gtk4 # for gtk4-update-icon-cache checked during configure
58   ];
60   buildInputs = [
61     glib
62     pcre2
63     pango
64     fribidi
65     libxml2
66   ];
68   propagatedBuildInputs = [
69     # Required by gtksourceview-5.0.pc
70     gtk4
71     # Used by gtk_source_language_manager_guess_language
72     shared-mime-info
73   ];
75   nativeCheckInputs = [
76     xvfb-run
77     dbus
78   ];
80   mesonFlags = [
81     "-Ddocumentation=true"
82   ];
84   doCheck = stdenv.hostPlatform.isLinux;
86   checkPhase = ''
87     runHook preCheck
89     env \
90       XDG_DATA_DIRS="$XDG_DATA_DIRS:${shared-mime-info}/share" \
91       GTK_A11Y=none \
92       xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
93         --config-file=${dbus}/share/dbus-1/session.conf \
94         meson test --no-rebuild --print-errorlogs
96     runHook postCheck
97   '';
99   postFixup = ''
100     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
101     moveToOutput "share/doc" "$devdoc"
102   '';
104   passthru = {
105     updateScript = gnome.updateScript {
106       packageName = "gtksourceview";
107       attrPath = "gtksourceview5";
108       versionPolicy = "odd-unstable";
109     };
110   };
112   passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
114   meta = with lib; {
115     description = "Source code editing widget for GTK";
116     homepage = "https://gitlab.gnome.org/GNOME/gtksourceview";
117     pkgConfigModules = [ "gtksourceview-5" ];
118     platforms = platforms.unix;
119     license = licenses.lgpl21Plus;
120     maintainers = teams.gnome.members;
121   };