diff --git a/pkgs/applications/graphics/graphui/default.nix b/pkgs/applications/graphics/graphui/default.nix new file mode 100644 index 00000000000000..09dd2caed8fe86 --- /dev/null +++ b/pkgs/applications/graphics/graphui/default.nix @@ -0,0 +1,75 @@ +{ stdenv +, fetchFromGitHub +, meson +, ninja +, vala +, pkg-config +, pantheon +, python3 +, desktop-file-utils +, glib +, graphviz +, gtk3 +, gtksourceview +, libgee +, substituteAll +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "graphui"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "artemanufrij"; + repo = pname; + rev = version; + sha256 = "19r44rw0chvj7yrqf35rvpg1yziv25d43h392qnwbmifnq1kbfcs"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + graphviz = "${graphviz}/bin/"; + }) + ]; + + nativeBuildInputs = [ + meson + ninja + vala + pkg-config + python3 + desktop-file-utils + wrapGAppsHook + ]; + + buildInputs = [ + glib + gtk3 + gtksourceview + graphviz + libgee + pantheon.granite + ]; + + postPatch = '' + chmod +x meson/post_install.py + patchShebangs meson/post_install.py + ''; + + passthru = { + updateScript = pantheon.updateScript { + attrPath = pname; + }; + }; + + meta = with stdenv.lib; { + description = "Graph visualization based on graphviz"; + homepage = "https://github.com/artemanufrij/graphui"; + maintainers = with maintainers; [ kjuvi ] ++ pantheon.maintainers; + platforms = platforms.linux; + license = licenses.lgpl2Plus; + }; +} + diff --git a/pkgs/applications/graphics/graphui/fix-paths.patch b/pkgs/applications/graphics/graphui/fix-paths.patch new file mode 100644 index 00000000000000..d9ffaf86053177 --- /dev/null +++ b/pkgs/applications/graphics/graphui/fix-paths.patch @@ -0,0 +1,13 @@ +diff --git a/src/Services/GraphViz.vala b/src/Services/GraphViz.vala +index 213d4e5..192b8dd 100644 +--- a/src/Services/GraphViz.vala ++++ b/src/Services/GraphViz.vala +@@ -76,7 +76,7 @@ namespace GraphUI.Services { + } + output_image = GraphUIApp.instance.CACHE_FOLDER + "/output.svg"; + +- string[] spawn_args = {format, "-T%s".printf (type), "%s".printf (output_txt), "-o", "%s".printf (output_image)}; ++ string[] spawn_args = {"@graphviz@" + format, "-T%s".printf (type), "%s".printf (output_txt), "-o", "%s".printf (output_image)}; + string[] spawn_env = Environ.get (); + + string processout = ""; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 37829bedefbff6..e324ba14acc40b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19333,6 +19333,8 @@ in graphicsmagick-imagemagick-compat = callPackage ../applications/graphics/graphicsmagick/compat.nix { }; + graphui = callPackage ../applications/graphics/graphui/default.nix { }; + grisbi = callPackage ../applications/office/grisbi { gtk = gtk3; }; gtkpod = callPackage ../applications/audio/gtkpod { };