%bcond check 1 # cpuinfo is only available for %%{x86_64} %%{arm64} on Fedora %ifarch %{x86_64} %{arm64} %bcond unbundled_cpuinfo 1 %endif %global version_with_dash %(echo %{version} | tr '~' '-') %global _description %{expand: SVT-AV1-PSY is the Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder) with perceptual enhancements for psychovisually optimal AV1 encoding. The goal is to create the best encoding implementation for perceptual quality with AV1.} Name: svt-av1-psy Version: 2.3.0~B Release: %autorelease Summary: SVT-AV1 with perceptual enhancements for optimal AV1 encoding # 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/fastfeat : BSD-3-Clause # third_party/safestringlib : MIT License: LicenseRef-BSD-3-Clause-Clear-WITH-AdditionRef-AOMPL-1.0 AND MIT AND ISC AND LicenseRef-Fedora-Public-Domain URL: https://github.com/psy-ex/svt-av1-psy %global version_with_dash %(echo %{version} | tr '~' '-') Source: https://github.com/psy-ex/svt-av1-psy/archive/refs/tags/v%{version_with_dash}.zip BuildRequires: cmake >= 3.16 BuildRequires: gcc >= 5.4.0 BuildRequires: gcc-c++ >= 5.4.0 BuildRequires: help2man BuildRequires: nasm >= 2.14 BuildRequires: ninja-build BuildRequires: pkgconfig(dovi) %if %{with unbundled_cpuinfo} BuildRequires: pkgconfig(libcpuinfo) %endif Requires: %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description %_description %package libs Summary: SVT-AV1-PSY libraries %if ! %{with gst_plugin} Obsoletes: gstreamer1-%{name} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %if %{without unbundled_cpuinfo} Provides: bundled(cpuinfo) = 0^20201129gita7e1076-1 %endif Provides: bundled(fastfeat) = 0^20191113git391d5e9-1 Provides: bundled(safestringlib) = 1.0.0-1 Provides: svt-av1-libs = %(echo %{version} | sed -e 's,~.*,,g') # same fie names 100% abi compatible %description libs %_description This package contains SVT-AV1-PSY libraries. %package devel Summary: Development files for SVT-AV1-PSY Requires: %{name}-libs = %{?epoch:%{epoch}:}%{version}-%{release} Recommends: %{name}-devel-docs = %{?epoch:%{epoch}:}%{version}-%{release} %description devel %_description. This package contains the development files for SVT-AV1-PSY. %package devel-docs Summary: Development documentation for SVT-AV1-PSY BuildArch: noarch %description devel-docs %_description. This package contains the documentation for development of SVT-AV1-PSY. %prep %autosetup -p1 -n %{name}-%{version_with_dash} # Mitigate name collisions mv third_party/fastfeat/LICENSE LICENSE.fastfeat mv third_party/safestringlib/LICENSE LICENSE.safestringlib # Sanitize third_party %if %{with unbundled_cpuinfo} rm -rfv third_party/cpuinfo %endif rm -rfv third_party/aom* rm -rfv third_party/googletest %build %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ %if %{with unbundled_cpuinfo} -DUSE_EXTERNAL_CPUINFO=ON \ %else -DUSE_EXTERNAL_CPUINFO=OFF \ %endif -DLIBDOVI_FOUND=1 \ -DSVT_AV1_LTO=ON \ -DSVT_AV1_PGO=ON \ -DENABLE_AVX512=ON \ -G Ninja %cmake_build %install %cmake_install rm -rfv %{buildroot}%{_libdir}/*.{a,la} install -dm0755 %{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 %if %{with check} %check %ctest %endif %files %{_bindir}/SvtAv1EncApp %{_mandir}/man1/SvtAv1EncApp.1* %files libs %license LICENSE.md PATENTS.md LICENSE.fastfeat LICENSE.safestringlib %doc CHANGELOG.md CONTRIBUTING.md README.md %{_libdir}/libSvtAv1Enc.so.2* %files devel %{_includedir}/svt-av1 %{_libdir}/libSvtAv1Enc.so %{_libdir}/pkgconfig/SvtAv1Enc.pc %files devel-docs %license LICENSE.md PATENTS.md LICENSE.fastfeat LICENSE.safestringlib %doc Docs %changelog %autochangelog