depot/third_party/nixpkgs/pkgs/applications/editors/jetbrains/darwin.nix
Default email 8a45d4525b Project import generated by Copybara.
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
2022-03-30 11:31:56 +02:00

36 lines
657 B
Nix

{ lib
, stdenvNoCC
, undmg
, ...
}:
{ meta
, pname
, product
, productShort ? product
, src
, version
, ...
}:
let
loname = lib.toLower productShort;
in
stdenvNoCC.mkDerivation {
inherit pname meta src version;
desktopName = product;
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 = ".";
}