5e7c2d6cef
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
40 lines
706 B
Nix
40 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 = ".";
|
|
}
|