build-support/vm: don't depend on the "unix" module (#375355)
[NixPkgs.git] / pkgs / by-name / lo / losslesscut-bin / build-from-windows.nix
blob87d398d28ef02236fa86bd8293fe4b2963f85f09
2   lib,
3   stdenvNoCC,
4   fetchurl,
5   p7zip,
6   pname,
7   version,
8   hash,
9   metaCommon ? { },
12 stdenvNoCC.mkDerivation {
13   inherit pname version;
15   src = fetchurl {
16     url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-win-x64.7z";
17     inherit hash;
18   };
20   nativeBuildInputs = [ p7zip ];
22   unpackPhase = ''
23     runHook preUnpack
24     7z x "$src" -o"$sourceRoot"
25     runHook postUnpack
26   '';
28   sourceRoot = "LosslessCut-win-x64";
30   installPhase = ''
31     runHook preInstall
32     mkdir -p "$out/bin" "$out/libexec"
33     cd ..
34     mv "$sourceRoot" "$out/libexec"
35     ln -s "$out/libexec/$(basename "$sourceRoot")/LosslessCut.exe" "$out/bin/LosslessCut.exe"
36     runHook postInstall
37   '';
39   meta =
40     metaCommon
41     // (with lib; {
42       platforms = platforms.windows;
43       mainProgram = "LosslessCut.exe";
44     });