From 15e4102a6a0a006df68a97ddad275e7d7f63c075 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Wed, 9 Oct 2024 21:19:36 +0200 Subject: [PATCH 1/5] vvenc: init at 1.12.0 --- pkgs/by-name/vv/vvenc/package.nix | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pkgs/by-name/vv/vvenc/package.nix diff --git a/pkgs/by-name/vv/vvenc/package.nix b/pkgs/by-name/vv/vvenc/package.nix new file mode 100644 index 000000000000..774645e29ff9 --- /dev/null +++ b/pkgs/by-name/vv/vvenc/package.nix @@ -0,0 +1,48 @@ +{ + lib, + fetchFromGitHub, + stdenv, + gitUpdater, + testers, + cmake, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "vvenc"; + version = "1.12.0"; + + outputs = [ + "out" + "lib" + "dev" + ]; + + src = fetchFromGitHub { + owner = "fraunhoferhhi"; + repo = "vvenc"; + rev = "v${finalAttrs.version}"; + hash = "sha256-C7ApayhubunkXBqJ/EqntaFPn6zk8rZ9fUqg7kbhvAk="; + }; + + nativeBuildInputs = [ cmake ]; + + cmakeFlags = [ + (lib.cmakeBool "VVENC_INSTALL_FULLFEATURE_APP" true) + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + ]; + + passthru = { + updateScript = gitUpdater { rev-prefix = "v"; }; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + + meta = { + homepage = "https://github.com/fraunhoferhhi/vvenc"; + description = "Fraunhofer Versatile Video Encoder"; + license = lib.licenses.bsd3Clear; + mainProgram = "vvencapp"; + pkgConfigModules = [ "libvvenc" ]; + maintainers = with lib.maintainers; [ jopejoe1 ]; + platforms = lib.platforms.all; + }; +}) From cb2ef37af34beee3624db963653a8a36e1170006 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Wed, 9 Oct 2024 22:05:36 +0200 Subject: [PATCH 2/5] lcevcdec: init at 3.2.1 --- pkgs/by-name/lc/lcevcdec/package.nix | 104 +++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 pkgs/by-name/lc/lcevcdec/package.nix diff --git a/pkgs/by-name/lc/lcevcdec/package.nix b/pkgs/by-name/lc/lcevcdec/package.nix new file mode 100644 index 000000000000..20526efebc91 --- /dev/null +++ b/pkgs/by-name/lc/lcevcdec/package.nix @@ -0,0 +1,104 @@ +{ + cmake, + copyPkgconfigItems, + fetchFromGitHub, + fmt, + git, + gitUpdater, + gtest, + lib, + makePkgconfigItem, + pkg-config, + python3, + range-v3, + rapidjson, + stdenv, + testers, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "lcevcdec"; + version = "3.2.1"; + + outputs = [ + "out" + "lib" + "dev" + ]; + + src = fetchFromGitHub { + owner = "v-novaltd"; + repo = "LCEVCdec"; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-Nf0YntB1A3AH0MTXlfUHhxYbzZqeB0EH9Fe9Xrqdsts="; + }; + + postPatch = '' + substituteInPlace cmake/tools/version_files.py \ + --replace-fail "args.git_version" '"${finalAttrs.version}"' \ + --replace-fail "args.git_hash" '"${finalAttrs.src.rev}"' \ + --replace-fail "args.git_date" '"1970-01-01"' + ''; + + env = { + includedir = "${placeholder "dev"}/include"; + libdir = "${placeholder "out"}/lib"; + }; + + pkgconfigItems = [ + (makePkgconfigItem rec { + name = "lcevc_dec"; + inherit (finalAttrs) version; + libs = [ + "-L${variables.libdir}" + "-llcevc_dec_api" + ]; + libsPrivate = [ + "-lpthread" + "-llcevc_dec_core" + ]; + cflags = [ + "-I${variables.includedir}" + ]; + variables = { + prefix = "@dev@"; + includedir = "@includedir@"; + libdir = "@libdir@"; + }; + }) + ]; + + nativeBuildInputs = [ + cmake + python3 + git + pkg-config + copyPkgconfigItems + ]; + + buildInputs = [ + rapidjson + fmt + range-v3 + ]; + + cmakeFlags = [ + (lib.cmakeFeature "VN_SDK_FFMPEG_LIBS_PACKAGE" "") + (lib.cmakeBool "VN_SDK_UNIT_TESTS" false) + (lib.cmakeBool "VN_SDK_SAMPLE_SOURCE" false) + ]; + + passthru = { + updateScript = gitUpdater { }; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + + meta = { + homepage = "https://github.com/v-novaltd/LCEVCdec"; + description = "MPEG-5 LCEVC Decoder"; + license = lib.licenses.bsd3Clear; + pkgConfigModules = [ "lcevc_dec" ]; + maintainers = with lib.maintainers; [ jopejoe1 ]; + platforms = lib.platforms.all; + }; +}) From 46c012331f624423e3ac968c252eb54ce4558b67 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Wed, 9 Oct 2024 21:48:28 +0200 Subject: [PATCH 3/5] ffmpeg: add vvenc option --- pkgs/development/libraries/ffmpeg/generic.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index e6863e849324..b336948d6fe3 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -127,6 +127,7 @@ , withVpl ? false # Hardware acceleration via intel libvpl , withVpx ? withHeadlessDeps && stdenv.buildPlatform == stdenv.hostPlatform # VP8 & VP9 de/encoding , withVulkan ? withSmallDeps && !stdenv.hostPlatform.isDarwin +, withVvenc ? withFullDeps && lib.versionAtLeast version "7.1" # H.266/VVC encoding , withWebp ? withHeadlessDeps # WebP encoder , withX264 ? withHeadlessDeps && withGPL # H.264/AVC encoder , withX265 ? withHeadlessDeps && withGPL # H.265/HEVC encoder @@ -315,6 +316,7 @@ , vo-amrwbenc , vulkan-headers , vulkan-loader +, vvenc , x264 , x265 , xavs @@ -665,6 +667,9 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withVorbis "libvorbis") (enableFeature withVpx "libvpx") (enableFeature withVulkan "vulkan") + ] ++ optionals (versionAtLeast version "7.1") [ + (enableFeature withVvenc "libvvenc") + ] ++ [ (enableFeature withWebp "libwebp") (enableFeature withX264 "libx264") (enableFeature withX265 "libx265") @@ -808,6 +813,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withVpl [ libvpl ] ++ optionals withVpx [ libvpx ] ++ optionals withVulkan [ vulkan-headers vulkan-loader ] + ++ optionals withVvenc [ vvenc ] ++ optionals withWebp [ libwebp ] ++ optionals withX264 [ x264 ] ++ optionals withX265 [ x265 ] From 22faf0ac9e16a5a2457944be5a42543591addb0c Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Tue, 15 Oct 2024 15:56:42 +0200 Subject: [PATCH 4/5] ffmpeg: add lc3 option --- pkgs/development/libraries/ffmpeg/generic.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index b336948d6fe3..89aa6c64d640 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -75,6 +75,7 @@ , withJack ? withFullDeps && !stdenv.hostPlatform.isDarwin # Jack audio , withJxl ? withFullDeps && lib.versionAtLeast version "5" # JPEG XL de/encoding , withLadspa ? withFullDeps # LADSPA audio filtering +, withLc3 ? withFullDeps && lib.versionAtLeast version "7.1" # LC3 de/encoding , withLcms2 ? withFullDeps # ICC profile support via lcms2 , withLzma ? withHeadlessDeps # xz-utils , withMetal ? false # Unfree and requires manual downloading of files @@ -263,6 +264,7 @@ , libilbc , libjack2 , libjxl +, liblc3 , libmodplug , libmysofa , libopenmpt @@ -603,6 +605,8 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withJxl "libjxl") ] ++ [ (enableFeature withLadspa "ladspa") + ] ++ optionals (versionAtLeast version "7.1") [ + (enableFeature withLc3 "liblc3") ] ++ optionals (versionAtLeast version "5.1") [ (enableFeature withLcms2 "lcms2") ] ++ [ @@ -766,6 +770,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withJack [ libjack2 ] ++ optionals withJxl [ libjxl ] ++ optionals withLadspa [ ladspaH ] + ++ optionals withLc3 [ liblc3 ] ++ optionals withLcms2 [ lcms2 ] ++ optionals withLzma [ xz ] ++ optionals withMfx [ intel-media-sdk ] From fdf2cbdc1c13df3c62d1ff2e48d1e6fbf5384f8f Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Tue, 15 Oct 2024 15:57:04 +0200 Subject: [PATCH 5/5] ffmpeg: add lcevcdec option --- pkgs/development/libraries/ffmpeg/generic.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 89aa6c64d640..bd029d80c890 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -76,6 +76,7 @@ , withJxl ? withFullDeps && lib.versionAtLeast version "5" # JPEG XL de/encoding , withLadspa ? withFullDeps # LADSPA audio filtering , withLc3 ? withFullDeps && lib.versionAtLeast version "7.1" # LC3 de/encoding +, withLcevcdec ? withFullDeps && lib.versionAtLeast version "7.1" # LCEVC decoding , withLcms2 ? withFullDeps # ICC profile support via lcms2 , withLzma ? withHeadlessDeps # xz-utils , withMetal ? false # Unfree and requires manual downloading of files @@ -247,6 +248,7 @@ , intel-media-sdk , ladspaH , lame +, lcevcdec , lcms2 , libaom , libaribcaption @@ -607,6 +609,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withLadspa "ladspa") ] ++ optionals (versionAtLeast version "7.1") [ (enableFeature withLc3 "liblc3") + (enableFeature withLcevcdec "liblcevc-dec") ] ++ optionals (versionAtLeast version "5.1") [ (enableFeature withLcms2 "lcms2") ] ++ [ @@ -771,6 +774,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withJxl [ libjxl ] ++ optionals withLadspa [ ladspaH ] ++ optionals withLc3 [ liblc3 ] + ++ optionals withLcevcdec [ lcevcdec ] ++ optionals withLcms2 [ lcms2 ] ++ optionals withLzma [ xz ] ++ optionals withMfx [ intel-media-sdk ]