3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/gaphor/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
1.8 KiB
Nix
Raw Normal View History

2021-11-12 15:24:28 +00:00
{ lib
, buildPythonApplication
, fetchPypi
2022-02-25 16:29:16 +00:00
, copyDesktopItems
2021-11-12 15:24:28 +00:00
, gobject-introspection
2022-02-25 16:29:16 +00:00
, poetry-core
2021-11-12 15:24:28 +00:00
, wrapGAppsHook
2022-02-25 16:29:16 +00:00
, gtksourceview4
, pango
2021-11-12 15:24:28 +00:00
, gaphas
, generic
2022-02-25 16:29:16 +00:00
, jedi
2021-11-12 15:24:28 +00:00
, pycairo
, pygobject3
, tinycss2
2022-02-25 16:29:16 +00:00
, gtk3
, librsvg
, makeDesktopItem
, python
2021-11-12 15:24:28 +00:00
}:
buildPythonApplication rec {
pname = "gaphor";
2022-02-25 16:29:16 +00:00
version = "2.8.2";
2021-11-12 15:24:28 +00:00
format = "pyproject";
src = fetchPypi {
inherit pname version;
2022-02-25 16:29:16 +00:00
sha256 = "sha256-+qqsSLjdY2I19fxdfkOEQ9DhTTHccUDll4O5yqtLiz0=";
2021-11-12 15:24:28 +00:00
};
nativeBuildInputs = [
2022-02-25 16:29:16 +00:00
copyDesktopItems
gobject-introspection
poetry-core
wrapGAppsHook
2021-11-12 15:24:28 +00:00
];
# Setting gobject-introspection on booth nativeBuildInputs and
# buildInputs because of #56943. This recognizes pango, avoiding
# a "ValueError: Namespace PangoCairo not available".
2022-02-25 16:29:16 +00:00
buildInputs = [
gobject-introspection
gtksourceview4
pango
];
2021-11-12 15:24:28 +00:00
propagatedBuildInputs = [
gaphas
generic
2022-02-25 16:29:16 +00:00
jedi
2021-11-12 15:24:28 +00:00
pycairo
pygobject3
tinycss2
];
desktopItems = makeDesktopItem {
name = pname;
exec = "gaphor";
icon = "gaphor";
comment = meta.description;
desktopName = "Gaphor";
};
2022-02-25 16:29:16 +00:00
# We need to wrap it manually to resolve all icons
dontWrapGApps = true;
2021-11-12 15:24:28 +00:00
postInstall = ''
install -Dm644 $out/${python.sitePackages}/gaphor/ui/icons/hicolor/scalable/apps/org.gaphor.Gaphor.svg $out/share/pixmaps/gaphor.svg
'';
2022-02-25 16:29:16 +00:00
preFixup = ''
wrapProgram $out/bin/gaphor \
''${gappsWrapperArgs[@]} \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--set GDK_PIXBUF_MODULE_FILE "${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
'';
2021-11-12 15:24:28 +00:00
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" ];
};
}