mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 13:23:17 +00:00
3fda5be53f
* jetbrains.rust-rover: fix darwin install JetBrains doesn't guarantee that the macOS app will be called `${product}.app` so I modified the installPhase to copy *.app instead of ${product}.app, which fails on file does not exist for Rust Rover, which is `RustRover 2023.2 EAP.app` I've tested with some other JetBrains apps on darwin aarch64 and they continue to build as expected.
41 lines
706 B
Nix
41 lines
706 B
Nix
{ lib
|
|
, stdenvNoCC
|
|
, undmg
|
|
, ...
|
|
}:
|
|
|
|
{ meta
|
|
, pname
|
|
, product
|
|
, productShort ? product
|
|
, src
|
|
, version
|
|
, plugins ? [ ]
|
|
, buildNumber
|
|
, ...
|
|
}:
|
|
|
|
let
|
|
loname = lib.toLower productShort;
|
|
in
|
|
stdenvNoCC.mkDerivation {
|
|
inherit pname meta src version plugins;
|
|
passthru.buildNumber = buildNumber;
|
|
desktopName = product;
|
|
dontFixup = true;
|
|
installPhase = ''
|
|
runHook preInstall
|
|
APP_DIR="$out/Applications/${product}.app"
|
|
mkdir -p "$APP_DIR"
|
|
cp -Tr *.app "$APP_DIR"
|
|
mkdir -p "$out/bin"
|
|
cat << EOF > "$out/bin/${loname}"
|
|
open -na '$APP_DIR' --args "\$@"
|
|
EOF
|
|
chmod +x "$out/bin/${loname}"
|
|
runHook postInstall
|
|
'';
|
|
nativeBuildInputs = [ undmg ];
|
|
sourceRoot = ".";
|
|
}
|