diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2022-01-24 01:06:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 01:06:37 +0100 |
commit | 983a352d8fc78a5a8439a1c20e772323cf149765 (patch) | |
tree | 286de40c5734138ce9ebfac5782d4392aa197699 /pkgs | |
parent | 08402fa922c79553724181a840a54c86d9f40ae0 (diff) | |
parent | 8b86f9816dd46a8b29088ddd91b0a590829f282a (diff) |
Merge pull request #143687 from Synthetica9/handbrake-installcheck
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/video/handbrake/default.nix | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/pkgs/applications/video/handbrake/default.nix b/pkgs/applications/video/handbrake/default.nix index e7ac4881b56cf..841604399ed36 100644 --- a/pkgs/applications/video/handbrake/default.nix +++ b/pkgs/applications/video/handbrake/default.nix @@ -10,7 +10,10 @@ { stdenv , lib , fetchFromGitHub -, nixosTests + # For tests +, testVersion +, runCommand +, fetchurl # Main build tools , pkg-config , autoconf @@ -103,7 +106,7 @@ let inherit (lib) optional optionals optionalString versions; in -stdenv.mkDerivation rec { +let self = stdenv.mkDerivation rec { pname = "handbrake"; inherit version src; @@ -211,7 +214,23 @@ stdenv.mkDerivation rec { makeFlags = [ "--directory=build" ]; passthru.tests = { - basic-conversion = nixosTests.handbrake; + basic-conversion = + let + # Big Buck Bunny example, licensed under CC Attribution 3.0. + testMkv = fetchurl { + url = "https://github.com/Matroska-Org/matroska-test-files/blob/cf0792be144ac470c4b8052cfe19bb691993e3a2/test_files/test1.mkv?raw=true"; + sha256 = "1hfxbbgxwfkzv85pvpvx55a72qsd0hxjbm9hkl5r3590zw4s75h9"; + }; + in + runCommand "${pname}-${version}-basic-conversion" { nativeBuildInputs = [ self ]; } '' + mkdir -p $out + cd $out + HandBrakeCLI -i ${testMkv} -o test.mp4 -e x264 -q 20 -B 160 + test -e test.mp4 + HandBrakeCLI -i ${testMkv} -o test.mkv -e x264 -q 20 -B 160 + test -e test.mkv + ''; + version = testVersion { package = self; command = "HandBrakeCLI --version"; }; }; meta = with lib; { @@ -230,4 +249,5 @@ stdenv.mkDerivation rec { platforms = with platforms; unix; broken = stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13"; }; -} +}; +in self |