diff options
author | Aleksana <me@aleksana.moe> | 2024-05-01 02:00:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-01 02:00:56 +0800 |
commit | c0e20af6a2489b3327190982e63dd3c0102a05ad (patch) | |
tree | 58fd2170c1cc9eef2e1cbcc0f1695b998138a941 /pkgs/applications | |
parent | dd876cf057c22896669b65899ce479aeeb6ee0b6 (diff) | |
parent | 4fbe91c73b5b6d7edb03298ab1d1a50b16146f6e (diff) |
Merge pull request #307759 from Alexis-Lapierre/hydrus_desktop_file
hydrus: add desktop file
Diffstat (limited to 'pkgs/applications')
-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; |