From c5977665f1cd7ffeb538d3f8a02fa45988b970c5 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Sat, 8 Nov 2025 02:01:20 -0800 Subject: [PATCH] add: New FFmpeg build deps (#7205) (#7224) (cherry picked from commit bca165cf7d2193acb3052e1e8fd1866da3bfe09b) Co-authored-by: Gilver --- anda/multimedia/vvdec/anda.hcl | 9 + anda/multimedia/vvdec/update.rhai | 4 + anda/multimedia/vvdec/vvdec.spec | 62 ++++++ anda/multimedia/xevd/anda.hcl | 9 + anda/multimedia/xevd/update.rhai | 1 + .../xevd/xevd-fix-build-on-non-x86.patch | 187 ++++++++++++++++++ anda/multimedia/xevd/xevd-link-libm.patch | 22 +++ anda/multimedia/xevd/xevd.spec | 76 +++++++ anda/multimedia/xeve/anda.hcl | 9 + anda/multimedia/xeve/update.rhai | 1 + .../multimedia/xeve/xeve-fix-build-i386.patch | 12 ++ .../xeve/xeve-fix-build-on-non-x86.patch | 186 +++++++++++++++++ anda/multimedia/xeve/xeve-link-libm.patch | 23 +++ anda/multimedia/xeve/xeve.spec | 81 ++++++++ 14 files changed, 682 insertions(+) create mode 100644 anda/multimedia/vvdec/anda.hcl create mode 100644 anda/multimedia/vvdec/update.rhai create mode 100644 anda/multimedia/vvdec/vvdec.spec create mode 100644 anda/multimedia/xevd/anda.hcl create mode 100644 anda/multimedia/xevd/update.rhai create mode 100644 anda/multimedia/xevd/xevd-fix-build-on-non-x86.patch create mode 100644 anda/multimedia/xevd/xevd-link-libm.patch create mode 100644 anda/multimedia/xevd/xevd.spec create mode 100644 anda/multimedia/xeve/anda.hcl create mode 100644 anda/multimedia/xeve/update.rhai create mode 100644 anda/multimedia/xeve/xeve-fix-build-i386.patch create mode 100644 anda/multimedia/xeve/xeve-fix-build-on-non-x86.patch create mode 100644 anda/multimedia/xeve/xeve-link-libm.patch create mode 100644 anda/multimedia/xeve/xeve.spec diff --git a/anda/multimedia/vvdec/anda.hcl b/anda/multimedia/vvdec/anda.hcl new file mode 100644 index 0000000000..9f202d5576 --- /dev/null +++ b/anda/multimedia/vvdec/anda.hcl @@ -0,0 +1,9 @@ +project pkg { + arches = ["x86_64", "aarch64", "i386"] + rpm { + spec = "vvdec.spec" + } + labels { + mock = 1 + } +} diff --git a/anda/multimedia/vvdec/update.rhai b/anda/multimedia/vvdec/update.rhai new file mode 100644 index 0000000000..2f96574d33 --- /dev/null +++ b/anda/multimedia/vvdec/update.rhai @@ -0,0 +1,4 @@ +let v = gh_tag("fraunhoferhhi/vvdec"); +if `[\d.]+-rc\d+`.find_all(v).len == 0 { + rpm.version(v); +} diff --git a/anda/multimedia/vvdec/vvdec.spec b/anda/multimedia/vvdec/vvdec.spec new file mode 100644 index 0000000000..13f36fadf2 --- /dev/null +++ b/anda/multimedia/vvdec/vvdec.spec @@ -0,0 +1,62 @@ +Name: vvdec +Version: 3.0.0 +Release: 2%{?dist} +Summary: VVdeC, the Fraunhofer Versatile Video Decoder +License: BSD-3-Clause +URL: https://github.com/fraunhoferhhi/%{name} + +Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc-c++ + +%description +VVdeC, the Fraunhofer Versatile Video Decoder, is a fast software H.266/VVC +decoder implementation supporting all features of the VVC Main10 profile. + +%package libs +Summary: VVdeC, the Fraunhofer Versatile Video Encoder %{name} libraries + +%description libs +The %{name}-devel package contains libraries and header files for developing +applications that use %{name}. This package contains the shared libraries. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 + +%build +%cmake \ +%ifarch %{ix86} + -DVVDEC_ENABLE_X86_SIMD=OFF \ +%endif + -DVVDEC_INSTALL_VVDECAPP=ON +%cmake_build + +%install +%cmake_install + +%files +%{_bindir}/%{name}app + +%files libs +%license LICENSE.txt +%doc README.md +%{_libdir}/lib%{name}.so.3 +%{_libdir}/lib%{name}.so.%{version} + +%files devel +%{_includedir}/%{name}/ +%{_libdir}/cmake/%{name}/%{name}*.cmake +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/lib%{name}.pc + +%changelog +%autochangelog diff --git a/anda/multimedia/xevd/anda.hcl b/anda/multimedia/xevd/anda.hcl new file mode 100644 index 0000000000..ed33aba013 --- /dev/null +++ b/anda/multimedia/xevd/anda.hcl @@ -0,0 +1,9 @@ +project pkg { + arches = ["x86_64", "aarch64", "i386"] + rpm { + spec = "xevd.spec" + } + labels { + mock = 1 + } +} diff --git a/anda/multimedia/xevd/update.rhai b/anda/multimedia/xevd/update.rhai new file mode 100644 index 0000000000..39960f4ad2 --- /dev/null +++ b/anda/multimedia/xevd/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("mpeg5/xevd")); diff --git a/anda/multimedia/xevd/xevd-fix-build-on-non-x86.patch b/anda/multimedia/xevd/xevd-fix-build-on-non-x86.patch new file mode 100644 index 0000000000..cb3cdd7fc7 --- /dev/null +++ b/anda/multimedia/xevd/xevd-fix-build-on-non-x86.patch @@ -0,0 +1,187 @@ +diff -Naur xevd-0.5.0.old/CMakeLists.txt xevd-0.5.0/CMakeLists.txt +--- xevd-0.5.0.old/CMakeLists.txt 2025-09-08 17:02:37.227878934 +0200 ++++ xevd-0.5.0/CMakeLists.txt 2025-09-08 17:03:59.232785118 +0200 +@@ -105,8 +105,7 @@ + set(OPT_DBG "-DNDEBUG") # disable assert + endif() + +- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -${OPT_LV} ${OPT_DBG} -fomit-frame-pointer -Wall -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-attributes -Werror -Wno-unknown-pragmas -Wno-stringop-overflow -std=c99") +- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pointer-sign -pthread -Wno-pointer-to-int-cast -Wno-maybe-uninitialized") ++ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -${OPT_LV} ${OPT_DBG} -Wall -pthread -std=c99") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm") + endif() + +@@ -134,6 +133,18 @@ + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + endif() + ++# To build for arm provide in command line: -DARM=TRUE ++if(NOT ARM) ++ set(ARM "FALSE") ++else() ++ add_definitions(-DARM=1) ++ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flax-vector-conversions") ++ if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") ++ set(CMAKE_EXE_LINKER_FLAGS "-static") ++ endif() ++endif() ++message("ARM=${ARM}") ++ + ######################################## + # add CPack to project + ######################################## +diff -Naur xevd-0.5.0.old/src_base/CMakeLists.txt xevd-0.5.0/src_base/CMakeLists.txt +--- xevd-0.5.0.old/src_base/CMakeLists.txt 2025-09-08 17:02:37.230545819 +0200 ++++ xevd-0.5.0/src_base/CMakeLists.txt 2025-09-08 17:02:46.122035862 +0200 +@@ -15,14 +15,26 @@ + + include(GenerateExportHeader) + include_directories("${CMAKE_BINARY_DIR}") ++ ++set(ARM "FALSE") ++message("SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}") ++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(arm|aarch)") ++ set(ARM "TRUE") ++elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86|ia64|i386|i686)") ++ set(X86 "TRUE") ++endif() ++ + if("${ARM}" STREQUAL "TRUE") + add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_NEON_SRC} ${LIB_NEON_INC} ) + add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_NEON_SRC} ${LIB_NEON_INC} ) +-else() ++elseif(X86) + add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_SSE_SRC} ${LIB_SSE_INC} + ${LIB_AVX_SRC} ${LIB_AVX_INC} ) + add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_SSE_SRC} ${LIB_SSE_INC} + ${LIB_AVX_SRC} ${LIB_AVX_INC} ) ++else() ++ add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ) ++ add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ) + endif() + + set_target_properties(${LIB_NAME_BASE}_dynamic PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${LIB_SOVERSION}) +@@ -56,8 +68,10 @@ + + if("${ARM}" STREQUAL "TRUE") + include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc ./neon) +-else() ++elseif(X86) + include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc ./sse ./avx) ++else() ++ include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc) + endif() + + +@@ -86,7 +100,11 @@ + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/import/lib) + elseif( UNIX OR MINGW ) + +- if("${ARM}" STREQUAL "FALSE") ++ if(ARM) ++ add_definitions(-DARM=1) ++ set_property( SOURCE ${NEON} APPEND PROPERTY COMPILE_FLAGS "-flax-vector-conversions") ++ elseif(X86) ++ add_definitions(-DX86=1) + set_property( SOURCE ${SSE} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" ) + set_property( SOURCE ${AVX} APPEND PROPERTY COMPILE_FLAGS " -mavx2" ) + endif() +diff -Naur xevd-0.5.0.old/src_base/xevd_def.h xevd-0.5.0/src_base/xevd_def.h +--- xevd-0.5.0.old/src_base/xevd_def.h 2025-09-08 17:02:37.232878979 +0200 ++++ xevd-0.5.0/src_base/xevd_def.h 2025-09-08 17:02:46.122168051 +0200 +@@ -1498,7 +1498,7 @@ + #include "xevd_mc.h" + #include "xevd_eco.h" + #include "xevd_df.h" +-#ifndef ARM ++#if defined(X86) + #include "xevd_mc_sse.h" + #include "xevd_mc_avx.h" + #include "xevd_itdq_sse.h" +@@ -1506,7 +1506,7 @@ + #include "xevd_recon_avx.h" + #include "xevd_recon_sse.h" + #include "xevd_dbk_sse.h" +-#else ++#elif defined(ARM) + #include "xevd_mc_neon.h" + #include "xevd_itdq_neon.h" + #include "xevd_recon_neon.h" +diff -Naur xevd-0.5.0.old/src_base/xevd_port.h xevd-0.5.0/src_base/xevd_port.h +--- xevd-0.5.0.old/src_base/xevd_port.h 2025-09-08 17:02:37.234878997 +0200 ++++ xevd-0.5.0/src_base/xevd_port.h 2025-09-08 17:02:46.122306953 +0200 +@@ -137,10 +137,10 @@ + #define xevd_assert_gv(x,r,v,g) \ + {if(!(x)){assert(x); (r)=(v); goto g;}} + +-#ifndef ARM ++#if defined(X86) + #define X86_SSE 1 + #define ARM_NEON 0 +-#else ++#elif defined(ARM) + #define X86_SSE 0 + #define ARM_NEON 1 + #endif +diff -Naur xevd-0.5.0.old/src_main/CMakeLists.txt xevd-0.5.0/src_main/CMakeLists.txt +--- xevd-0.5.0.old/src_main/CMakeLists.txt 2025-09-08 17:02:37.235879006 +0200 ++++ xevd-0.5.0/src_main/CMakeLists.txt 2025-09-08 17:02:46.122402222 +0200 +@@ -27,16 +27,27 @@ + include(GenerateExportHeader) + include_directories("${CMAKE_BINARY_DIR}") + ++set(ARM "FALSE") ++message("SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}") ++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(arm|aarch)") ++ set(ARM "TRUE") ++elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86|ia64|i386|i686)") ++ set(X86 "TRUE") ++endif() ++ + if("${ARM}" STREQUAL "TRUE") + add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} + ${LIB_NEON_SRC} ${LIB_NEON_INC} ${LIB_MAIN_NEON_SRC} ${LIB_MAIN_NEON_INC} ) + add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} + ${LIB_NEON_SRC} ${LIB_NEON_INC} ${LIB_MAIN_NEON_SRC} ${LIB_MAIN_NEON_INC} ) +-else() ++elseif(X86) + add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} + ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC} ) + add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} + ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC} ) ++else() ++ add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ) ++ add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ) + endif() + + set_target_properties(${LIB_NAME}_dynamic PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${LIB_SOVERSION}) +@@ -79,12 +90,15 @@ + + if("${ARM}" STREQUAL "TRUE") + include_directories( ${LIB_NAME} PUBLIC . .. ../inc ./neon ../src_base ../src_base/neon) +-else() ++elseif(X86) + include_directories( ${LIB_NAME} PUBLIC . .. ../inc ./sse ./avx ../src_base ../src_base/sse ../src_base/avx) ++else() ++ include_directories( ${LIB_NAME} PUBLIC . .. ../inc ../src_base) + endif() + + set( SSE ${BASE_INC_FILES} ${LIB_SSE_SRC} ${LIB_MAIN_SSE_SRC}) + set( AVX ${LIB_AVX_SRC} ${LIB_MAIN_AVX_SRC}) ++set( NEON ${LIB_NEON_SRC} ${LIB_MAIN_NEON_SRC}) + + set_target_properties(${LIB_NAME}_dynamic PROPERTIES OUTPUT_NAME ${LIB_NAME}) + +@@ -101,7 +115,11 @@ + set_target_properties(${LIB_NAME}_dynamic PROPERTIES FOLDER lib + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/import/lib) + elseif( UNIX OR MINGW ) +- if("${ARM}" STREQUAL "FALSE") ++ if(ARM) ++ add_definitions(-DARM=1) ++ set_property( SOURCE ${NEON} APPEND PROPERTY COMPILE_FLAGS "-flax-vector-conversions") ++ elseif(X86) ++ add_definitions(-DX86=1) + set_property( SOURCE ${SSE} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" ) + set_property( SOURCE ${AVX} APPEND PROPERTY COMPILE_FLAGS " -mavx2" ) + endif() diff --git a/anda/multimedia/xevd/xevd-link-libm.patch b/anda/multimedia/xevd/xevd-link-libm.patch new file mode 100644 index 0000000000..d2d5cfc94b --- /dev/null +++ b/anda/multimedia/xevd/xevd-link-libm.patch @@ -0,0 +1,22 @@ +diff -Naur xevd-0.5.0.old/src_base/CMakeLists.txt xevd-0.5.0/src_base/CMakeLists.txt +--- xevd-0.5.0.old/src_base/CMakeLists.txt 2025-09-09 14:06:37.254614333 +0200 ++++ xevd-0.5.0/src_base/CMakeLists.txt 2025-09-09 14:06:55.110436755 +0200 +@@ -92,6 +92,7 @@ + endif() + set_target_properties(${LIB_NAME_BASE}_dynamic PROPERTIES FOLDER lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ++ target_link_libraries(${LIB_NAME_BASE}_dynamic m) + target_compile_definitions( ${LIB_NAME_BASE} PUBLIC ANY LINUX ) + target_link_libraries(${LIB_NAME_BASE} m) + endif() +diff -Naur xevd-0.5.0.old/src_main/CMakeLists.txt xevd-0.5.0/src_main/CMakeLists.txt +--- xevd-0.5.0.old/src_main/CMakeLists.txt 2025-09-09 14:06:37.255946413 +0200 ++++ xevd-0.5.0/src_main/CMakeLists.txt 2025-09-09 14:07:56.126832044 +0200 +@@ -107,6 +107,7 @@ + endif() + + set_target_properties(${LIB_NAME}_dynamic PROPERTIES FOLDER lib LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ++ target_link_libraries(${LIB_NAME}_dynamic m) + target_compile_definitions( ${LIB_NAME} PUBLIC ANY LINUX ) + target_link_libraries(${LIB_NAME} m) + endif() diff --git a/anda/multimedia/xevd/xevd.spec b/anda/multimedia/xevd/xevd.spec new file mode 100644 index 0000000000..99c2c96c06 --- /dev/null +++ b/anda/multimedia/xevd/xevd.spec @@ -0,0 +1,76 @@ +Name: xevd +Epoch: 1 +Version: 0.5.0 +Release: 1%{?dist} +Summary: eXtra-fast Essential Video Decoder, MPEG-5 EVC (Essential Video Coding) +License: BSD-3-Clause +URL: https://github.com/mpeg5/xevd + +Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: %{name}-fix-build-on-non-x86.patch +# https://github.com/mpeg5/xevd/commit/4087f635624cf4ee6ebe3f9ea165ff939b32117f +# But also for src_main: +Patch1: xevd-link-libm.patch + +BuildRequires: cmake +BuildRequires: gcc + +%description +The eXtra-fast Essential Video Decoder (XEVD) is an opensource and fast MPEG-5 +EVC decoder. + +MPEG-5 Essential Video Coding (EVC) is a video compression standard of ISO/IEC +Moving Picture Experts Group (MPEG). The main goal of the EVC is to provide a +significantly improved compression capability over existing video coding +standards with timely publication of terms. The EVC defines two profiles, +including "Baseline Profile" and "Main Profile". The "Baseline profile" contains +only technologies that are older than 20 years or otherwise freely available for +use in the standard. In addition, the "Main profile" adds a small number of +additional tools, each of which can be either cleanly disabled or switched to +the corresponding baseline tool on an individual basis. + +%package libs +Summary: MPEG-5 EVC encoder %{name} libraries + +%description libs +The %{name}-devel package contains libraries and header files for developing +applications that use %{name}. This package contains the shared libraries. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 +echo "v%{version}" > version.txt + +%build +%cmake -DSET_PROF=MAIN +%cmake_build + +%install +%cmake_install + +# Static library +rm -fr %{buildroot}%{_libdir}/%{name} + +%files +%{_bindir}/%{name}_app + +%files libs +%license COPYING +%doc README.md +%{_libdir}/lib%{name}.so.0 +%{_libdir}/lib%{name}.so.0.5 + +%files devel +%{_includedir}/%{name}/ +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +%autochangelog diff --git a/anda/multimedia/xeve/anda.hcl b/anda/multimedia/xeve/anda.hcl new file mode 100644 index 0000000000..ed448b2fce --- /dev/null +++ b/anda/multimedia/xeve/anda.hcl @@ -0,0 +1,9 @@ +project pkg { + arches = ["x86_64", "aarch64", "i386"] + rpm { + spec = "xeve.spec" + } + labels { + mock = 1 + } +} diff --git a/anda/multimedia/xeve/update.rhai b/anda/multimedia/xeve/update.rhai new file mode 100644 index 0000000000..6f4d2be925 --- /dev/null +++ b/anda/multimedia/xeve/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("mpeg5/xeve")); diff --git a/anda/multimedia/xeve/xeve-fix-build-i386.patch b/anda/multimedia/xeve/xeve-fix-build-i386.patch new file mode 100644 index 0000000000..53963a2cb4 --- /dev/null +++ b/anda/multimedia/xeve/xeve-fix-build-i386.patch @@ -0,0 +1,12 @@ +diff -Naur xeve-0.5.1.old/app/xeve_app_util.h xeve-0.5.1/app/xeve_app_util.h +--- xeve-0.5.1.old/app/xeve_app_util.h 2025-09-09 14:10:13.815762327 +0200 ++++ xeve-0.5.1/app/xeve_app_util.h 2025-11-04 13:43:37.496372293 +0100 +@@ -73,7 +73,7 @@ + len = (pre == NULL)? 0: (int)strlen(pre); + if(len > 0) + { +- sprintf(str + 3, " %s ", pre); ++ snprintf(str + 3, sizeof(str) - 3, " %.73s ", pre); + len = (int)strlen(str); + } + diff --git a/anda/multimedia/xeve/xeve-fix-build-on-non-x86.patch b/anda/multimedia/xeve/xeve-fix-build-on-non-x86.patch new file mode 100644 index 0000000000..f40c1c225c --- /dev/null +++ b/anda/multimedia/xeve/xeve-fix-build-on-non-x86.patch @@ -0,0 +1,186 @@ +diff -Naur xeve-0.5.1.old/src_base/CMakeLists.txt xeve-0.5.1/src_base/CMakeLists.txt +--- xeve-0.5.1.old/src_base/CMakeLists.txt 2024-06-24 09:49:08.000000000 +0200 ++++ xeve-0.5.1/src_base/CMakeLists.txt 2025-09-08 20:52:14.500329611 +0200 +@@ -17,15 +17,25 @@ + include(GenerateExportHeader) + include_directories("${CMAKE_BINARY_DIR}") + ++set(ARM "FALSE") ++message("SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}") ++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(arm|aarch)") ++ set(ARM "TRUE") ++elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86|ia64|i386|i686)") ++ set(X86 "TRUE") ++endif() + + if("${ARM}" STREQUAL "TRUE") + add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVE_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_NEON_INC} ${LIB_NEON_SRC}) + add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVE_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_NEON_INC} ${LIB_NEON_SRC}) +-else() ++elseif(X86) + add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVE_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_SSE_SRC} ${LIB_SSE_INC} + ${LIB_AVX_SRC} ${LIB_AVX_INC} ) + add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVE_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_SSE_SRC} ${LIB_SSE_INC} + ${LIB_AVX_SRC} ${LIB_AVX_INC} ) ++else() ++ add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVE_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ) ++ add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVE_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ) + endif() + + set_target_properties(${LIB_NAME_BASE}_dynamic PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${LIB_SOVERSION}) +@@ -59,8 +69,10 @@ + + if("${ARM}" STREQUAL "TRUE") + include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc ./neon) +-else() ++elseif(X86) + include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc ./sse ./avx) ++else() ++ include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc) + endif() + + set( SSE ${BASE_INC_FILES} ${LIB_SSE_SRC}) +@@ -83,7 +95,11 @@ + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/import/lib) + + elseif( UNIX OR MINGW ) +- if("${ARM}" STREQUAL "FALSE") ++ if(ARM) ++ add_definitions(-DARM=1) ++ set_property( SOURCE ${NEON} APPEND PROPERTY COMPILE_FLAGS "-flax-vector-conversions -Wno-cpp") ++ elseif(X86) ++ add_definitions(-DX86=1) + set_property( SOURCE ${SSE} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" ) + set_property( SOURCE ${AVX} APPEND PROPERTY COMPILE_FLAGS " -mavx2" ) + endif() +diff -Naur xeve-0.5.1.old/src_base/xeve_def.h xeve-0.5.1/src_base/xeve_def.h +--- xeve-0.5.1.old/src_base/xeve_def.h 2024-06-24 09:49:08.000000000 +0200 ++++ xeve-0.5.1/src_base/xeve_def.h 2025-09-08 20:52:14.500467050 +0200 +@@ -1514,10 +1514,10 @@ + #include "xeve_ipred.h" + #include "xeve_picman.h" + #include "xeve_mc.h" +-#ifndef ARM ++#if defined(X86) + #include "xeve_mc_sse.h" + #include "xeve_mc_avx.h" +-#else ++#elif defined(ARM) + #include "xeve_mc_neon.h" + #endif + #include "xeve_type.h" +diff -Naur xeve-0.5.1.old/src_base/xeve_port.h xeve-0.5.1/src_base/xeve_port.h +--- xeve-0.5.1.old/src_base/xeve_port.h 2024-06-24 09:49:08.000000000 +0200 ++++ xeve-0.5.1/src_base/xeve_port.h 2025-09-08 20:52:14.500592747 +0200 +@@ -138,10 +138,10 @@ + #define xeve_assert_gv(x,r,v,g) \ + {if(!(x)){assert(x); (r)=(v); goto g;}} + +-#ifndef ARM ++#if defined(X86) + #define X86_SSE 1 + #define ARM_NEON 0 +-#else ++#elif defined (ARM) + #define X86_SSE 0 + #define ARM_NEON 1 + #endif +diff -Naur xeve-0.5.1.old/src_base/xeve_type.h xeve-0.5.1/src_base/xeve_type.h +--- xeve-0.5.1.old/src_base/xeve_type.h 2024-06-24 09:49:08.000000000 +0200 ++++ xeve-0.5.1/src_base/xeve_type.h 2025-09-08 20:52:14.500672457 +0200 +@@ -34,10 +34,10 @@ + #include "xeve_def.h" + #include "xeve_bsw.h" + #include "xeve_sad.h" +-#ifndef ARM ++#if defined(X86) + #include "xeve_sad_sse.h" + #include "xeve_sad_avx.h" +-#else ++#elif defined(ARM) + #include "xeve_sad_neon.h" + #endif + +@@ -1016,11 +1016,11 @@ + #include "xeve_tbl.h" + #include "xeve_itdq.h" + +-#ifndef ARM ++#if defined(X86) + #include "xeve_itdq_sse.h" + #include "xeve_itdq_avx.h" + #include "xeve_tq_avx.h" +-#else ++#elif defined(ARM) + #include "xeve_itdq_neon.h" + #include "xeve_tq_neon.h" + #endif +diff -Naur xeve-0.5.1.old/src_main/CMakeLists.txt xeve-0.5.1/src_main/CMakeLists.txt +--- xeve-0.5.1.old/src_main/CMakeLists.txt 2024-06-24 09:49:08.000000000 +0200 ++++ xeve-0.5.1/src_main/CMakeLists.txt 2025-09-08 20:52:14.500798415 +0200 +@@ -19,18 +19,31 @@ + file (GLOB LIB_MAIN_SSE_INC "./sse/xevem_*.h" ) + file (GLOB LIB_MAIN_AVX_SRC "./avx/xevem_*.c") + file (GLOB LIB_MAIN_AVX_INC "./avx/xevem_*.h" ) ++file (GLOB LIB_MAIN_NEON_SRC "./neon/xevem_*.c") ++file (GLOB LIB_MAIN_NEON_INC "./neon/xevem_*.h" ) + + include(GenerateExportHeader) + include_directories("${CMAKE_BINARY_DIR}") + ++set(ARM "FALSE") ++message("SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}") ++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(arm|aarch)") ++ set(ARM "TRUE") ++elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86|ia64|i386|i686)") ++ set(X86 "TRUE") ++endif() ++ + if("${ARM}" STREQUAL "TRUE") +- add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ${LIB_NEON_INC} ${LIB_NEON_SRC} ) +- add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ${LIB_NEON_INC} ${LIB_NEON_SRC}) +-else() ++ add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ${LIB_NEON_SRC} ${LIB_NEON_INC} ) ++ add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ${LIB_NEON_SRC} ${LIB_NEON_INC}) ++elseif(X86) + add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} + ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC} ) + add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} +- ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC}) ++ ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC}) ++else() ++ add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ) ++ add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${ETM_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} ) + endif() + + set_target_properties(${LIB_NAME}_dynamic PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${LIB_SOVERSION}) +@@ -71,12 +84,15 @@ + + if("${ARM}" STREQUAL "TRUE") + include_directories( ${LIB_NAME} PUBLIC . .. ../inc ../src_base ../src_base/neon) +-else() ++elseif(X86) + include_directories( ${LIB_NAME} PUBLIC . .. ../inc ./sse ./avx ../src_base ../src_base/sse ../src_base/avx) ++else() ++ include_directories( ${LIB_NAME} PUBLIC . .. ../inc ../src_base) + endif() + + set( SSE ${BASE_INC_FILES} ${LIB_SSE_SRC} ${LIB_MAIN_SSE_SRC}) + set( AVX ${LIB_AVX_SRC} ${LIB_MAIN_AVX_SRC}) ++set( NEON ${LIB_NEON_SRC}) + + set_target_properties(${LIB_NAME}_dynamic PROPERTIES OUTPUT_NAME ${LIB_NAME}) + +@@ -94,7 +110,11 @@ + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/import/lib) + + elseif( UNIX OR MINGW ) +- if("${ARM}" STREQUAL "FALSE") ++ if(ARM) ++ add_definitions(-DARM=1) ++ set_property( SOURCE ${NEON} APPEND PROPERTY COMPILE_FLAGS "-flax-vector-conversions -Wno-cpp") ++ elseif(X86) ++ add_definitions(-DX86=1) + set_property( SOURCE ${SSE} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" ) + set_property( SOURCE ${AVX} APPEND PROPERTY COMPILE_FLAGS " -mavx2" ) + endif() diff --git a/anda/multimedia/xeve/xeve-link-libm.patch b/anda/multimedia/xeve/xeve-link-libm.patch new file mode 100644 index 0000000000..6c1d15950e --- /dev/null +++ b/anda/multimedia/xeve/xeve-link-libm.patch @@ -0,0 +1,23 @@ +diff -Naur xeve-0.5.1.old/src_base/CMakeLists.txt xeve-0.5.1/src_base/CMakeLists.txt +--- xeve-0.5.1.old/src_base/CMakeLists.txt 2025-09-09 14:10:13.817765661 +0200 ++++ xeve-0.5.1/src_base/CMakeLists.txt 2025-09-09 14:10:18.814666609 +0200 +@@ -89,6 +89,7 @@ + endif() + set_target_properties(${LIB_NAME_BASE}_dynamic PROPERTIES FOLDER lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ++ target_link_libraries(${LIB_NAME_BASE}_dynamic m) + target_compile_definitions( ${LIB_NAME_BASE} PUBLIC ANY LINUX ) + target_link_libraries(${LIB_NAME_BASE} m) + endif() +diff -Naur xeve-0.5.1.old/src_main/CMakeLists.txt xeve-0.5.1/src_main/CMakeLists.txt +--- xeve-0.5.1.old/src_main/CMakeLists.txt 2025-09-09 14:10:13.828252642 +0200 ++++ xeve-0.5.1/src_main/CMakeLists.txt 2025-09-09 14:10:56.392703629 +0200 +@@ -100,7 +100,7 @@ + endif() + + set_target_properties(${LIB_NAME}_dynamic PROPERTIES FOLDER lib LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +- ++ target_link_libraries(${LIB_NAME}_dynamic m) + target_compile_definitions( ${LIB_NAME} PUBLIC ANY LINUX ) + target_link_libraries(${LIB_NAME} m) + endif() diff --git a/anda/multimedia/xeve/xeve.spec b/anda/multimedia/xeve/xeve.spec new file mode 100644 index 0000000000..94705c1e36 --- /dev/null +++ b/anda/multimedia/xeve/xeve.spec @@ -0,0 +1,81 @@ +Name: xeve +Epoch: 1 +Version: 0.5.1 +Release: 2%{?dist} +Summary: eXtra-fast Essential Video Encoder, MPEG-5 EVC (Essential Video Coding) +License: BSD-3-Clause +URL: https://github.com/mpeg5/xeve + +Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: xeve-fix-build-on-non-x86.patch +# https://github.com/mpeg5/xeve/commit/bc45faa2e8d22bf33b0d15c025662f2a8de61fbc +# But also for src_main: +Patch1: xeve-link-libm.patch +Patch2: xeve-fix-build-i386.patch + +BuildRequires: cmake +BuildRequires: gcc +%ifarch aarch64 +BuildRequires: sse2neon-devel +%endif + +%description +The eXtra-fast Essential Video Encoder (XEVE) is an opensource and fast MPEG-5 +EVC encoder. + +MPEG-5 Essential Video Coding (EVC) is a video compression standard of ISO/IEC +Moving Picture Experts Group (MPEG). The main goal of the EVC is to provide a +significantly improved compression capability over existing video coding +standards with timely publication of terms. The EVC defines two profiles, +including "Baseline Profile" and "Main Profile". The "Baseline profile" contains +only technologies that are older than 20 years or otherwise freely available for +use in the standard. In addition, the "Main profile" adds a small number of +additional tools, each of which can be either cleanly disabled or switched to +the corresponding baseline tool on an individual basis. + +%package libs +Summary: MPEG-5 EVC encoder %{name} libraries + +%description libs +The %{name}-devel package contains libraries and header files for developing +applications that use %{name}. This package contains the shared libraries. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 +echo "v%{version}" > version.txt +rm src_base/neon/sse2neon.h + +%build +%cmake -DSET_PROF=MAIN +%cmake_build + +%install +%cmake_install + +# Static library +rm -fr %{buildroot}%{_libdir}/%{name} + +%files +%{_bindir}/%{name}_app + +%files libs +%license COPYING +%doc README.md +%{_libdir}/lib%{name}.so.0 +%{_libdir}/lib%{name}.so.0.5 + +%files devel +%{_includedir}/%{name}/ +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +%autochangelog