losslesscut-bin: *-dmg: refactor

Run pre- and post- hooks.

Utilize $sourceRoot.

(cherry picked from commit c47da5739f)
This commit is contained in:
Yueh-Shun Li 2024-06-07 13:06:53 +08:00 committed by github-actions[bot]
parent 2b421d64d2
commit 1f6114c54a

View File

@ -24,10 +24,13 @@ stdenvNoCC.mkDerivation {
sourceRoot = "LosslessCut.app";
installPhase = ''
mkdir -p "$out/Applications/LosslessCut.app"
cp -R . "$out/Applications/LosslessCut.app"
runHook preInstall
mkdir -p "$out/Applications"
cd ..
mv "$sourceRoot" "$out/Applications"
mkdir -p "$out/bin"
ln -s "$out/Applications/LosslessCut.app/Contents/MacOS/LosslessCut" "$out/bin/losslesscut"
ln -s "$out/Applications/$(basename "$sourceRoot")/Contents/MacOS/LosslessCut" "$out/bin/losslesscut"
runHook postInstall
'';
meta = metaCommon // (with lib; {