434 lines
12 KiB
RPMSpec
434 lines
12 KiB
RPMSpec
|
|
|
|
%define gdk_pixbuf_binary_version 2.10.0
|
|
%bcond_with x264
|
|
%bcond_with x265
|
|
%bcond_with kvazaar
|
|
%bcond_with openjpeg
|
|
%bcond_with openjph
|
|
|
|
|
|
%bcond_with heif_view
|
|
|
|
Name: libheif%{?psuffix}
|
|
Version: 1.21.2
|
|
Release: 0
|
|
Summary: HEIF/AVIF file format decoder and encoder
|
|
License: LGPL-3.0-only AND MIT
|
|
Group: Productivity/Graphics/Other
|
|
URL: https://github.com/strukturag/libheif
|
|
Source0: %{url}/releases/download/v%{version}/libheif-%{version}.tar.gz
|
|
|
|
BuildRequires: chrpath
|
|
BuildRequires: cmake >= 3.25
|
|
BuildRequires: fdupes
|
|
BuildRequires: gcc%{?force_gcc_version}-c++ >= 9
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: pkgconfig(aom)
|
|
BuildRequires: pkgconfig(dav1d)
|
|
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
|
|
BuildRequires: pkgconfig(libavcodec) >= 61
|
|
BuildRequires: pkgconfig(libbrotlienc)
|
|
BuildRequires: pkgconfig(libjpeg)
|
|
BuildRequires: pkgconfig(openh264)
|
|
%if %{with heif_view}
|
|
BuildRequires: pkgconfig(sdl2)
|
|
%endif
|
|
%if %{with openjpeg}
|
|
BuildRequires: pkgconfig(libopenjp2)
|
|
%endif
|
|
BuildRequires: pkgconfig(libpng)
|
|
BuildRequires: pkgconfig(libwebp)
|
|
%if %{with kvazaar}
|
|
BuildRequires: pkgconfig(kvazaar)
|
|
%endif
|
|
%if %{with openjph}
|
|
BuildRequires: pkgconfig(openjph)
|
|
%endif
|
|
BuildRequires: pkgconfig(rav1e)
|
|
%if %{with svtenc}
|
|
BuildRequires: pkgconfig(SvtAv1Enc)
|
|
%endif
|
|
%if %{with x264}
|
|
BuildRequires: pkgconfig(x264)
|
|
%endif
|
|
%if %{with x265}
|
|
BuildRequires: pkgconfig(libde265)
|
|
BuildRequires: pkgconfig(x265)
|
|
%endif
|
|
|
|
%description
|
|
libheif is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File Format) file
|
|
format decoder and encoder.
|
|
|
|
HEIF and AVIF are new image file formats employing HEVC (H.265) or AV1 image
|
|
coding, respectively, for the best compression ratios currently possible.
|
|
|
|
%package -n libheif1
|
|
Summary: HEIF/AVIF file format decoder and encoder
|
|
Group: System/Libraries
|
|
|
|
%description -n libheif1
|
|
libheif is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File Format) file
|
|
format decoder and encoder.
|
|
|
|
HEIF and AVIF are new image file formats employing HEVC (H.265) or AV1 image
|
|
coding, respectively, for the best compression ratios currently possible.
|
|
|
|
For AVIF libaom, dav1d, or rav1e are used as codecs. HEIF support is not
|
|
provided.
|
|
|
|
%package aom
|
|
Summary: Plugin AOM encoder and decoder for AVIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description aom
|
|
This plugin provides the AOM encoder and decoder for AVIF to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package dav1d
|
|
Summary: Plugin dav1d decoder for AVIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description dav1d
|
|
This plugin provides the dav1d encoder for AVIF to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package ffmpeg
|
|
Summary: Plugin FFMPEG decoder (HW acc) for HEIC
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description ffmpeg
|
|
This plugin provides the FFMPEG decoder (HW acc) for HEIC to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package jpeg
|
|
Summary: Plugin encoder and decoder for JPEG in HEIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description jpeg
|
|
This plugin provides the encoder and decoder for JPEG in HEIF to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package kvazaar
|
|
Summary: Plugin kvazaar encoder for HEIC
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description kvazaar
|
|
This plugin provides the kvazaar encoder for HEIC to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package openjpeg
|
|
Summary: Plugin OpenJPEG J2K encoder and decoder for JPEG-2000 in HEIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description openjpeg
|
|
This plugin provides the OpenJPEG J2K encoder and decoder for JPEG to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package openh264
|
|
Summary: Plugin OpenH264 decoder in HEIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description openh264
|
|
This plugin provides the OpenH264 decoder to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package openjph
|
|
Summary: Plugin OpenJPH HT-J2K encoder in HEIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description openjph
|
|
This plugin provides the OpenJPH HT-J2K encoder to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package rav1e
|
|
Summary: Plugin rav1e encoder for AVIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description rav1e
|
|
This plugin provides the rav1e encoder for AVIF to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package svtenc
|
|
Summary: Plugin SVT-AV1 encoder for AVIF
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description svtenc
|
|
This plugin provides the SVT-AV1 encoder for AVIF to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package x264
|
|
Summary: Pluging for X264 encoder
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description x264
|
|
This plugin provides the X264 encoder to write H.264-compressed video to libheif.
|
|
Packaged separately so that the libraries it requires are not pulled in by
|
|
default by libheif.
|
|
|
|
%package HEIF
|
|
Summary: Plugin for HEIF decoder and encoder
|
|
Group: System/Libraries
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description HEIF
|
|
This plugin provides an decoder and encoder for HEIF to libheif. Packaged separately
|
|
so that the libraries it requires are not pulled in by default by libheif.
|
|
|
|
%package devel
|
|
Summary: Devel Package for %{name}
|
|
Group: Development/Libraries/C and C++
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description devel
|
|
libheif is a ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.
|
|
This package contains the header files.
|
|
|
|
%package -n gdk-pixbuf-loader-libheif
|
|
Summary: GDK PixBuf Loader for %{name}
|
|
Group: System/Libraries
|
|
Supplements: (libheif1 and libgdk_pixbuf-2_0-0)
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description -n gdk-pixbuf-loader-libheif
|
|
A ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.
|
|
|
|
This package contains the GDK PixBuf Loader for %{name}.
|
|
|
|
%package -n heif-examples
|
|
Summary: Example binary programs for %{name}
|
|
Group: Productivity/Graphics/Other
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description -n heif-examples
|
|
A ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.
|
|
|
|
This package contains example binary programs for %{name}.
|
|
|
|
%package -n heif-thumbnailer
|
|
Summary: Thumbnailer for HEIF/AVIF image files
|
|
Group: Productivity/Graphics/Other
|
|
Supplements: libheif1
|
|
Requires: libheif1 = %{version}-%{release}
|
|
|
|
%description -n heif-thumbnailer
|
|
Allows to show thumbnail previews of HEIF and AVIF images using %{name}.
|
|
|
|
%prep
|
|
%autosetup -p1 -n libheif-%{version}
|
|
|
|
%build
|
|
# https://github.com/strukturag/libheif/issues/1281
|
|
#sed -i '/add_libheif_test(encode)/d' tests/CMakeLists.txt
|
|
%cmake \
|
|
--preset=release \
|
|
-DWITH_AOM_DECODER=ON \
|
|
-DWITH_AOM_DECODER_PLUGIN=ON \
|
|
-DWITH_AOM_ENCODER=ON \
|
|
-DWITH_AOM_ENCODER_PLUGIN=ON \
|
|
-DWITH_DAV1D=ON \
|
|
-DWITH_DAV1D_PLUGIN=ON \
|
|
%if %{with x264}
|
|
-DWITH_X264=ON \
|
|
-DWITH_X264_PLUGIN=ON \
|
|
%else
|
|
-DWITH_X264=OFF \
|
|
%endif
|
|
%if %{with x265}
|
|
-DWITH_X265=ON \
|
|
-DWITH_LIBDE265=ON \
|
|
-DWITH_X265_PLUGIN=ON \
|
|
-DWITH_LIBDE265_PLUGIN=ON \
|
|
-DWITH_EXAMPLES=ON \
|
|
%else
|
|
-DWITH_LIBDE265=OFF \
|
|
-DWITH_X265=OFF \
|
|
-DWITH_EXAMPLES=OFF \
|
|
%endif
|
|
-DWITH_RAV1E=ON \
|
|
-DWITH_RAV1E_PLUGIN=ON \
|
|
%if %{with svtenc}
|
|
-DWITH_SvtEnc=ON \
|
|
-DWITH_SvtEnc_PLUGIN=ON \
|
|
%else
|
|
-DWITH_SvtEnc=OFF \
|
|
%endif
|
|
-DWITH_JPEG_DECODER=ON \
|
|
-DWITH_JPEG_DECODER_PLUGIN=ON \
|
|
-DWITH_JPEG_ENCODER=ON \
|
|
-DWITH_JPEG_ENCODER_PLUGIN=ON \
|
|
-DWITH_UNCOMPRESSED_CODEC=ON \
|
|
%if %{with kvazaar}
|
|
-DWITH_KVAZAAR=ON \
|
|
-DWITH_KVAZAAR_PLUGIN=ON \
|
|
%else
|
|
-DWITH_KVAZAAR=OFF \
|
|
%endif
|
|
-DWITH_OpenJPEG_DECODER=ON \
|
|
-DWITH_OpenJPEG_DECODER_PLUGIN=ON \
|
|
-DWITH_OpenJPEG_ENCODER=ON \
|
|
-DWITH_OpenJPEG_ENCODER_PLUGIN=ON \
|
|
-DWITH_OpenH264_DECODER=ON \
|
|
-DWITH_OpenH264_DECODER_PLUGIN=ON \
|
|
%if %{with openjph}
|
|
-DWITH_OPENJPH_ENCODER=ON \
|
|
-DWITH_OPENJPH_ENCODER_PLUGIN=ON \
|
|
%else
|
|
-DWITH_OPENJPH_ENCODER=OFF \
|
|
%endif
|
|
-DWITH_FFMPEG_DECODER=ON \
|
|
-DWITH_FFMPEG_DECODER_PLUGIN=ON \
|
|
-DWITH_UVG266="OFF" \
|
|
-DWITH_VVDEC="OFF" \
|
|
-DWITH_VVENC="OFF" \
|
|
-DCMAKE_SKIP_RPATH=ON \
|
|
-DBUILD_TESTING=OFF \
|
|
-DWITH_REDUCED_VISIBILITY=ON \
|
|
-DWITH_DEFLATE_HEADER_COMPRESSION=ON \
|
|
-DWITH_LIBSHARPYUV=ON \
|
|
-DWITH_FUZZERS=OFF \
|
|
-DPLUGIN_DIRECTORY=%{_libexecdir}/libheif \
|
|
%endif
|
|
%nil
|
|
%cmake_build
|
|
|
|
%install
|
|
%cmake_install
|
|
%if %{with x265}
|
|
#Install examples and man pages
|
|
install -d -m 0755 %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man1/
|
|
for e in heif-dec \
|
|
heif-enc \
|
|
heif-info \
|
|
heif-thumbnailer
|
|
do
|
|
install -m 0755 build/examples/$e %{buildroot}%{_bindir}/$e
|
|
chrpath --delete %{buildroot}%{_bindir}/$e
|
|
install -m 0644 examples/$e.1 %{buildroot}%{_mandir}/man1/$e.1
|
|
done
|
|
%else
|
|
rm -f %{buildroot}%{_datadir}/mime/packages/avif.xml
|
|
rm -f %{buildroot}%{_datadir}/mime/packages/heif.xml
|
|
rm -f %{buildroot}%{_datadir}/thumbnailers/heif.thumbnailer
|
|
%endif
|
|
%fdupes -s %{buildroot}%{_includedir}
|
|
|
|
|
|
%post -n gdk-pixbuf-loader-libheif
|
|
%{gdk_pixbuf_loader_post}
|
|
|
|
%postun -n gdk-pixbuf-loader-libheif
|
|
%{gdk_pixbuf_loader_postun}
|
|
|
|
%files -n libheif1
|
|
%license COPYING
|
|
%{_libdir}/libheif.so.*
|
|
%dir %{_libexecdir}/libheif
|
|
|
|
%files aom
|
|
%{_libexecdir}/libheif/libheif-aomdec.so
|
|
%{_libexecdir}/libheif/libheif-aomenc.so
|
|
|
|
%files dav1d
|
|
%{_libexecdir}/libheif/libheif-dav1d.so
|
|
|
|
%files ffmpeg
|
|
%{_libexecdir}/libheif/libheif-ffmpegdec.so
|
|
|
|
%files jpeg
|
|
%{_libexecdir}/libheif/libheif-jpegdec.so
|
|
%{_libexecdir}/libheif/libheif-jpegenc.so
|
|
|
|
%if %{with kvazaar}
|
|
%files kvazaar
|
|
%{_libexecdir}/libheif/libheif-kvazaar.so
|
|
%endif
|
|
|
|
%if %{with openjpeg}
|
|
%files openjpeg
|
|
%{_libexecdir}/libheif/libheif-j2kdec.so
|
|
%{_libexecdir}/libheif/libheif-j2kenc.so
|
|
%endif
|
|
|
|
%files openh264
|
|
%{_libexecdir}/libheif/libheif-openh264dec.so
|
|
|
|
%if %{with openjph}
|
|
%files openjph
|
|
%{_libexecdir}/libheif/libheif-jphenc.so
|
|
%endif
|
|
|
|
%files rav1e
|
|
%{_libexecdir}/libheif/libheif-rav1e.so
|
|
|
|
%if %{with svtenc}
|
|
%files svtenc
|
|
%{_libexecdir}/libheif/libheif-svtenc.so
|
|
%endif
|
|
|
|
%if %{with x264}
|
|
%files x264
|
|
%{_libexecdir}/libheif/libheif-x264.so
|
|
%endif
|
|
|
|
%if %{with x265}
|
|
%files HEIF
|
|
%{_libexecdir}/libheif/libheif-libde265.so
|
|
%{_libexecdir}/libheif/libheif-x265.so
|
|
%endif
|
|
|
|
%files devel
|
|
%doc README.md
|
|
%{_includedir}/libheif
|
|
%{_libdir}/libheif.so
|
|
%{_libdir}/cmake/libheif
|
|
%{_libdir}/pkgconfig/libheif.pc
|
|
|
|
%files -n gdk-pixbuf-loader-libheif
|
|
%{_libdir}/gdk-pixbuf-2.0/%{gdk_pixbuf_binary_version}/loaders/*.so
|
|
|
|
%if %{with x265}
|
|
%files -n heif-examples
|
|
%{_bindir}/heif-convert
|
|
%{_bindir}/heif-dec
|
|
%{_bindir}/heif-enc
|
|
%{_bindir}/heif-info
|
|
%{_mandir}/man1/heif-dec.1%{?ext_man}
|
|
%{_mandir}/man1/heif-enc.1%{?ext_man}
|
|
%{_mandir}/man1/heif-info.1%{?ext_man}
|
|
|
|
%files -n heif-thumbnailer
|
|
%{_bindir}/heif-thumbnailer
|
|
%dir %{_datadir}/thumbnailers
|
|
%{_datadir}/thumbnailers/heif.thumbnailer
|
|
%{_mandir}/man1/heif-thumbnailer.1%{?ext_man}
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%changelog
|