diff --git a/pkgs/by-name/xe/xevd/package.nix b/pkgs/by-name/xe/xevd/package.nix new file mode 100644 index 000000000000..8cf6d20fbfe8 --- /dev/null +++ b/pkgs/by-name/xe/xevd/package.nix @@ -0,0 +1,63 @@ +{ + lib, + fetchFromGitHub, + fetchpatch2, + stdenv, + gitUpdater, + cmake, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "xevd"; + version = "0.4.1"; + + src = fetchFromGitHub { + owner = "mpeg5"; + repo = "xevd"; + rev = "v${finalAttrs.version}"; + hash = "sha256-+qC/BnP8o/kfl5ax+g1PohvXIJBL2gin/QZ9Gkvi0WU="; + }; + + patches = [ + (fetchpatch2 { + name = "fix dangling pointer error"; + url = "https://github.com/mpeg5/xevd/commit/13b86a74e26df979dd1cc3a1cb19bf1ac828e197.patch"; + sha256 = "sha256-CeSfhN78ldooyZ9H4F2ex9wTBFXuNZdBcnLdk7GqDXI="; + }) + (fetchpatch2 { + name = "fix invalid comparison of c_buf in write_y4m_header "; + url = "https://github.com/mpeg5/xevd/commit/e4ae0c567a6ec5e10c9f5ed44c61e4e3b6816c16.patch"; + sha256 = "sha256-9bG6hyIV/AZ0mRbd3Fc/c137Xm1i6NJ1IfuGadG0vUU="; + }) + ]; + + postPatch = '' + echo v$version > version.txt + ''; + + nativeBuildInputs = [ cmake ]; + + postInstall = '' + ln $dev/include/xevd/* $dev/include/ + ''; + + env.NIX_CFLAGS_COMPILE = toString [ "-lm" ]; + + outputs = [ + "out" + "lib" + "dev" + ]; + + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; + + meta = { + homepage = "https://github.com/mpeg5/xevd"; + description = "eXtra-fast Essential Video Decoder, MPEG-5 EVC"; + license = lib.licenses.bsd3; + mainProgram = "xevd_app"; + maintainers = with lib.maintainers; [ jopejoe1 ]; + platforms = lib.platforms.all; + broken = !stdenv.hostPlatform.isx86; + }; +}) diff --git a/pkgs/by-name/xe/xeve/package.nix b/pkgs/by-name/xe/xeve/package.nix new file mode 100644 index 000000000000..5132656e58c2 --- /dev/null +++ b/pkgs/by-name/xe/xeve/package.nix @@ -0,0 +1,49 @@ +{ + lib, + fetchFromGitHub, + gitUpdater, + stdenv, + cmake, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "xeve"; + version = "0.4.3"; + + src = fetchFromGitHub { + owner = "mpeg5"; + repo = "xeve"; + rev = "v${finalAttrs.version}"; + hash = "sha256-8YueEx2oIh24jV38bzpDlCVHNZB7HDOXeP5MANM8zBc="; + }; + + postPatch = '' + echo v$version > version.txt + ''; + + nativeBuildInputs = [ cmake ]; + + postInstall = '' + ln $dev/include/xeve/* $dev/include/ + ''; + + env.NIX_CFLAGS_COMPILE = toString [ "-lm" ]; + + outputs = [ + "out" + "lib" + "dev" + ]; + + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; + + meta = { + homepage = "https://github.com/mpeg5/xeve"; + description = "eXtra-fast Essential Video Encoder, MPEG-5 EVC"; + license = lib.licenses.bsd3; + mainProgram = "xeve_app"; + maintainers = with lib.maintainers; [ jopejoe1 ]; + platforms = lib.platforms.all; + broken = !stdenv.hostPlatform.isx86; + }; +}) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 977bee80fa09..85214a79e2d3 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -114,6 +114,8 @@ , withXcbShape ? withFullDeps # X11 grabbing shape rendering , withXcbShm ? withFullDeps # X11 grabbing shm communication , withXcbxfixes ? withFullDeps # X11 grabbing mouse rendering +, withXevd ? withFullDeps && lib.versionAtLeast version "7" && stdenv.hostPlatform.isx86 # MPEG-5 EVC decoding +, withXeve ? withFullDeps && lib.versionAtLeast version "7" && stdenv.hostPlatform.isx86 # MPEG-5 EVC encoding , withXlib ? withFullDeps # Xlib support , withXml2 ? withFullDeps # libxml2 support, for IMF and DASH demuxers , withXvid ? withHeadlessDeps && withGPL # Xvid encoder, native encoder exists @@ -283,6 +285,8 @@ , x264 , x265 , xavs +, xevd +, xeve , xvidcore , xz , zeromq4 @@ -595,6 +599,10 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withXcbShape "libxcb-shape") (enableFeature withXcbShm "libxcb-shm") (enableFeature withXcbxfixes "libxcb-xfixes") + ] ++ optionals (versionAtLeast version "7") [ + (enableFeature withXevd "libxevd") + (enableFeature withXeve "libxeve") + ] ++ [ (enableFeature withXlib "xlib") (enableFeature withXml2 "libxml2") (enableFeature withXvid "libxvid") @@ -706,6 +714,8 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withX265 [ x265 ] ++ optionals withXavs [ xavs ] ++ optionals withXcb [ libxcb ] + ++ optionals withXevd [ xevd ] + ++ optionals withXeve [ xeve ] ++ optionals withXlib [ libX11 libXv libXext ] ++ optionals withXml2 [ libxml2 ] ++ optionals withXvid [ xvidcore ]