%bcond_with check %global forgeurl https://github.com/psy-ex/svt-av1-psy %global tag v2.3.0-B %forgemeta # cpuinfo is only available for %%{x86_64} %%{arm64} on Fedora %ifarch %{x86_64} %{arm64} %bcond unbundled_cpuinfo 1 %bcond libdovi 1 %endif Name: svt-av1-psy Version: 2.3.0.B Release: %autorelease Summary: SVT-AV1 with perceptual enhancements optimal AV1 encoding License: LicenseRef-BSD-3-Clause-Clear-WITH-AdditionRef-AOMPL-1.0 AND MIT AND ISC AND LicenseRef-Fedora-Public-Domain AND BSD-2-Clause # Main library: BSD-3-Clause-Clear and AOMPL # https://gitlab.com/fedora/legal/fedora-license-data/-/issues/383 # Source/Lib/Common/Codec/EbHmCode.c: BSD # Source/App/EncApp/EbAppString.* # Source/Lib/Common/Codec/EbString.* # Source/Lib/Encoder/Codec/vector.*: MIT # Source/Lib/Common/ASM_SSE2/x86inc.asm: ISC # Source/App/DecApp/EbMD5Utility.*: PublicDomain # third_party/cpuinfo : BSD-2-Clause # third_party/fastfeat : BSD-3-Clause # third_party/safestringlib : 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 >= 3.16 BuildRequires: gcc >= 5.4.0 BuildRequires: gcc-c++ >= 5.4.0 BuildRequires: help2man BuildRequires: nasm >= 2.14 BuildRequires: ninja-build %if %{with libdovi} BuildRequires: libdovi-devel %endif %if %{with unbundled_cpuinfo} BuildRequires: pkgconfig(libcpuinfo) Provides: bundled(cpuinfo) = 0^20201129gita7e1076-1 %endif Provides: bundled(fastfeat) = 0^20191113git391d5e9-1 Provides: bundled(safestringlib) = 1.0.0-1 Conflicts: svt-av1-libs # 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 and Libdovi for s390x and ppc64le 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 docs Summary: Docs for %{name} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} BuildArch: noarch %description docs The %{name}-docs package contains the docs %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 buildv %cmake -DSVT_AV1_LTO=ON \ -DCMAKE_BUILD_TYPE=Release \ -DSVT_AV1_PGO=ON \ -DENABLE_AVX512=ON \ %if %{with unbundled_cpuinfo} -DUSE_EXTERNAL_CPUINFO=ON \ %endif %if %{with libdovi} -DLIBDOVI_FOUND=1 \ %endif -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/* %if %{with check} %check %ctest %endif %files %license LICENSE.md PATENTS.md third_party/fastfeat/LICENSE.fastfeat third_party/safestringlib/LICENSE.safestringlib %{_libdir}/libSvtAv1Enc.so.2{,.*} %{_bindir}/SvtAv1EncApp %files docs %doc CHANGELOG.md README.md Docs/ %changelog %autochangelog