Merge pull request #319394 from h7x4/treewide-add-missing-desktop-items

treewide: create/install missing desktop items + icons
This commit is contained in:
Weijia Wang 2024-06-14 23:30:59 +02:00 committed by GitHub
commit 89b5ffbe58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 54 additions and 2 deletions

View File

@ -42,6 +42,10 @@ stdenv.mkDerivation (finalAttrs: {
postInstall = ''
wrapProgram $out/bin/cryptor \
--prefix PATH : "${lib.makeBinPath [ gocryptfs ]}"
install -Dm444 $src/resources/misc/cryptor.desktop -t $out/share/applications
substituteInPlace $out/share/applications/cryptor.desktop \
--replace-warn '/usr/bin/cryptor' 'cryptor'
'';
meta = {

View File

@ -9,6 +9,8 @@
, libXinerama
, libXext
, libXcursor
, makeDesktopItem
, copyDesktopItems
}:
stdenv.mkDerivation (finalAttrs: {
@ -23,7 +25,10 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [
pkg-config
copyDesktopItems
];
buildInputs = [
alsa-lib
freetype
@ -53,6 +58,8 @@ stdenv.mkDerivation (finalAttrs: {
install -Dt $out/share/ShowMIDI/themes Themes/*
install -D Design/icon.png $out/share/icons/hicolor/1024x1024/apps/show-midi.png
mkdir -p $out/bin $out/lib/lv2 $out/lib/vst3
cd Builds/LinuxMakefile/build/
cp -r ShowMIDI.lv2 $out/lib/lv2
@ -62,6 +69,16 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
desktopItems = [(makeDesktopItem {
name = "ShowMIDI";
exec = finalAttrs.meta.mainProgram;
comment = finalAttrs.meta.description;
type = "Application";
icon = "show-midi";
desktopName = "ShowMIDI";
categories = [ "Audio" ];
})];
# JUCE dlopens these, make sure they are in rpath
# Otherwise, segfault will happen
env.NIX_LDFLAGS = toString [

View File

@ -15,9 +15,15 @@ let
exec = "unciv";
comment = "An open-source Android/Desktop remake of Civ V";
desktopName = "Unciv";
icon = "unciv";
categories = [ "Game" ];
};
desktopIcon = fetchurl {
url = "https://github.com/yairm210/Unciv/blob/4.11.16/extraImages/Icons/Unciv%20icon%20v6.png?raw=true";
hash = "sha256-Zuz+HGfxjGviGBKTiHdIFXF8UMRLEIfM8f+LIB/xonk=";
};
envLibPath = lib.makeLibraryPath (lib.optionals stdenv.isLinux [
libGL
libpulseaudio
@ -46,6 +52,8 @@ stdenv.mkDerivation rec {
--prefix PATH : ${lib.makeBinPath [ jre ]} \
--add-flags "-jar ${src}"
install -Dm444 ${desktopIcon} $out/share/icons/hicolor/512x512/apps/unciv.png
runHook postInstall
'';

View File

@ -40,6 +40,11 @@ python3Packages.buildPythonApplication rec {
wxpython
];
postInstall = ''
install -Dm444 yt-dlg.desktop -t $out/share/applications
cp -r youtube_dl_gui/data/* $out/share
'';
meta = {
description = "Cross platform front-end GUI of the popular youtube-dl written in wxPython";
homepage = "https://oleksis.github.io/youtube-dl-gui";

View File

@ -25,6 +25,8 @@
, withQt ? true
, qt5
, zip
, makeDesktopItem
, copyDesktopItems
}:
let
dlopenBuildInputs = []
@ -58,7 +60,11 @@ in stdenv.mkDerivation rec {
strictDeps = true;
nativeBuildInputs = lib.optionals withQt [ zip qt5.wrapQtAppsHook ];
nativeBuildInputs = lib.optionals withQt [
zip
qt5.wrapQtAppsHook
copyDesktopItems
];
buildInputs = staticBuildInputs ++ dlopenBuildInputs;
@ -118,6 +124,7 @@ in stdenv.mkDerivation rec {
install -Dm755 bin/linux/release/zxtune123 -t $out/bin
'' + lib.optionalString withQt ''
install -Dm755 bin/linux/release/zxtune-qt -t $out/bin
install -Dm755 apps/zxtune-qt/res/theme_default/zxtune.png -t $out/share/icons/hicolor/48x48/apps
'' + ''
runHook postInstall
'';
@ -128,6 +135,17 @@ in stdenv.mkDerivation rec {
wrapQtApp "$out/bin/zxtune-qt"
'';
desktopItems = lib.optionals withQt [(makeDesktopItem {
name = "ZXTune";
exec = "zxtune-qt";
icon = "zxtune";
desktopName = "ZXTune";
genericName = "ZXTune";
comment = meta.description;
categories = [ "Audio" ];
type = "Application";
})];
meta = with lib; {
description = "Crossplatform chiptunes player";
longDescription = ''