From b2d450ed080984320db25e7ce674b5bbcacb3cfa Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 20 Dec 2022 15:51:24 +1000 Subject: [PATCH] let tic-80 compile on osx when there's no alsa --- pkgs/tic-80.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/tic-80.nix b/pkgs/tic-80.nix index 0c4e3894..4d9904f2 100644 --- a/pkgs/tic-80.nix +++ b/pkgs/tic-80.nix @@ -33,8 +33,7 @@ pkgs.stdenv.mkDerivation rec { mesa_glu mesa_glu freeglut - alsaLib - ]; + ] ++ lib.optional stdenv.isLinux alsaLib; configurePhase = '' echo [DIRECTORY] $(pwd) @@ -51,13 +50,21 @@ pkgs.stdenv.mkDerivation rec { mkdir -p $out/bin chmod a+x bin/tic80 cp -v bin/tic80 $out/bin + + # Create Desktop Item + mkdir -p "$out/share/applications" + ln -s "${desktopItem}"/share/applications/* "$out/share/applications/" + + mkdir -p "$out/share/icons/hicolor/128x128/apps" # the long folder path is crucial, just using $out/share/icons does not work + ln -s "$out/build/linux/tic80.png" "$out/share/icons/hicolor/128x128/apps/tic-80.png" ''; - tic80Item = pkgs.makeDesktopItem { + desktopItem = pkgs.makeDesktopItem { name = "TIC-80"; - exec = "tic80"; + exec = "tic80 %U"; comment = "Tiny Computer"; categories = [ "Development" "Game" ]; desktopName = "TIC-80"; + icon = "tic-80"; }; }