2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchurl
|
|
|
|
, p7zip
|
|
|
|
, pname
|
|
|
|
, version
|
|
|
|
, hash
|
|
|
|
, metaCommon ? { }
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-win-x64.7z";
|
|
|
|
inherit hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ p7zip ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2024-06-20 14:57:18 +00:00
|
|
|
runHook preUnpack
|
|
|
|
7z x "$src" -o"$sourceRoot"
|
|
|
|
runHook postUnpack
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
sourceRoot = "LosslessCut-win-x64";
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-06-20 14:57:18 +00:00
|
|
|
runHook preInstall
|
|
|
|
mkdir -p "$out/bin" "$out/libexec"
|
|
|
|
cd ..
|
|
|
|
mv "$sourceRoot" "$out/libexec"
|
|
|
|
ln -s "$out/libexec/$(basename "$sourceRoot")/LosslessCut.exe" "$out/bin/LosslessCut.exe"
|
|
|
|
runHook postInstall
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = metaCommon // (with lib; {
|
|
|
|
platforms = platforms.windows;
|
|
|
|
mainProgram = "LosslessCut.exe";
|
|
|
|
});
|
|
|
|
}
|