Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, autoreconfHook
6, pkg-config
7
8, callPackage
9
10# for passthru.tests
11, imagemagick
12, libheif
13, imlib2Full
14, gst_all_1
15}:
16
17stdenv.mkDerivation (finalAttrs: rec {
18 version = "1.0.11";
19 pname = "libde265";
20
21 src = fetchFromGitHub {
22 owner = "strukturag";
23 repo = "libde265";
24 rev = "v${version}";
25 sha256 = "sha256-0aRUh5h49fnjBjy42A5fWYHnhnQ4CFoeSIXZilZewW8=";
26 };
27
28 patches = [
29 (fetchpatch {
30 name = "CVE-2023-27102.patch";
31 url = "https://github.com/strukturag/libde265/commit/0b1752abff97cb542941d317a0d18aa50cb199b1.patch";
32 sha256 = "sha256-q0NKuk2r5RQT9MJpRO3CTPj6VqYRBnffs9yZ+GM+lNc=";
33 })
34 (fetchpatch {
35 name = "CVE-2023-27103.patch";
36 url = "https://github.com/strukturag/libde265/commit/d6bf73e765b7a23627bfd7a8645c143fd9097995.patch";
37 sha256 = "sha256-vxciVzSuVCVDpdz+TKg2tMWp2ArubYji5GLaR9VP4F0=";
38 })
39 ];
40
41 nativeBuildInputs = [ autoreconfHook pkg-config ];
42
43 enableParallelBuilding = true;
44
45 passthru.tests = {
46 inherit imagemagick libheif imlib2Full;
47 inherit (gst_all_1) gst-plugins-bad;
48
49 test-corpus-decode = callPackage ./test-corpus-decode.nix {
50 libde265 = finalAttrs.finalPackage;
51 };
52 };
53
54 meta = {
55 homepage = "https://github.com/strukturag/libde265";
56 description = "Open h.265 video codec implementation";
57 license = lib.licenses.lgpl3;
58 platforms = lib.platforms.unix;
59 maintainers = with lib.maintainers; [ gebner ];
60 };
61})