diff --git a/pkgs/development/python-modules/gaphas/default.nix b/pkgs/development/python-modules/gaphas/default.nix new file mode 100644 index 000000000000..a6351aeeadd7 --- /dev/null +++ b/pkgs/development/python-modules/gaphas/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, poetry-core +, gobject-introspection +, gtk3 +, pycairo +, pygobject3 +, typing-extensions +}: + +buildPythonPackage rec { + pname = "gaphas"; + version = "3.1.9"; + disabled = pythonOlder "3.7"; + + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-S6cRsfqXYM4mSVSs2M8fET5ShFClKkGkod2w2y6F2gc="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + buildInputs = [ gobject-introspection gtk3 ]; + + propagatedBuildInputs = [ + pycairo + pygobject3 + typing-extensions + ]; + + pythonImportsCheck = [ "gaphas" ]; + + meta = with lib; { + description = "GTK+ based diagramming widget"; + maintainers = with maintainers; [ wolfangaukang ]; + homepage = "https://github.com/gaphor/gaphas"; + license = licenses.asl20; + }; +} diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix new file mode 100644 index 000000000000..87dca630a1b8 --- /dev/null +++ b/pkgs/development/python-modules/generic/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, poetry-core +}: + +buildPythonPackage rec { + pname = "generic"; + version = "1.0.1"; + disabled = pythonOlder "3.7"; + + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-ex93I+ofo5lP6qoolZwzjxSspeqJimY3vpB32RLJ00k="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + pythonImportsCheck = [ "generic" ]; + + meta = with lib; { + description = "Generic programming (Multiple dispatch) library for Python"; + maintainers = with maintainers; [ wolfangaukang ]; + homepage = "https://github.com/gaphor/generic"; + license = licenses.bsdOriginal; + }; +} diff --git a/pkgs/tools/misc/gaphor/default.nix b/pkgs/tools/misc/gaphor/default.nix new file mode 100644 index 000000000000..6105b07c3450 --- /dev/null +++ b/pkgs/tools/misc/gaphor/default.nix @@ -0,0 +1,66 @@ +{ lib +, buildPythonApplication +, fetchPypi +, poetry-core +, gobject-introspection +, pango +, gtksourceview4 +, wrapGAppsHook +, makeDesktopItem +, copyDesktopItems +, gaphas +, generic +, pycairo +, pygobject3 +, python +, tinycss2 +}: + +buildPythonApplication rec { + pname = "gaphor"; + version = "2.6.5"; + + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-IFsbWx5lblKsnEibVihM6ZPRoydXC+JM1gdZEUUTKxw="; + }; + + nativeBuildInputs = [ + poetry-core copyDesktopItems gobject-introspection wrapGAppsHook + ]; + + # Setting gobject-introspection on booth nativeBuildInputs and + # buildInputs because of #56943. This recognizes pango, avoiding + # a "ValueError: Namespace PangoCairo not available". + buildInputs = [ gobject-introspection gtksourceview4 pango ]; + + propagatedBuildInputs = [ + gaphas + generic + pycairo + pygobject3 + tinycss2 + ]; + + desktopItems = makeDesktopItem { + name = pname; + exec = "gaphor"; + icon = "gaphor"; + comment = meta.description; + desktopName = "Gaphor"; + }; + + postInstall = '' + install -Dm644 $out/${python.sitePackages}/gaphor/ui/icons/hicolor/scalable/apps/org.gaphor.Gaphor.svg $out/share/pixmaps/gaphor.svg + ''; + + meta = with lib; { + description = "Simple modeling tool written in Python"; + maintainers = with maintainers; [ wolfangaukang ]; + homepage = "https://github.com/gaphor/gaphor"; + license = licenses.asl20; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d47c983727d7..c443843f4bdc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5392,6 +5392,8 @@ with pkgs; gandom-fonts = callPackage ../data/fonts/gandom-fonts { }; + gaphor = python3Packages.callPackage ../tools/misc/gaphor { }; + garmin-plugin = callPackage ../applications/misc/garmin-plugin {}; garmintools = callPackage ../development/libraries/garmintools {}; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ee1258aa64a1..0778987c85d0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2968,6 +2968,8 @@ in { pythonPackages = self; }); + gaphas = callPackage ../development/python-modules/gaphas { }; + garminconnect-aio = callPackage ../development/python-modules/garminconnect-aio { }; garminconnect-ha = callPackage ../development/python-modules/garminconnect-ha { }; @@ -3006,6 +3008,8 @@ in { genanki = callPackage ../development/python-modules/genanki { }; + generic = callPackage ../development/python-modules/generic { }; + genome-collector = callPackage ../development/python-modules/genome-collector { }; genpy = callPackage ../development/python-modules/genpy { };