-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTM: fix meta.mainProgram field #224435
UTM: fix meta.mainProgram field #224435
Conversation
Fixes `nix run nixpkgs#utm`
oh hmm.. I believe Perhaps we can make a wrapper, like nixpkgs/pkgs/os-specific/darwin/swiftbar/default.nix Lines 30 to 31 in 2448665
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps something like this (GitHub won't let me leave suggestions on the appropriate lines, sorry):
diff --git a/pkgs/os-specific/darwin/utm/default.nix b/pkgs/os-specific/darwin/utm/default.nix
index 2e21945288e..c88005f09f2 100644
--- a/pkgs/os-specific/darwin/utm/default.nix
+++ b/pkgs/os-specific/darwin/utm/default.nix
@@ -1,5 +1,6 @@
{ lib
, undmg
+, makeWrapper
, fetchurl
, stdenvNoCC
}:
@@ -13,12 +14,23 @@ stdenvNoCC.mkDerivation rec {
hash = "sha256-YOmTf50UUvvh4noWnmV6WsoWSua0tpWTgLTg+Cdr3bQ=";
};
- nativeBuildInputs = [ undmg ];
+ nativeBuildInputs = [ undmg makeWrapper ];
sourceRoot = ".";
installPhase = ''
+ runHook preInstall
+
mkdir -p $out/Applications
cp -r *.app $out/Applications
+
+ mkdir -p $out/bin
+ for bin in $out/Applications/UTM.app/Contents/MacOS/*; do
+ # Symlinking `UTM` doesn't work; seems to look for files in the wrong
+ # place
+ makeWrapper $bin "$out/bin/$(basename $bin)"
+ done
+
+ runHook postInstall
'';
meta = with lib; {
(The wildcard on MacOS/*
is so that utmctl
gets picked up; I think it'd be nice to have a passthru test that makes sure that this runs just so we have some basic testing for this package — I can take care of that in a follow up PR though)
You sound like you know more about it than I do so if your fix handles |
Suggested by github user rrbutani in NixOS#224435 (review)
Pushed a new patch with your changes and it seems to work. |
Result of |
Description of changes
Fixes
nix run nixpkgs#utm
To test:
Once merged, that will be
nix run nixpkgs#utm
As far as I know
nix run
is the only actual use formeta.mainProgram
, but if there's anything else that I overlooked please let me know.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)