1{ lib
2, stdenv
3, fetchurl
4, fetchpatch
5, vala
6, gettext
7, pkg-config
8, gtk3
9, glib
10, json-glib
11, wrapGAppsHook
12, libpeas
13, bash
14, gobject-introspection
15, gtksourceview4
16, gsettings-desktop-schemas
17, adwaita-icon-theme
18, gnome
19, gspell
20, shared-mime-info
21, libgee
22, libgit2-glib
23, libsecret
24, libxml2
25, meson
26, ninja
27, python3
28, libdazzle
29}:
30
31stdenv.mkDerivation rec {
32 pname = "gitg";
33 version = "41";
34
35 src = fetchurl {
36 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
37 sha256 = "f7Ybn7EPuqVI0j1wZbq9cq1j5iHeVYQMBlzm45hsRik=";
38 };
39
40 patches = [
41 # Fix build with meson 0.61
42 # data/meson.build:8:5: ERROR: Function does not take positional arguments.
43 (fetchpatch {
44 url = "https://gitlab.gnome.org/GNOME/gitg/-/commit/1978973b12848741b08695ec2020bac98584d636.patch";
45 sha256 = "sha256-RzaGPGGiKMgjy0waFqt48rV2yWBGZgC3kHehhVhxktk=";
46 })
47 ];
48
49 nativeBuildInputs = [
50 gobject-introspection
51 gettext
52 meson
53 ninja
54 pkg-config
55 python3
56 vala
57 wrapGAppsHook
58 ];
59
60 buildInputs = [
61 adwaita-icon-theme
62 glib
63 gsettings-desktop-schemas
64 gtk3
65 gtksourceview4
66 gspell
67 json-glib
68 libdazzle
69 libgee
70 libgit2-glib
71 libpeas
72 libsecret
73 libxml2
74 ];
75
76 doCheck = false; # FAIL: tests-gitg gtk_style_context_add_provider_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
77
78 postPatch = ''
79 chmod +x meson_post_install.py
80 patchShebangs meson_post_install.py
81
82 substituteInPlace tests/libgitg/test-commit.vala --replace "/bin/bash" "${bash}/bin/bash"
83 '';
84
85 preFixup = ''
86 gappsWrapperArgs+=(
87 # Thumbnailers
88 --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
89 )
90 '';
91
92 passthru = {
93 updateScript = gnome.updateScript {
94 packageName = pname;
95 };
96 };
97
98 meta = with lib; {
99 homepage = "https://wiki.gnome.org/Apps/Gitg";
100 description = "GNOME GUI client to view git repositories";
101 maintainers = with maintainers; [ domenkozar ];
102 license = licenses.gpl2Plus;
103 platforms = platforms.linux;
104 };
105}