about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-03-30 17:20:00 +0100
committerGitHub <noreply@github.com>2024-03-30 17:20:00 +0100
commit602a94f999d042f92372b02c2a62d40fb7d9a61c (patch)
tree25958261003d2b6c91e9c0f00a9e20f99eb02228 /pkgs/os-specific/darwin
parent3d8b76d951bff5baeb8000f4e7be842270000fe4 (diff)
parenta74d6c775b033359212fa141dbc59e7deae427e5 (diff)
Merge pull request #300024 from hraban/grandperspective/mainprogram
grandperspective: set mainProgram, link $out/bin
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r--pkgs/os-specific/darwin/grandperspective/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/os-specific/darwin/grandperspective/default.nix b/pkgs/os-specific/darwin/grandperspective/default.nix
index 0d57d4f277144..d1f468b9806b8 100644
--- a/pkgs/os-specific/darwin/grandperspective/default.nix
+++ b/pkgs/os-specific/darwin/grandperspective/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, undmg }:
+{ stdenv, lib, fetchurl, undmg, makeWrapper }:
 
 stdenv.mkDerivation (finalAttrs: {
   version = "3.4.1";
@@ -12,9 +12,13 @@ stdenv.mkDerivation (finalAttrs: {
 
   sourceRoot = "GrandPerspective.app";
   buildInputs = [ undmg ];
+  nativeBuildInputs = [ makeWrapper ];
+  # Create a trampoline script in $out/bin/ because a symlink doesn’t work for
+  # this app.
   installPhase = ''
-    mkdir -p "$out/Applications/GrandPerspective.app";
-    cp -R . "$out/Applications/GrandPerspective.app";
+    mkdir -p "$out/Applications/GrandPerspective.app" "$out/bin"
+    cp -R . "$out/Applications/GrandPerspective.app"
+    makeWrapper "$out/Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective" "$out/bin/grandperspective"
   '';
 
   meta = with lib; {
@@ -25,6 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
       space. It uses a so called tree map for visualisation. Each file is shown as a rectangle with an area proportional to
       the file's size. Files in the same folder appear together, but their placement is otherwise arbitrary.
     '';
+    mainProgram = "grandperspective";
     homepage = "https://grandperspectiv.sourceforge.net";
     license = licenses.gpl2Only;
     sourceProvenance = with sourceTypes; [ binaryNativeCode ];