From efdec26090fe6c61327b67d933e39d694da36bc2 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Dec 2023 22:17:20 +0100 Subject: [PATCH] treewide: install missing desktopItems --- pkgs/applications/audio/cheesecutter/default.nix | 5 +++++ pkgs/applications/audio/fmit/default.nix | 11 +++++++++++ pkgs/applications/audio/gspeech/default.nix | 5 +++++ pkgs/applications/audio/in-formant/default.nix | 2 ++ pkgs/applications/audio/praat/default.nix | 5 +++++ pkgs/applications/audio/pt2-clone/default.nix | 7 +++++++ pkgs/applications/audio/rubyripper/default.nix | 4 ++++ pkgs/applications/graphics/cloudcompare/default.nix | 9 +++++++++ pkgs/applications/graphics/epick/default.nix | 6 ++++++ pkgs/applications/graphics/goxel/default.nix | 8 ++++++++ pkgs/applications/graphics/oculante/default.nix | 5 +++++ pkgs/applications/graphics/pizarra/default.nix | 9 +++++++++ pkgs/applications/misc/activate-linux/default.nix | 5 +++++ pkgs/applications/misc/fluxboxlauncher/default.nix | 5 +++++ pkgs/applications/misc/klayout/default.nix | 3 +++ pkgs/applications/misc/llpp/default.nix | 1 + pkgs/applications/misc/nwg-displays/default.nix | 5 +++++ pkgs/applications/misc/skytemple/default.nix | 5 +++++ .../misc/system76-keyboard-configurator/default.nix | 5 +++++ pkgs/applications/misc/xygrib/default.nix | 4 ++++ .../networking/protonmail-bridge/default.nix | 2 ++ pkgs/applications/networking/rymdport/default.nix | 9 +++++++++ pkgs/applications/networking/sniffnet/default.nix | 10 ++++++++++ pkgs/applications/video/cutecapture/default.nix | 2 ++ pkgs/applications/video/pipe-viewer/default.nix | 5 +++++ pkgs/tools/games/ajour/default.nix | 6 ++++++ 26 files changed, 143 insertions(+) diff --git a/pkgs/applications/audio/cheesecutter/default.nix b/pkgs/applications/audio/cheesecutter/default.nix index 6c14cc67f81f..8e2877c40c7b 100644 --- a/pkgs/applications/audio/cheesecutter/default.nix +++ b/pkgs/applications/audio/cheesecutter/default.nix @@ -36,6 +36,11 @@ stdenv.mkDerivation rec { mkdir -p $out/share/cheesecutter/example_tunes cp -r tunes/* $out/share/cheesecutter/example_tunes + + install -Dm444 arch/fd/ccutter.desktop -t $out/share/applications + for res in $(ls icons | sed -e 's/cc//g' -e 's/.png//g'); do + install -Dm444 icons/cc$res.png $out/share/icons/hicolor/''${res}x''${res}/apps/cheesecutter.png + done ''; postFixup = diff --git a/pkgs/applications/audio/fmit/default.nix b/pkgs/applications/audio/fmit/default.nix index 7fcfeb32fd3a..fdcf94422048 100644 --- a/pkgs/applications/audio/fmit/default.nix +++ b/pkgs/applications/audio/fmit/default.nix @@ -36,6 +36,17 @@ mkDerivation rec { PREFIXSHORTCUT=$out" ''; + postInstall = '' + mkdir -p $out/share/applications + ln -s $out/fmit.desktop $out/share/applications/fmit.desktop + + mkdir -p $out/share/icons/hicolor/128x128/apps + ln -s $out/fmit.png $out/share/icons/hicolor/128x128/apps/fmit.png + + mkdir -p $out/share/icons/hicolor/scalable/apps + ln -s $out/fmit.svg $out/share/icons/hicolor/scalable/apps/fmit.svg + ''; + meta = with lib; { description = "Free Musical Instrument Tuner"; longDescription = '' diff --git a/pkgs/applications/audio/gspeech/default.nix b/pkgs/applications/audio/gspeech/default.nix index a48aa22809b4..f2216ed7d256 100644 --- a/pkgs/applications/audio/gspeech/default.nix +++ b/pkgs/applications/audio/gspeech/default.nix @@ -55,6 +55,11 @@ python3.pkgs.buildPythonApplication rec { librsvg ]; + postInstall = '' + install -Dm444 gspeech.desktop -t $out/share/applications + install -Dm444 icons/*.svg -t $out/share/icons/hicolor/scalable/apps + ''; + postFixup = '' wrapProgram $out/bin/gspeech --prefix PATH : ${lib.makeBinPath [ picotts sox ]} wrapProgram $out/bin/gspeech-cli --prefix PATH : ${lib.makeBinPath [ picotts sox ]} diff --git a/pkgs/applications/audio/in-formant/default.nix b/pkgs/applications/audio/in-formant/default.nix index 6801e3641852..3df72add7f6b 100644 --- a/pkgs/applications/audio/in-formant/default.nix +++ b/pkgs/applications/audio/in-formant/default.nix @@ -56,6 +56,8 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin cp in-formant $out/bin + install -Dm444 $src/dist-res/in-formant.desktop -t $out/share/applications + install -Dm444 $src/dist-res/in-formant.png -t $out/share/icons/hicolor/512x512/apps ''; meta = with lib; { diff --git a/pkgs/applications/audio/praat/default.nix b/pkgs/applications/audio/praat/default.nix index 1e9e26cb18a4..12cbb420e046 100644 --- a/pkgs/applications/audio/praat/default.nix +++ b/pkgs/applications/audio/praat/default.nix @@ -47,6 +47,11 @@ stdenv.mkDerivation (finalAttrs: { runHook preInstall install -Dt $out/bin praat + install -Dm444 main/praat.desktop -t $out/share/applications + install -Dm444 main/praat-32.ico $out/share/icons/hicolor/32x32/apps/praat.ico + install -Dm444 main/praat-256.ico $out/share/icons/hicolor/256x256/apps/praat.ico + install -Dm444 main/praat-480.png $out/share/icons/hicolor/480x480/apps/praat.png + install -Dm444 main/praat-480.svg $out/share/icons/hicolor/scalable/apps/praat.svg runHook postInstall ''; diff --git a/pkgs/applications/audio/pt2-clone/default.nix b/pkgs/applications/audio/pt2-clone/default.nix index 276fdbf32e2c..b6fa1ce2d0d4 100644 --- a/pkgs/applications/audio/pt2-clone/default.nix +++ b/pkgs/applications/audio/pt2-clone/default.nix @@ -20,6 +20,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ SDL2 ] ++ lib.optional stdenv.isLinux alsa-lib; + postInstall = '' + install -Dm444 "$src/release/other/Freedesktop.org Resources/ProTracker 2 clone.desktop" \ + -t $out/share/applications + install -Dm444 "$src/release/other/Freedesktop.org Resources/ProTracker 2 clone.png" \ + -t $out/share/icons/hicolor/512x512/apps + ''; + passthru.tests = { pt2-clone-opens = nixosTests.pt2-clone; }; diff --git a/pkgs/applications/audio/rubyripper/default.nix b/pkgs/applications/audio/rubyripper/default.nix index 0af80c991c2e..23cc0577c688 100644 --- a/pkgs/applications/audio/rubyripper/default.nix +++ b/pkgs/applications/audio/rubyripper/default.nix @@ -24,6 +24,10 @@ stdenv.mkDerivation rec { ruby ]; + postInstall = '' + cp -r share $out/ + ''; + postFixup = '' wrapProgram $out/bin/rrip_cli \ --prefix PATH : ${lib.makeBinPath [ cddiscid cdparanoia ruby ]} diff --git a/pkgs/applications/graphics/cloudcompare/default.nix b/pkgs/applications/graphics/cloudcompare/default.nix index 6a8e973c1beb..f2d008f7492b 100644 --- a/pkgs/applications/graphics/cloudcompare/default.nix +++ b/pkgs/applications/graphics/cloudcompare/default.nix @@ -95,6 +95,15 @@ mkDerivation rec { dontWrapGApps = true; + postInstall = '' + install -Dm444 $src/snap/gui/{ccViewer,cloudcompare}.png -t $out/share/icons/hicolor/256x256/apps + install -Dm444 $src/snap/gui/{ccViewer,cloudcompare}.desktop -t $out/share/applications + substituteInPlace $out/share/applications/{ccViewer,cloudcompare}.desktop \ + --replace 'Exec=cloudcompare.' 'Exec=' \ + --replace 'Icon=''${SNAP}/meta/gui/' 'Icon=' \ + --replace '.png' "" + ''; + # fix file dialogs crashing on non-NixOS (and avoid double wrapping) preFixup = '' qtWrapperArgs+=("''${gappsWrapperArgs[@]}") diff --git a/pkgs/applications/graphics/epick/default.nix b/pkgs/applications/graphics/epick/default.nix index fd767e356f12..c27cbf94476b 100644 --- a/pkgs/applications/graphics/epick/default.nix +++ b/pkgs/applications/graphics/epick/default.nix @@ -41,6 +41,12 @@ rustPlatform.buildRustPackage rec { AppKit ]; + postInstall = '' + install -Dm444 assets/epick.desktop -t $out/share/applications + install -Dm444 assets/icon.svg $out/share/icons/hicolor/scalable/apps/epick.svg + install -Dm444 assets/icon.png $out/share/icons/hicolor/48x48/apps/epick.png + ''; + postFixup = lib.optionalString stdenv.isLinux '' patchelf $out/bin/epick --add-rpath ${lib.makeLibraryPath [ libGL ]} ''; diff --git a/pkgs/applications/graphics/goxel/default.nix b/pkgs/applications/graphics/goxel/default.nix index 16b3a8c5037b..cf3a31a1d4bf 100644 --- a/pkgs/applications/graphics/goxel/default.nix +++ b/pkgs/applications/graphics/goxel/default.nix @@ -21,6 +21,14 @@ stdenv.mkDerivation rec { installPhase = '' install -D ./goxel $out/bin/goxel + + for res in $(ls data/icons | sed -e 's/icon//g' -e 's/.png//g'); do + install -Dm444 data/icons/icon$res.png $out/share/icons/hicolor/''${res}x''${res}/apps/goxel.png + done + + install -Dm444 snap/gui/goxel.desktop -t $out/share/applications + substituteInPlace $out/share/applications/goxel.desktop \ + --replace 'Icon=''${SNAP}/icon.png' 'Icon=goxel' ''; meta = with lib; { diff --git a/pkgs/applications/graphics/oculante/default.nix b/pkgs/applications/graphics/oculante/default.nix index 676cb3452afa..1351f711f56d 100644 --- a/pkgs/applications/graphics/oculante/default.nix +++ b/pkgs/applications/graphics/oculante/default.nix @@ -66,6 +66,11 @@ rustPlatform.buildRustPackage rec { "--skip=bench" ]; + postInstall = '' + install -Dm444 $src/res/oculante.png -t $out/share/icons/hicolor/128x128/apps/ + install -Dm444 $src/res/oculante.desktop -t $out/share/applications + ''; + postFixup = lib.optionalString stdenv.isLinux '' patchelf $out/bin/oculante --add-rpath ${lib.makeLibraryPath [ libxkbcommon libX11 ]} ''; diff --git a/pkgs/applications/graphics/pizarra/default.nix b/pkgs/applications/graphics/pizarra/default.nix index ccf21d630e64..f9d7fc650647 100644 --- a/pkgs/applications/graphics/pizarra/default.nix +++ b/pkgs/applications/graphics/pizarra/default.nix @@ -30,6 +30,15 @@ rustPlatform.buildRustPackage rec { buildInputs = [ gtk3-x11 atk glib librsvg ]; + postInstall = '' + install -Dm444 res/icons/tk.categulario.pizarra.svg $out/share/icons/hicolor/scalable/apps/pizarra.svg + install -Dm444 res/pizarra.desktop -t $out/share/applications + substituteInPlace $out/share/applications/pizarra.desktop \ + --replace "TryExec=/usr/bin/" "TryExec=" \ + --replace "Exec=/usr/bin/" "Exec=" \ + --replace "Icon=/usr/share/icons/hicolor/scalable/apps/pizarra.svg" "Icon=pizarra" + ''; + meta = with lib; { description = "A simple blackboard written in GTK"; longDescription = '' diff --git a/pkgs/applications/misc/activate-linux/default.nix b/pkgs/applications/misc/activate-linux/default.nix index 1a6da925d057..3515f190fe77 100644 --- a/pkgs/applications/misc/activate-linux/default.nix +++ b/pkgs/applications/misc/activate-linux/default.nix @@ -52,6 +52,11 @@ stdenv.mkDerivation (finalAttrs: { cp activate-linux $out/bin cp activate-linux.1 $out/share/man/man1 + install -Dm444 res/icon.png $out/share/icons/hicolor/128x128/apps/activate-linux.png + install -Dm444 res/activate-linux.desktop -t $out/share/applications + substituteInPlace $out/share/applications/activate-linux.desktop \ + --replace 'Icon=icon' 'Icon=activate-linux' + runHook postInstall ''; diff --git a/pkgs/applications/misc/fluxboxlauncher/default.nix b/pkgs/applications/misc/fluxboxlauncher/default.nix index 4794e14b4698..719f08db6bcd 100644 --- a/pkgs/applications/misc/fluxboxlauncher/default.nix +++ b/pkgs/applications/misc/fluxboxlauncher/default.nix @@ -46,6 +46,11 @@ python3.pkgs.buildPythonApplication rec { pygobject3 ]; + postInstall = '' + install -Dm444 fluxboxlauncher.desktop -t $out/share/applications + install -Dm444 fluxboxlauncher.svg -t $out/share/icons/hicolor/scalable/apps + ''; + meta = with lib; { description = "A Gui editor (gtk) to configure applications launching on a fluxbox session"; homepage = "https://github.com/mothsART/fluxboxlauncher"; diff --git a/pkgs/applications/misc/klayout/default.nix b/pkgs/applications/misc/klayout/default.nix index 0901e82f3d0b..a119dc6633f2 100644 --- a/pkgs/applications/misc/klayout/default.nix +++ b/pkgs/applications/misc/klayout/default.nix @@ -43,6 +43,9 @@ mkDerivation rec { postBuild = '' mkdir $out/bin mv $out/lib/klayout $out/bin/ + + install -Dm444 etc/klayout.desktop -t $out/share/applications + install -Dm444 etc/logo.png $out/share/icons/hicolor/256x256/apps/klayout.png ''; env.NIX_CFLAGS_COMPILE = toString [ "-Wno-parentheses" ]; diff --git a/pkgs/applications/misc/llpp/default.nix b/pkgs/applications/misc/llpp/default.nix index d7db123ef4e3..60c014bd10fd 100644 --- a/pkgs/applications/misc/llpp/default.nix +++ b/pkgs/applications/misc/llpp/default.nix @@ -40,6 +40,7 @@ stdenv.mkDerivation rec { install -d $out/bin install build/llpp $out/bin install misc/llpp.inotify $out/bin/llpp.inotify + install -Dm444 misc/llpp.desktop -t $out/share/applications '' + lib.optionalString stdenv.isLinux '' wrapProgram $out/bin/llpp \ --prefix PATH ":" "${xclip}/bin" diff --git a/pkgs/applications/misc/nwg-displays/default.nix b/pkgs/applications/misc/nwg-displays/default.nix index 18ba079088af..ade4b4214ff4 100644 --- a/pkgs/applications/misc/nwg-displays/default.nix +++ b/pkgs/applications/misc/nwg-displays/default.nix @@ -46,6 +46,11 @@ python310Packages.buildPythonApplication rec { dontWrapGApps = true; + postInstall = '' + install -Dm444 nwg-displays.svg -t $out/share/icons/hicolor/scalable/apps + install -Dm444 nwg-displays.desktop -t $out/share/applications + ''; + preFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}"); ''; diff --git a/pkgs/applications/misc/skytemple/default.nix b/pkgs/applications/misc/skytemple/default.nix index 43e41b253bf8..7e80070448e6 100644 --- a/pkgs/applications/misc/skytemple/default.nix +++ b/pkgs/applications/misc/skytemple/default.nix @@ -55,6 +55,11 @@ python3Packages.buildPythonApplication rec { doCheck = false; # there are no tests + postInstall = '' + install -Dm444 org.skytemple.SkyTemple.desktop -t $out/share/applications + install -Dm444 installer/skytemple.ico $out/share/icons/hicolor/256x256/apps/org.skytemple.SkyTemple.ico + ''; + meta = with lib; { homepage = "https://github.com/SkyTemple/skytemple"; description = "ROM hacking tool for Pokémon Mystery Dungeon Explorers of Sky"; diff --git a/pkgs/applications/misc/system76-keyboard-configurator/default.nix b/pkgs/applications/misc/system76-keyboard-configurator/default.nix index 21cec72c5f80..737c713fb79c 100644 --- a/pkgs/applications/misc/system76-keyboard-configurator/default.nix +++ b/pkgs/applications/misc/system76-keyboard-configurator/default.nix @@ -30,6 +30,11 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-S4+cS4m69nqDN2h0vwyO35fFFBEa0Rcxx0XDBfSNLp0="; + postInstall = '' + install -Dm444 linux/com.system76.keyboardconfigurator.desktop -t $out/share/applications + cp -r data/icons $out/share + ''; + meta = with lib; { description = "Keyboard configuration application for System76 keyboards and laptops"; homepage = "https://github.com/pop-os/keyboard-configurator"; diff --git a/pkgs/applications/misc/xygrib/default.nix b/pkgs/applications/misc/xygrib/default.nix index f3a0f25552d9..f7b3f6837f7c 100644 --- a/pkgs/applications/misc/xygrib/default.nix +++ b/pkgs/applications/misc/xygrib/default.nix @@ -26,6 +26,10 @@ stdenv.mkDerivation rec { wrapQtApp $out/XyGrib/XyGrib mkdir -p $out/bin ln -s $out/XyGrib/XyGrib $out/bin/xygrib + install -Dm444 $src/debian/xygrib.png -t $out/share/icons/hicolor/32x32/apps + install -Dm444 $src/debian/xygrib.desktop -t $out/share/applications + substituteInPlace $out/share/applications/xygrib.desktop \ + --replace 'Exec=XyGrib' 'Exec=xygrib' ''; meta = with lib; { diff --git a/pkgs/applications/networking/protonmail-bridge/default.nix b/pkgs/applications/networking/protonmail-bridge/default.nix index 7d53cbbcb8da..c5cf2d996487 100644 --- a/pkgs/applications/networking/protonmail-bridge/default.nix +++ b/pkgs/applications/networking/protonmail-bridge/default.nix @@ -37,6 +37,8 @@ buildGoModule rec { postInstall = '' mv $out/bin/Desktop-Bridge $out/bin/protonmail-bridge # The cli is named like that in other distro packages + install -Dm444 dist/proton-bridge.desktop -t $out/share/applications + install -Dm444 dist/bridge.svg $out/share/icons/hicolor/scalable/apps/protonmail-bridge.svg ''; meta = with lib; { diff --git a/pkgs/applications/networking/rymdport/default.nix b/pkgs/applications/networking/rymdport/default.nix index b9f4838f58bf..f6006992a6fd 100644 --- a/pkgs/applications/networking/rymdport/default.nix +++ b/pkgs/applications/networking/rymdport/default.nix @@ -41,6 +41,15 @@ buildGoModule rec { IOKit ]; + postInstall = '' + for res in $(ls internal/assets/icons | sed -e 's/icon-//g' -e 's/.png//g'); do + install -Dm444 internal/assets/icons/icon-$res.png \ + $out/share/icons/hicolor/''${res}x''${res}/apps/io.github.jacalz.rymdport.png + done + install -Dm444 internal/assets/svg/icon.svg $out/share/icons/hicolor/scalable/apps/io.github.jacalz.rymdport.svg + install -Dm444 internal/assets/unix/io.github.jacalz.rymdport.desktop -t $out/share/applications + ''; + meta = { description = "Easy encrypted file, folder, and text sharing between devices"; homepage = "https://github.com/Jacalz/rymdport"; diff --git a/pkgs/applications/networking/sniffnet/default.nix b/pkgs/applications/networking/sniffnet/default.nix index afa496f5ab61..4bfb2d303050 100644 --- a/pkgs/applications/networking/sniffnet/default.nix +++ b/pkgs/applications/networking/sniffnet/default.nix @@ -50,6 +50,16 @@ rustPlatform.buildRustPackage rec { "--skip=secondary_threads::check_updates::tests::fetch_latest_release_from_github" ]; + postInstall = '' + for res in $(ls resources/packaging/linux/graphics | sed -e 's/sniffnet_//g' -e 's/x.*//g'); do + install -Dm444 resources/packaging/linux/graphics/sniffnet_''${res}x''${res}.png \ + $out/share/icons/hicolor/''${res}x''${res}/apps/sniffnet.png + done + install -Dm444 resources/packaging/linux/sniffnet.desktop -t $out/share/applications + substituteInPlace $out/share/applications/sniffnet.desktop \ + --replace 'Exec=/usr/bin/sniffnet' 'Exec=sniffnet' + ''; + postFixup = lib.optionalString stdenv.isLinux '' patchelf $out/bin/sniffnet \ --add-rpath ${lib.makeLibraryPath [ vulkan-loader xorg.libX11 ]} diff --git a/pkgs/applications/video/cutecapture/default.nix b/pkgs/applications/video/cutecapture/default.nix index 48d9c238964e..a588ddb38a8d 100644 --- a/pkgs/applications/video/cutecapture/default.nix +++ b/pkgs/applications/video/cutecapture/default.nix @@ -35,6 +35,8 @@ stdenv.mkDerivation (finalAttrs: { postInstall = '' install -Dm644 -t $out/lib/udev/rules.d 95-{3,}dscapture.rules + install -Dm444 -t $out/share/applications Cute{3,}DSCapture.desktop + install -Dm444 -t $out/share/icons/hicolor/128x128/apps Cute{3,}DSCapture.png ''; meta = with lib; { diff --git a/pkgs/applications/video/pipe-viewer/default.nix b/pkgs/applications/video/pipe-viewer/default.nix index 18e38122f27c..a63fcb8411e6 100644 --- a/pkgs/applications/video/pipe-viewer/default.nix +++ b/pkgs/applications/video/pipe-viewer/default.nix @@ -67,6 +67,11 @@ buildPerlModule rec { ]; dontWrapGApps = true; + + postInstall = '' + cp -r share/* $out/share + ''; + postFixup = '' wrapProgram "$out/bin/pipe-viewer" \ --prefix PATH : "${lib.makeBinPath [ ffmpeg wget youtube-dl yt-dlp ]}" diff --git a/pkgs/tools/games/ajour/default.nix b/pkgs/tools/games/ajour/default.nix index bf783c7f4776..0f90a794987e 100644 --- a/pkgs/tools/games/ajour/default.nix +++ b/pkgs/tools/games/ajour/default.nix @@ -70,6 +70,12 @@ in rustPlatform.buildRustPackage rec { libxkbcommon ]; + postInstall = '' + mkdir -p $out/share + cp -r resources/logo $out/share/icons + install -Dm444 resources/linux/ajour.desktop -t $out/share/applications + ''; + fixupPhase = '' patchelf --set-rpath "${lib.makeLibraryPath rpathLibs}:$(patchelf --print-rpath $out/bin/ajour)" $out/bin/ajour wrapProgram $out/bin/ajour --prefix PATH ":" ${lib.makeBinPath [ zenity kdialog ]}