poptracker: Add XDG Desktop entry

This commit is contained in:
Pyrox 2024-07-12 22:20:31 -04:00
parent ff5c8f6cc3
commit b3da0a15ad
No known key found for this signature in database
GPG Key ID: 8CDF3F7CAA53A0F5
2 changed files with 25 additions and 2 deletions

View File

@ -138,3 +138,6 @@ acd0e3898feb321cb9a71a0fd376f1157d0f4553
# azure-cli: move to by-name, nixfmt #325950 # azure-cli: move to by-name, nixfmt #325950
96cd538b68bd1d0a0a37979356d669abbba32ebc 96cd538b68bd1d0a0a37979356d669abbba32ebc
# poptracker: format with nixfmt-rfc-style (#326697)
ff5c8f6cc3d1f2e017e86d50965c14b71f00567b

View File

@ -10,6 +10,8 @@
which, which,
libsForQt5, libsForQt5,
makeWrapper, makeWrapper,
makeDesktopItem,
copyDesktopItems,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
@ -27,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ ./assets-path.diff ]; patches = [ ./assets-path.diff ];
postPatch = '' postPatch = ''
substituteInPlace src/poptracker.cpp --replace "@assets@" "$out/share/$pname/" substituteInPlace src/poptracker.cpp --replace "@assets@" "$out/share/poptracker/"
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
@ -35,6 +37,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ nativeBuildInputs = [
util-linux util-linux
makeWrapper makeWrapper
copyDesktopItems
]; ];
buildInputs = [ buildInputs = [
@ -53,16 +56,33 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -m555 -Dt $out/bin build/linux-x86_64/poptracker install -m555 -Dt $out/bin build/linux-x86_64/poptracker
install -m444 -Dt $out/share/${finalAttrs.pname} assets/* install -m444 -Dt $out/share/poptracker assets/*
wrapProgram $out/bin/poptracker --prefix PATH : ${ wrapProgram $out/bin/poptracker --prefix PATH : ${
lib.makeBinPath [ lib.makeBinPath [
which which
libsForQt5.kdialog libsForQt5.kdialog
] ]
} }
mkdir -p $out/share/icons/hicolor/{64x64,512x512}/apps
ln -s $out/share/poptracker/icon.png $out/share/icons/hicolor/64x64/apps/poptracker.png
ln -s $out/share/poptracker/icon512.png $out/share/icons/hicolor/512x512/apps/poptracker.png
runHook postInstall runHook postInstall
''; '';
desktopItems = [
(makeDesktopItem {
name = "poptracker";
desktopName = "PopTracker";
exec = "poptracker";
comment = "Universal, scriptable randomizer tracking solution";
icon = "poptracker";
categories = [
"Game"
"Utility"
];
})
];
meta = { meta = {
description = "Scriptable tracker for randomized games"; description = "Scriptable tracker for randomized games";
longDescription = '' longDescription = ''