about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libde265/test-corpus-decode.nix
blob: 763c93e6a993b111d06cbe1385ae322a0eb4feb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, stdenv
, fetchFromGitHub
, libde265
}:

stdenv.mkDerivation {
  pname = "libde265-test-corpus-decode";
  version = "unstable-2020-02-19";

  src = fetchFromGitHub {
    owner = "strukturag";
    repo = "libde265-data";
    rev = "bdfdfdbe682f514c5185c270c74eac42731a7fa8";
    sha256 = "sha256-fOgu7vMoyH30Zzbkfm4a6JVDZtYLO/0R2syC2Wux+Z8=";
  };

  dontConfigure = true;
  dontBuild = true;

  doCheck = true;
  nativeCheckInputs = [ libde265 ];
  # based on invocations in https://github.com/strukturag/libde265/blob/0b1752abff97cb542941d317a0d18aa50cb199b1/scripts/ci-run.sh
  checkPhase = ''
    echo "Single-threaded:"
    find . -name '*.bin' | while read f; do
      echo "Decoding $f"
      dec265 -q -c $f
      dec265 -0 -q -c $f
      dec265 -q --disable-deblocking --disable-sao $f
    done
    echo "Multi-threaded:"
    find RandomAccess/ -name '*.bin' | while read f; do
      echo "Decoding $f"
      dec265 -t 4 -q -c $f
      dec265 -t 4 -0 -q -c $f
      dec265 -t 4 -q --disable-deblocking --disable-sao $f
    done
  '';
  # a larger corpus of files can be found
  # as an ubuntu package libde265-teststreams @
  # https://launchpad.net/~strukturag/+archive/ubuntu/libde265/+packages
  # but it is *much* larger

  installPhase = ''
    touch $out
  '';
}