2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-30 01:23:03 +00:00
nixpkgs/pkgs/applications/video/losslesscut-bin/build-from-windows.nix
Shamrock Lee bd2a5f009a losslesscut-bin: refactor the build expression
* appimage.nix -> build-from-appimage.nix to avoid confusion
* .appimage -> x86_64-appimage to allow packaging binaries for architectures
* Pass chromium flag --disable-seccomp-filter-sandbox to the executable
* Use hostPlatform instead of stdenvNoCC.hostPlatform
* Remove unnessesary intermediate variables
2022-12-08 13:57:55 +00:00

38 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";
});
}