%bcond_with check %global forgeurl https://github.com/gianni-rosato/svt-av1-psy %global version0 2.3.0 %global tag v%{version0} %forgemeta Name: svt-av1-psy Version: %forgeversion Release: %autorelease Summary: SVT-AV1 with perceptual enhancements optimal AV1 encoding License: %{shrink: LicenseRef-BSD-2-Clause-WITH-AdditionRef-AOMPL-1.0 AND LicenseRef-BSD-3-Clause-Clear-WITH-AdditionRef-AOMPL-1.0 AND ISC AND BSD-2-Clause AND BSD-3-Clause AND MIT} URL: %{forgeurl} Source: %{forgesource} #main library is a tangled mixture of `LicenseRef-BSD-2-Clause-WITH-AdditionRef-AOMPL-1.0` and `LicenseRef-BSD-3-Clause-Clear-WITH-AdditionRef-AOMPL-1.0` in order to avoid the long breakdown BuildRequires: cmake BuildRequires: nasm BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libdovi-devel BuildRequires: ninja-build #ninja-build is faster BuildRequires: cpuinfo-devel Requires: %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Requires(post): %{_bindir}/update-alternatives Requires(postun): %{_bindir}/update-alternatives Provides: bundled(fastfeat) Provides: bundled(safestringlib) Conflicts: svt-av1 # same install dir, same file names... just without the Decoder files... "Use Dav1d" they said # the psy version is just svt + extra speccial sauce to make it better %description NOTE: not compiled with hdr10plus SVT-AV1-PSY is the Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder) with perceptual enhancements for psychovisually optimal AV1 encoding. # no devel packages as they have `Provides:` conflict and they are abi-compatible # build against sv-av1-devel and switch libs at runtime %package libs Summary: SVT-AV1-PSY libraries %description libs %{description} Requires(post): %{_bindir}/update-alternatives Requires(postun): %{_bindir}/update-alternatives %package docs Summary: Docs for %{name} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} BuildArch: noarch %description docs The %{name}-docs package contains the docs Requires(post): %{_bindir}/update-alternatives Requires(postun): %{_bindir}/update-alternatives %prep %forgesetup #mitigate name collisions mv third_party/safestringlib/LICENSE third_party/safestringlib/LICENSE.safestringlib mv third_party/fastfeat/LICENSE third_party/fastfeat/LICENSE.fastfeat mv Docs/README.md Docs/Docs.README.md #sanitize third_party rm -rf third_party/cpuinfo rm -rf third_party/aom* rm -rf third_party/googletest %build # # Not doing tests as it will cause build to time out and crash the build #TODO: investigate -DSVT_AV1_PGO=ON , -DENABLE_AVX512=ON REPRODUCIBLE_BUILDS EXCLUDE_HASH # DSVT_AV1_PGO - implication of it seem quite complicated # DENABLE_AVX512 is wrongly defined %cmake -DLIBDOVI_FOUND=1 \ -DSVT_AV1_LTO=ON \ -DUSE_EXTERNAL_CPUINFO=ON \ -DCMAKE_BUILD_TYPE=Release \ -G Ninja %cmake_build %install %cmake_install #stop builder fom complaining for not packagig devel files rm -rf %{buildroot}/usr/lib64/pkgconfig/SvtAv1Enc.pc rm -rf %{buildroot}/usr/lib64/libSvtAv1Enc.so rm -rf %{buildroot}/usr/include/svt-av1/* #prepare for update-alternatives touch %{_libdir}/libSvtAv1Enc.so.2{,.*} touch %{_bindir}/SvtAv1EncApp touch LICENSE.md PATENTS.md third_party/fastfeat/LICENSE.fastfeat third_party/safestringlib/LICENSE.safestringlib touch Docs/* %if %{with check} %check %ctest %endif %files %{_bindir}/SvtAv1EncApp %post update-alternatives --install %{_bindir}/SvtAv1EncApp \ %{name} %{_bindir}/SvtAv1EncApp-psy 10 %postun if [ $1 -eq 0 ] ; then update-alternatives --remove %{name} %{_bindir}/SvtAv1EncApp-psy %files docs %doc Docs/* %post docs update-alternatives --install %{_bindir}/antlr \ %{name} %{_bindir}/antlr-java 10 %files libs %license LICENSE.md PATENTS.md third_party/fastfeat/LICENSE.fastfeat third_party/safestringlib/LICENSE.safestringlib %{_libdir}/libSvtAv1Enc.so.2{,.*} %doc CHANGELOG.md CONTRIBUTING.md README.md %post libs update-alternatives --install %{_bindir}/antlr \ %{name} %{_bindir}/antlr-java 10 %changelog %autochangelog