@@ -1,32 +1,42 @@
1−{ lib, stdenv, fetchurl, fetchpatch, pkg-config, atk, cairo, glib, gtk3, pango, fribidi, vala
2−, libxml2, perl, gettext, gnome3, gobject-introspection, dbus, xvfb_run, shared-mime-info
3−, meson, ninja }:
1+{ lib
2+, stdenv
3+, fetchurl
4+, fetchpatch
5+, meson
6+, ninja
7+, pkg-config
8+, atk
9+, cairo
10+, glib
11+, gtk3
12+, pango
13+, fribidi
14+, vala
15+, libxml2
16+, perl
17+, gettext
18+, gnome3
19+, gobject-introspection
20+, dbus
21+, xvfb_run
22+, shared-mime-info
23+}:
424
525stdenv.mkDerivation rec {
626 pname = "gtksourceview";
727 version = "4.8.1";
828
29+ outputs = [ "out" "dev" ];
30+
931 src = fetchurl {
1032 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
1133 sha256 = "0WPXG1/K+8Wx7sbdhB7b283dOnURzV/c/9hri7/mmsE=";
1234 };
1335
14− propagatedBuildInputs = [
15− # Required by gtksourceview-4.0.pc
16− gtk3
17− # Used by gtk_source_language_manager_guess_language
18− shared-mime-info
19− ];
20−
21− outputs = [ "out" "dev" ];
22−
23− nativeBuildInputs = [ meson ninja pkg-config gettext perl gobject-introspection vala ];
24−
25− checkInputs = [ xvfb_run dbus ];
26−
27− buildInputs = [ atk cairo glib pango fribidi libxml2 ];
28−
2936 patches = [
37+ # By default, the library loads syntaxes from XDG_DATA_DIRS and user directory
38+ # but not from its own datadr (it assumes it will be in XDG_DATA_DIRS).
39+ # Since this is not generally true with Nix, let’s add $out/share unconditionally.
3040 ./4.x-nix_share_path.patch
3141
3242 # fixes intermittent "gtksourceview-gresources.h: no such file" errors
@@ -37,14 +47,48 @@ stdenv.mkDerivation rec {
3747 })
3848 ];
3949
40− enableParallelBuilding = true;
50+ nativeBuildInputs = [
51+ meson
52+ ninja
53+ pkg-config
54+ gettext
55+ perl
56+ gobject-introspection
57+ vala
58+ ];
59+
60+ buildInputs = [
61+ atk
62+ cairo
63+ glib
64+ pango
65+ fribidi
66+ libxml2
67+ ];
68+
69+ propagatedBuildInputs = [
70+ # Required by gtksourceview-4.0.pc
71+ gtk3
72+ # Used by gtk_source_language_manager_guess_language
73+ shared-mime-info
74+ ];
75+
76+ checkInputs = [
77+ xvfb_run
78+ dbus
79+ ];
4180
4281 doCheck = stdenv.isLinux;
82+
4383 checkPhase = ''
84+ runHook preCheck
85+
4486 XDG_DATA_DIRS="$XDG_DATA_DIRS:${shared-mime-info}/share" \
4587 xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
4688 --config-file=${dbus.daemon}/share/dbus-1/session.conf \
4789 meson test --no-rebuild --print-errorlogs
90+
91+ runHook postCheck
4892 '';
4993
5094 passthru = {
@@ -56,9 +100,10 @@ stdenv.mkDerivation rec {
56100 };
57101
58102 meta = with lib; {
103+ description = "Source code editing widget for GTK";
59104 homepage = "https://wiki.gnome.org/Projects/GtkSourceView";
60− platforms = with platforms; linux ++ darwin;
61− license = licenses.lgpl21;
105+ platforms = platforms.unix;
106+ license = licenses.lgpl21Plus;
62107 maintainers = teams.gnome.members;
63108 };
64109}