diff options
author | Alexis Lapierre <128792625+Alexis-Lapierre@users.noreply.github.com> | 2024-04-25 07:58:53 +0200 |
---|---|---|
committer | Alexis Lapierre <128792625+Alexis-Lapierre@users.noreply.github.com> | 2024-04-29 22:31:07 +0200 |
commit | 4fbe91c73b5b6d7edb03298ab1d1a50b16146f6e (patch) | |
tree | 1188d427292885f62c007e8e5a55ac7818d3a9fc /pkgs/applications/graphics | |
parent | e97a23c9201ede1863b8c614a9c9b5ff6a4c8275 (diff) |
hydrus: add desktop file
The flatpak package for Hydrus Network install a .desktop file. I updated this file so that the Nix package also generate a .desktop file on install.
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r-- | pkgs/applications/graphics/hydrus/default.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix index d546baa98415f..0bd29d5aa5eef 100644 --- a/pkgs/applications/graphics/hydrus/default.nix +++ b/pkgs/applications/graphics/hydrus/default.nix @@ -8,6 +8,8 @@ , python3Packages , qtbase , qtcharts +, makeDesktopItem +, copyDesktopItems }: python3Packages.buildPythonPackage rec { @@ -25,6 +27,7 @@ python3Packages.buildPythonPackage rec { nativeBuildInputs = [ wrapQtAppsHook python3Packages.mkdocs-material + copyDesktopItems ]; buildInputs = [ @@ -32,6 +35,20 @@ python3Packages.buildPythonPackage rec { qtcharts ]; + desktopItems = [ + (makeDesktopItem { + name = "hydrus-client"; + exec = "hydrus-client"; + desktopName = "Hydrus Client"; + icon = "hydrus-client"; + comment = meta.description; + terminal = false; + type = "Application"; + categories = [ "FileTools" "Utility" ]; + }) + ]; + + propagatedBuildInputs = with python3Packages; [ beautifulsoup4 cbor2 @@ -104,6 +121,8 @@ python3Packages.buildPythonPackage rec { outputs = [ "out" "doc" ]; installPhase = '' + runHook preInstall + # Move the hydrus module and related directories mkdir -p $out/${python3Packages.python.sitePackages} mv {hydrus,static,db} $out/${python3Packages.python.sitePackages} @@ -118,12 +137,18 @@ python3Packages.buildPythonPackage rec { mkdir -p $out/bin install -m0755 hydrus_server.py $out/bin/hydrus-server install -m0755 hydrus_client.py $out/bin/hydrus-client + + # desktop item + mkdir -p "$out/share/icons/hicolor/scalable/apps" + ln -s "$doc/share/doc/hydrus/assets/hydrus-white.svg" "$out/share/icons/hicolor/scalable/apps/hydrus-client.svg" '' + lib.optionalString enableSwftools '' mkdir -p $out/${python3Packages.python.sitePackages}/bin # swfrender seems to have to be called sfwrender_linux # not sure if it can be loaded through PATH, but this is simpler # $out/python3Packages.python.sitePackages/bin is correct NOT .../hydrus/bin ln -s ${swftools}/bin/swfrender $out/${python3Packages.python.sitePackages}/bin/swfrender_linux + '' + '' + runHook postInstall ''; dontWrapQtApps = true; |