2022-02-01 03:40:45 +01:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, undmg
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
{ meta
|
2022-03-22 17:57:23 +01:00
|
|
|
, pname
|
2022-02-01 03:40:45 +01:00
|
|
|
, product
|
|
|
|
, productShort ? product
|
|
|
|
, src
|
|
|
|
, version
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
loname = lib.toLower productShort;
|
|
|
|
in
|
|
|
|
stdenvNoCC.mkDerivation {
|
2022-03-22 17:57:23 +01:00
|
|
|
inherit pname meta src version;
|
2022-02-01 03:40:45 +01:00
|
|
|
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 = ".";
|
|
|
|
}
|