nixpkgs/pkgs/applications/editors/jetbrains/darwin.nix
run 456ce8dc34 jetbrains: fix darwin errors on macOS 13
As the jetbrains products have notarized binaries no further post processing is required more about this can be found in 3ea22dab7d
2023-09-12 00:25:18 +02:00

41 lines
717 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 "${product}.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 = ".";
}