%define enc_major 2 %define libname_enc %mklibname svtav1enc %{enc_major} %define devname %mklibname svt-av1 -d %define oname SVT-AV1 %global toolchain clang Name: svt-av1 Version: 2.3.0 Release: %mkrel 1.1 Summary: Scalable Video Technology for AV1 Encoder Group: System/Libraries License: BSD-3-Clause and MIT and ISC and Public Domain URL: https://gitlab.com/AOMediaCodec/SVT-AV1 Source0: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v%{version}/%{oname}-v%{version}.tar.bz2 BuildRequires: clang BuildRequires: cmake BuildRequires: ninja BuildRequires: meson BuildRequires: yasm BuildRequires: help2man BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) Requires: gstreamer1.0-%{name} >= %{version}-%{release} Provides: bundled(cpuinfo) = 0^20201129gita7e1076-1 Provides: bundled(fastfeat) = 0^20191113git391d5e9-1 Provides: bundled(safestringlib) = 1.0.0-1 %description The Scalable Video Technology for AV1 Encoder (SVT-AV1 Encoder) is an AV1-compliant encoder library core. The SVT-AV1 development is a work-in-progress targeting performance levels applicable to both VOD and Live encoding / transcoding video applications. %package -n %{libname_enc} Summary: SVT-AV1 Encoder libraries Group: System/Libraries %description -n %{libname_enc} This package contains SVT-AV1 Encoder libraries. %package -n %{devname} Summary: Development files for SVT-AV1 Group: Development/C Requires: %{name} = %{version}-%{release} Requires: %{libname_enc} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %description -n %{devname} This package contains the development files for SVT-AV1. %package -n gstreamer1.0-%{name} Summary: GStreamer 1.0 %{name}-based plug-in Group: System/Libraries Requires: gstreamer1.0-plugins-base %description -n gstreamer1.0-%{name} This package provides %{name}-based GStreamer plug-in. %prep %autosetup -p1 -n %{oname}-v%{version} # Patch build gstreamer plugin sed -e "s|install: true,|install: true, include_directories : [ include_directories('../Source/API') ], link_args : '-lSvtAv1Enc',|" \ -e "/svtav1enc_dep =/d" -e 's|, svtav1enc_dep||' -e "s|svtav1enc_dep.found()|true|" -i gstreamer-plugin/meson.build %build %cmake -G Ninja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DSVT_AV1_LTO=ON \ -DSVT_AV1_PGO=ON %cmake_build export LIBRARY_PATH="$LIBRARY_PATH:$(pwd)/Bin/RelWithDebInfo" pushd gstreamer-plugin %meson %meson_build popd %install %cmake_install pushd gstreamer-plugin %meson_install popd install -d -m0755 %{buildroot}%{_mandir}/man1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} help2man -N --help-option=-help --no-discard-stderr --version-string=%{version} %{buildroot}%{_bindir}/SvtAv1EncApp > %{buildroot}%{_mandir}/man1/SvtAv1EncApp.1 find %{buildroot} -name '*.*a' -delete %files %doc CHANGELOG.md CONTRIBUTING.md README.md %{_bindir}/SvtAv1EncApp %{_mandir}/man1/SvtAv1EncApp.1* %files -n %{libname_enc} %license LICENSE.md PATENTS.md %doc CHANGELOG.md CONTRIBUTING.md README.md %{_libdir}/libSvtAv1Enc.so.%{enc_major}{,.*} %files -n %{devname} %doc Docs %license LICENSE.md PATENTS.md %{_includedir}/%{name}/ %{_libdir}/libSvtAv1Enc.so %{_libdir}/pkgconfig/SvtAv1Enc.pc %files -n gstreamer1.0-%{name} %{_libdir}/gstreamer-1.0/libgstsvtav1enc.so