1{
2 lib,
3 gitUpdater,
4 fetchFromGitHub,
5 meson,
6 ninja,
7 gettext,
8 wrapGAppsHook3,
9 gobject-introspection,
10 pango,
11 gdk-pixbuf,
12 python3,
13 atk,
14 gtk3,
15 hicolor-icon-theme,
16}:
17
18python3.pkgs.buildPythonApplication rec {
19 pname = "diffuse";
20 version = "0.10.0";
21
22 src = fetchFromGitHub {
23 owner = "MightyCreak";
24 repo = "diffuse";
25 rev = "v${version}";
26 sha256 = "Svt+llBwJKGXRJZ96dzzdzpL/5jrzXXM/FPZwA7Es8s=";
27 };
28
29 format = "other";
30
31 nativeBuildInputs = [
32 wrapGAppsHook3
33 meson
34 ninja
35 gettext
36 gobject-introspection
37 ];
38
39 buildInputs = [
40 pango
41 gdk-pixbuf
42 atk
43 gtk3
44 ];
45
46 propagatedBuildInputs = with python3.pkgs; [
47 pycairo
48 pygobject3
49 ];
50
51 preConfigure = ''
52 # app bundle for macos
53 substituteInPlace src/diffuse/meson.build data/icons/meson.build src/diffuse/mac-os-app/diffuse-mac.in --replace-fail "/Applications" "$out/Applications";
54 '';
55
56 mesonFlags = [
57 "-Db_ndebug=true"
58 ];
59
60 # to avoid running gtk-update-icon-cache, update-desktop-database and glib-compile-schemas
61 DESTDIR = "/";
62
63 makeWrapperArgs = [
64 "--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share"
65 ];
66
67 passthru = {
68 updateScript = gitUpdater {
69 rev-prefix = "v";
70 };
71 };
72
73 meta = with lib; {
74 homepage = "https://github.com/MightyCreak/diffuse";
75 description = "Graphical tool for merging and comparing text files";
76 mainProgram = "diffuse";
77 license = licenses.gpl2;
78 maintainers = with maintainers; [ k3a ];
79 platforms = platforms.unix;
80 };
81}