309d41c
# Build with aom
Leigh Scott 269edbe
%bcond_without aom
309d41c
# Build SVT-AV1
d19e550
%bcond_without svt
deb6ac3
%if (0%{?rhel} && 0%{?rhel} < 9) || 0%{?rhel} >= 10
ce45f63
%bcond_with rav1e
764a8bd
%else
764a8bd
%bcond_without rav1e
ce45f63
%endif
deb6ac3
%if 0%{?rhel} >= 10
deb6ac3
%bcond_with gtest
deb6ac3
%else
deb6ac3
%bcond_without gtest
deb6ac3
%endif
0a18fc4
%bcond_without check
Andreas Schneider 4296ae8
Andreas Schneider 97cd059
Name:           libavif
0d185a9
Version:        1.0.4
b85251c
Release:        %autorelease
Andreas Schneider 97cd059
Summary:        Library for encoding and decoding .avif files
05f1fe9
Andreas Schneider f926b01
License:        BSD-2-Clause
Andreas Schneider 97cd059
URL:            https://github.com/AOMediaCodec/libavif
Andreas Schneider 97cd059
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Andreas Schneider 4296ae8
384761e
# Encode alpha as 4:2:0 with SVT. Fix build with SVT-AV1 2.0.0
384761e
Patch0:         https://github.com/AOMediaCodec/libavif/commit/b10d2697e9ed2fb09cb722335ff4342c353612b8.patch
384761e
Andreas Schneider 4296ae8
BuildRequires:  cmake
Andreas Schneider 4296ae8
BuildRequires:  gcc-c++
deb6ac3
%{?with_check:%{?with_gtest:BuildRequires:  gtest-devel}}
Andreas Schneider 4296ae8
BuildRequires:  nasm
Andreas Schneider 4296ae8
%if %{with aom}
Andreas Schneider 4296ae8
BuildRequires:  pkgconfig(aom)
Andreas Schneider 4296ae8
%endif
05f1fe9
BuildRequires:  pkgconfig(dav1d)
Andreas Schneider d58482f
BuildRequires:  pkgconfig(libjpeg)
Andreas Schneider 0289a29
BuildRequires:  pkgconfig(libpng)
ce45f63
%{?with_rav1e:BuildRequires:  pkgconfig(rav1e)}
3e1858b
%{?with_svt:BuildRequires:  pkgconfig(SvtAv1Enc)}
Andreas Schneider 0289a29
BuildRequires:  pkgconfig(zlib)
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%description
Andreas Schneider 4296ae8
This library aims to be a friendly, portable C implementation of the AV1 Image
Andreas Schneider 4296ae8
File Format, as described here:
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
https://aomediacodec.github.io/av1-avif/
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%package devel
ee784a3
Summary:        Development files for libavif
05f1fe9
Requires:       %{name}%{?_isa} = %{version}-%{release}
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%description devel
Andreas Schneider 4296ae8
This package holds the development files for libavif.
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%package tools
05f1fe9
Summary:        Tools to encode and decode AVIF files
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%description tools
Andreas Schneider 4296ae8
This library aims to be a friendly, portable C implementation of the AV1 Image
Andreas Schneider 4296ae8
File Format, as described here:
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
https://aomediacodec.github.io/av1-avif/
Andreas Schneider 4296ae8
05f1fe9
This package holds the commandline tools to encode and decode AVIF files.
05f1fe9
05f1fe9
%package     -n avif-pixbuf-loader
05f1fe9
Summary:        AVIF image loader for GTK+ applications
05f1fe9
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
74fe8c1
Requires:       gdk-pixbuf2%{?_isa}
05f1fe9
05f1fe9
%description -n avif-pixbuf-loader
05f1fe9
Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%prep
Andreas Schneider 4296ae8
%autosetup -p1
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%build
Andreas Schneider c0f09f6
%cmake \
Andreas Schneider c0f09f6
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
Andreas Schneider c0f09f6
    %{?with_aom:-DAVIF_CODEC_AOM=1} \
Andreas Schneider c0f09f6
    -DAVIF_CODEC_DAV1D=1 \
ce45f63
    %{?with_rav1e:-DAVIF_CODEC_RAV1E=1} \
Andreas Schneider c0f09f6
    %{?with_svt:-DAVIF_CODEC_SVT=1} \
Andreas Schneider c0f09f6
    -DAVIF_BUILD_APPS=1 \
0a18fc4
    -DAVIF_BUILD_GDK_PIXBUF=1 \
deb6ac3
    %{?with_check:-DAVIF_BUILD_TESTS=1 -DAVIF_ENABLE_GTEST=%{with gtest}}
05f1fe9
%cmake_build
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%install
05f1fe9
%cmake_install
Andreas Schneider 4296ae8
0a18fc4
%if %{with check}
0a18fc4
%check
0a18fc4
%ctest
0a18fc4
%endif
0a18fc4
Andreas Schneider 4296ae8
%files
Andreas Schneider 4296ae8
%license LICENSE
309d41c
# Do not glob the soname
bba9069
%{_libdir}/libavif.so.16*
b2268f1
%{_datadir}/thumbnailers/avif.thumbnailer
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%files devel
Andreas Schneider 4296ae8
%{_libdir}/libavif.so
Andreas Schneider 4296ae8
%{_includedir}/avif/
Andreas Schneider 4296ae8
%{_libdir}/cmake/libavif/
Andreas Schneider 4296ae8
%{_libdir}/pkgconfig/libavif.pc
Andreas Schneider 4296ae8
Andreas Schneider 4296ae8
%files tools
Andreas Schneider 4296ae8
%doc CHANGELOG.md README.md
Andreas Schneider 4296ae8
%{_bindir}/avifdec
Andreas Schneider 4296ae8
%{_bindir}/avifenc
Andreas Schneider 4296ae8
05f1fe9
%files -n avif-pixbuf-loader
05f1fe9
%{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-avif.so
05f1fe9
Andreas Schneider 4296ae8
%changelog
b85251c
%autochangelog