public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/svt-av1] epel9-next: Add patch to fix building on modern Linux system
@ 2026-07-14 21:52 Andreas Schneider
  0 siblings, 0 replies; only message in thread
From: Andreas Schneider @ 2026-07-14 21:52 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/svt-av1
Branch : epel9-next
Commit : 1bd0720e6fef02c61ebfcafda9eb8091976e8099
Author : Andreas Schneider <asn@cryptomilk.org>
Date   : 2020-11-11T06:07:26+01:00
Stats  : +209/-25 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/svt-av1/c/1bd0720e6fef02c61ebfcafda9eb8091976e8099?branch=epel9-next

Log:
Add patch to fix building on modern Linux system

---
diff --git a/1568-backport.patch b/1568-backport.patch
new file mode 100644
index 0000000..e936a89
--- /dev/null
+++ b/1568-backport.patch
@@ -0,0 +1,190 @@
+From 2e581b16cecd767d5596052b10c70acc681a8b45 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Tue, 10 Nov 2020 10:34:30 +0100
+Subject: [PATCH 1/3] cmake: Use CheckCSourceCompiles
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ CMakeLists.txt | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+Index: SVT-AV1-0.8.5/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/CMakeLists.txt	2020-11-10 11:29:38.547034342 +0100
+@@ -29,19 +29,17 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
+     message(WARNING "32-bit is not supported")
+ endif()
+ 
+-file(WRITE ${CMAKE_BINARY_DIR}/conftest.c "
++include(CheckCSourceCompiles)
++
++check_c_source_compiles("
+ #if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
+ #else
+ #error \"Non-x86\"
+ #endif
+-int main() {}
+-")
+-
+-try_compile(X86 ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/conftest.c)
+-
+-message(STATUS "x86 detected: ${X86}")
++int main(void) {}
++" HAVE_X86_PLATFORM)
+ 
+-if(X86)
++if(HAVE_X86_PLATFORM)
+     find_program(YASM_EXE yasm)
+     option(ENABLE_NASM "Use nasm if available (Uses yasm by default if found)" OFF)
+     if(YASM_EXE AND NOT CMAKE_ASM_NASM_COMPILER MATCHES "yasm" AND NOT ENABLE_NASM)
+@@ -110,12 +108,13 @@ if(UNIX)
+     endif()
+ endif()
+ 
++# Always build with -fPIC/-fPIE
++set(CMAKE_POSITION_INDEPENDENT_CODE ON)
++
+ set(flags_to_test
+     -Wextra
+     -Wformat
+-    -Wformat-security
+-    -fPIE
+-    -fPIC)
++    -Wformat-security)
+ if(MSVC)
+     list(INSERT flags_to_test 0 /W3)
+     list(APPEND flags_to_test /MP)
+@@ -230,6 +229,10 @@ macro(ASM_COMPILE_TO_TARGET target)
+     endif()
+ endmacro()
+ 
++# Find out if we have threading available
++set(CMAKE_THREAD_PREFER_PTHREADS ON)
++find_package(Threads)
++
+ # Add Subdirectories
+ add_subdirectory(Source/Lib/Common)
+ if(BUILD_ENC)
+Index: SVT-AV1-0.8.5/Source/Lib/Decoder/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/Source/Lib/Decoder/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/Source/Lib/Decoder/CMakeLists.txt	2020-11-10 11:09:55.382045862 +0100
+@@ -18,10 +18,11 @@ set(DEC_VERSION ${DEC_VERSION_MAJOR}.${D
+ 
+ if(UNIX)
+     if(NOT APPLE)
+-        find_library(M_LIB name m)
++        find_library(M_LIB NAMES m)
+         if(M_LIB)
+             list(APPEND PLATFORM_LIBS m)
+         endif()
++        list(APPEND PLATFORM_LIBS ${CMAKE_THREAD_LIBS_INIT})
+     endif()
+     set(LIBS_PRIVATE "-lpthread -lm")
+ endif()
+@@ -45,7 +46,7 @@ link_directories(${PROJECT_SOURCE_DIR}/S
+     ${PROJECT_SOURCE_DIR}/Source/Lib/Decoder/Codec/
+     ${PROJECT_SOURCE_DIR}/third_party/fastfeat/)
+ 
+-if(X86)
++if(HAVE_X86_PLATFORM)
+     # Include Decoder Subdirectories
+     include_directories(${PROJECT_SOURCE_DIR}/Source/Lib/Common/ASM_SSE2/
+         ${PROJECT_SOURCE_DIR}/Source/Lib/Common/ASM_SSSE3/
+@@ -75,7 +76,7 @@ if(common_lib_source)
+ endif()
+ 
+ # Decoder Lib Source Files
+-if(X86)
++if(HAVE_X86_PLATFORM)
+     add_library(SvtAv1Dec
+         ${all_files}
+         $<TARGET_OBJECTS:COMMON_CODEC>
+Index: SVT-AV1-0.8.5/Source/Lib/Encoder/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/Source/Lib/Encoder/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/Source/Lib/Encoder/CMakeLists.txt	2020-11-10 11:09:55.382045862 +0100
+@@ -19,10 +19,11 @@ set(ENC_VERSION ${ENC_VERSION_MAJOR}.${E
+ 
+ if(UNIX)
+     if(NOT APPLE)
+-        find_library(M_LIB name m)
++        find_library(M_LIB NAMES m)
+         if(M_LIB)
+             list(APPEND PLATFORM_LIBS m)
+         endif()
++        list(APPEND PLATFORM_LIBS ${CMAKE_THREAD_LIBS_INIT})
+     endif()
+     set(LIBS_PRIVATE "-lpthread -lm")
+ endif()
+@@ -49,7 +50,7 @@ link_directories(${PROJECT_SOURCE_DIR}/S
+ add_subdirectory(C_DEFAULT)
+ add_subdirectory(Codec)
+ add_subdirectory(Globals)
+-if(X86)
++if(HAVE_X86_PLATFORM)
+     # Include Encoder Subdirectories
+     include_directories(${PROJECT_SOURCE_DIR}/Source/Lib/Common/ASM_SSE2/
+         ${PROJECT_SOURCE_DIR}/Source/Lib/Common/ASM_SSSE3/
+@@ -96,7 +97,7 @@ if(common_lib_source)
+ endif()
+ 
+ # Encoder Lib Source Files
+-if(X86)
++if(HAVE_X86_PLATFORM)
+     add_library(SvtAv1Enc
+         ${all_files}
+         $<TARGET_OBJECTS:COMMON_CODEC>
+Index: SVT-AV1-0.8.5/Source/Lib/Common/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/Source/Lib/Common/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/Source/Lib/Common/CMakeLists.txt	2020-11-10 11:09:55.382045862 +0100
+@@ -30,7 +30,7 @@ add_library(common_lib INTERFACE)
+ add_subdirectory(Codec)
+ add_subdirectory(C_DEFAULT)
+ 
+-if(X86)
++if(HAVE_X86_PLATFORM)
+     add_subdirectory(ASM_SSE2)
+     add_subdirectory(ASM_SSSE3)
+     add_subdirectory(ASM_SSE4_1)
+Index: SVT-AV1-0.8.5/Source/Lib/Common/Codec/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/Source/Lib/Common/Codec/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/Source/Lib/Common/Codec/CMakeLists.txt	2020-11-10 11:09:55.382045862 +0100
+@@ -21,7 +21,7 @@ add_custom_target(EbVersionHeaderGen
+     COMMENT "Generating version header"
+     VERBATIM)
+ 
+-if(X86)
++if(HAVE_X86_PLATFORM)
+ # Include Encoder Subdirectories
+ include_directories(${PROJECT_SOURCE_DIR}/Source/API/
+     ${PROJECT_SOURCE_DIR}/Source/Lib/Common/Codec/
+Index: SVT-AV1-0.8.5/Source/Lib/Encoder/Codec/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/Source/Lib/Encoder/Codec/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/Source/Lib/Encoder/Codec/CMakeLists.txt	2020-11-10 11:09:55.382045862 +0100
+@@ -19,7 +19,7 @@ include_directories(../../../API
+         ${PROJECT_SOURCE_DIR}/Source/Lib/Encoder/Globals/
+         )
+ 
+-if(X86)
++if(HAVE_X86_PLATFORM)
+ # Include Encoder Subdirectories
+ include_directories(
+         ${PROJECT_SOURCE_DIR}/Source/Lib/Encoder/ASM_SSE2/
+Index: SVT-AV1-0.8.5/Source/Lib/Encoder/Globals/CMakeLists.txt
+===================================================================
+--- SVT-AV1-0.8.5.orig/Source/Lib/Encoder/Globals/CMakeLists.txt	2020-09-07 09:09:35.000000000 +0200
++++ SVT-AV1-0.8.5/Source/Lib/Encoder/Globals/CMakeLists.txt	2020-11-10 11:10:05.322095098 +0100
+@@ -19,7 +19,7 @@ include_directories(../../../API
+         ${PROJECT_SOURCE_DIR}/third_party/fastfeat/
+         )
+ 
+-if(X86)
++if(HAVE_X86_PLATFORM)
+ # Include Encoder Subdirectories
+ include_directories(
+         ${PROJECT_SOURCE_DIR}/Source/Lib/Common/ASM_SSE2/

diff --git a/svt-av1.spec b/svt-av1.spec
index 8567b68..820432a 100644
--- a/svt-av1.spec
+++ b/svt-av1.spec
@@ -6,7 +6,7 @@ encoding / transcoding video applications.}
 
 Name:           svt-av1
 Version:        0.8.5
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Scalable Video Technology for AV1 Encoder
 
 # Main library: BSD-2-Clause-Patent
@@ -17,9 +17,12 @@ Summary:        Scalable Video Technology for AV1 Encoder
 # Source/Lib/Common/ASM_SSE2/x86inc.asm: ISC
 # Source/App/DecApp/EbMD5Utility.*: PublicDomain
 License:        BSD-2-Clause-Patent and BSD and MIT and ISC and Public Domain
-URL:            https://github.com/OpenVisualCloud/SVT-AV1
+URL:            https://github.com/AOMediaCodec
 Source0:        %url/archive/v%{version}/%{name}-%{version}.tar.gz
-
+#
+# https://github.com/AOMediaCodec/SVT-AV1/pull/1568
+Patch0:         1568-backport.patch
+#
 # 64Bits, 5th Generation Intel® Core™ processor only
 ExclusiveArch:  x86_64
 
@@ -65,40 +68,28 @@ sed -e "s|install: true,|install: true, include_directories : [ include_director
 -e "/svtav1enc_dep =/d" -e 's|, svtav1enc_dep||' -e "s|svtav1enc_dep.found()|true|" -i gstreamer-plugin/meson.build
 
 %build
-# https://github.com/OpenVisualCloud/SVT-AV1/issues/999
-# Use -fcommon until all the global variables are fixed upstream
-export CFLAGS="%build_cflags -fcommon"
-export CXXFLAGS="%build_cxxflags -fcommon"
-%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-       -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-       -DCMAKE_INSTALL_LIBDIR=%{_lib} \
-       -DCMAKE_ASM_NASM_COMPILER=yasm \
-       -DCMAKE_SKIP_INSTALL_RPATH=ON \
-       -DBUILD_SHARED_LIBS=ON \
-       -DBUILD_TESTING=OFF \
-       -DNATIVE=OFF \
-       ..
+%cmake \
+    -DCMAKE_BUILD_TYPE=RelWithDebInfo
 %cmake_build
 
-cd gstreamer-plugin
-export LIBRARY_PATH="$PWD/../Bin/RelWithDebInfo:$LIBRARY_PATH"
+export LIBRARY_PATH="$LIBRARY_PATH:$(pwd)/Bin/RelWithDebInfo"
+pushd gstreamer-plugin
 %meson
 %meson_build
+popd
 
 %install
 %cmake_install
 rm -f %{buildroot}%{_libdir}/*.{a,la}
 
-pushd %{_vpath_builddir}
-mkdir -p %{buildroot}/%{_mandir}/man1
-export PATH=$PATH:%{buildroot}%{_bindir}
+install -d -m0755 %{buildroot}/%{_mandir}/man1
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}
-help2man -N --help-option=-help --version-string=%{version} SvtAv1DecApp > %{buildroot}%{_mandir}/man1/SvtAv1DecApp.1
-help2man -N --help-option=-help --no-discard-stderr --version-string=%{version} SvtAv1EncApp > %{buildroot}%{_mandir}/man1/SvtAv1EncApp.1
-popd
+help2man -N --help-option=-help --version-string=%{version} %{buildroot}%{_bindir}/SvtAv1DecApp > %{buildroot}%{_mandir}/man1/SvtAv1DecApp.1
+help2man -N --help-option=-help --no-discard-stderr --version-string=%{version} %{buildroot}%{_bindir}/SvtAv1EncApp > %{buildroot}%{_mandir}/man1/SvtAv1EncApp.1
 
-cd gstreamer-plugin
+pushd gstreamer-plugin
 %meson_install
+popd
 
 %files
 %{_bindir}/SvtAv1DecApp
@@ -123,6 +114,9 @@ cd gstreamer-plugin
 %{_libdir}/gstreamer-1.0/libgstsvtav1enc.so
 
 %changelog
+* Tue Nov 10 2020 Andreas Schneider <asn@redhat.com> - 0.8.5-2
+- Add patch to fix building on modern Linux system
+
 * Tue Nov 10 11:38:19 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.5-1
 - Update to 0.8.5
 - Close: rhbz#1876641

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-14 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 21:52 [rpms/svt-av1] epel9-next: Add patch to fix building on modern Linux system Andreas Schneider

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox