depot/third_party/nixpkgs/pkgs/applications/video/losslesscut-bin/build-from-windows.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

37 lines
736 B
Nix

{ 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 = ''
7z x $src -oLosslessCut-win-x64
'';
sourceRoot = "LosslessCut-win-x64";
installPhase = ''
mkdir -p $out/bin $out/libexec
(cd .. && mv LosslessCut-win-x64 $out/libexec)
ln -s "$out/libexec/LosslessCut-win-x64/LosslessCut.exe" "$out/bin/LosslessCut.exe"
'';
meta = metaCommon // (with lib; {
platforms = platforms.windows;
mainProgram = "LosslessCut.exe";
});
}