zoxide: 0.9.6 -> 0.9.7 (#380745)
[NixPkgs.git] / pkgs / by-name / xe / xeve / package.nix
blobf7513d9c12986e68d889d7b9969414baa170d862
2   lib,
3   fetchFromGitHub,
4   fetchpatch2,
5   gitUpdater,
6   stdenv,
7   cmake,
8 }:
10 stdenv.mkDerivation (finalAttrs: {
11   pname = "xeve";
12   version = "0.5.1";
14   src = fetchFromGitHub {
15     owner = "mpeg5";
16     repo = "xeve";
17     rev = "v${finalAttrs.version}";
18     hash = "sha256-/DcYv2fInr8MN1wpOgJHcFWEvW//7SIXccheRfeaTHM=";
19   };
21   patches =
22     builtins.map fetchpatch2 [
23       {
24         url = "https://github.com/mpeg5/xeve/commit/954ed6e0494cd2438fd15c717c0146e88e582b33.patch?full_index=1";
25         hash = "sha256-//NtOUm1fqPFvOM955N6gF+QgmOdmuVunwx/3s/G/J8=";
26       }
27       {
28         url = "https://github.com/mpeg5/xeve/commit/07a6f2a6d13dfaa0f73c3752f8cd802c251d8252.patch?full_index=1";
29         hash = "sha256-P9J7Y9O/lb/MSa5oCfft7z764AbLBLZnMmrmPEZPcws=";
30       }
31       {
32         url = "https://github.com/mpeg5/xeve/commit/0a0f3bd397161253b606bdbeaa518fbe019d24e1.patch?full_index=1";
33         hash = "sha256-PoZpE64gWkTUS4Q+SK+DH1I1Ac0UEzwwnlvpYN16hsI=";
34       }
35       {
36         url = "https://github.com/mpeg5/xeve/commit/e029f1619ecedbda152b8680641fa10eea9eeace.patch?full_index=1";
37         hash = "sha256-ooIBzNtGSjDgYvTzA8T0KB+QzsUiy14mPpoRqrHF3Pg=";
38       }
39     ]
40     ++ [
41       # Backport to 0.5.0 of upstream patch c564ac77c103dbba472df3e13f4733691fd499ed
42       ./0001-CMakeLists.txt-Disable-static-linking-on-Darwin.patch
44       # Rejected upstream, can be dropped when a fix for
45       # https://github.com/mpeg5/xeve/pull/123 is in a version bump.
46       ./0002-sse2neon-Cast-to-variable-type.patch
47     ];
49   postPatch = ''
50     echo v$version > version.txt
51   '';
53   nativeBuildInputs = [ cmake ];
55   cmakeFlags =
56     let
57       inherit (lib) cmakeBool cmakeFeature optional;
58       inherit (stdenv.hostPlatform) isAarch64 isDarwin;
59     in
60     optional isAarch64 (cmakeBool "ARM" true)
61     ++ optional isDarwin (cmakeFeature "CMAKE_SYSTEM_NAME" "Darwin");
63   env.NIX_CFLAGS_COMPILE = builtins.toString (
64     builtins.map (w: "-Wno-" + w) [
65       # Patch addressing an if without a body was rejected upstream, third
66       # line-based comment in this thread, https://github.com/mpeg5/xeve/pull/122#pullrequestreview-2187744305
67       # Evaluate on version bump whether still necessary.
68       "empty-body"
70       # Evaluate on version bump whether still necessary.
71       "parentheses-equality"
72       "unknown-warning-option"
74       # Fixed upstream in 325fd9f94f3fdf0231fa931a31ebb72e63dc3498 but might
75       # change behavior, therefore opted to leave it out for now.
76       "for-loop-analysis"
77     ]
78   );
80   postInstall = ''
81     ln $dev/include/xeve/* $dev/include/
82   '';
84   outputs = [
85     "out"
86     "lib"
87     "dev"
88   ];
90   passthru.updateScript = gitUpdater { rev-prefix = "v"; };
92   meta = {
93     homepage = "https://github.com/mpeg5/xeve";
94     description = "eXtra-fast Essential Video Encoder, MPEG-5 EVC";
95     license = lib.licenses.bsd3;
96     mainProgram = "xeve_app";
97     maintainers = with lib.maintainers; [ jopejoe1 ];
98     platforms = lib.platforms.all;
99     broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
100   };