commit 12afb649c826938ddc643e2d5b025367f9ddaf4f Author: Adrian Schröter Date: Thu Jan 11 14:33:42 2024 +0100 Sync from SUSE:ALP:Source:Standard:1.0 libheif revision e19f4169520502c842e879b84cbfd9cb diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..83c94cd --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libheif1 diff --git a/libheif-1.17.6.tar.gz b/libheif-1.17.6.tar.gz new file mode 100644 index 0000000..cdee92a --- /dev/null +++ b/libheif-1.17.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8390baf4913eda0a183e132cec62b875fb2ef507ced5ddddc98dfd2f17780aee +size 1433302 diff --git a/libheif.changes b/libheif.changes new file mode 100644 index 0000000..ea1f042 --- /dev/null +++ b/libheif.changes @@ -0,0 +1,385 @@ +------------------------------------------------------------------- +Wed Jan 3 09:26:08 UTC 2024 - Dirk Müller + +- update to 1.17.6: + * A couple of build fixes and bug fixes detected by fuzzing. + + * Corrects these issues: + * CVE-2023-49462 - #1043 + * CVE-2023-49463 - #1042 +- drop libheif-CVE-2023-49462.patch, + libheif-CVE-2023-49464.patch, + libheif-CVE-2023-49460.patch: upstream + +------------------------------------------------------------------- +Tue Dec 19 10:40:25 UTC 2023 - pgajdos@suse.com + +- security update +- added patches + fix CVE-2023-49460 [bsc#1217902], segmentation violation in decode_uncompressed_image() + + libheif-CVE-2023-49460.patch + +------------------------------------------------------------------- +Mon Dec 18 18:18:18 UTC 2023 - olaf@aepfle.de + +- sync ExclusiveArch with SVT-AV1 +- move HEIF plugins from examples to separate package +- make sure all subpackages use the same libheif1 ABI + +------------------------------------------------------------------- +Tue Dec 12 12:12:12 UTC 2023 - olaf@aepfle.de + +- remove usage of presets to allow any cmake +- remove plugin conditional, to provide plugins on Leap as well +- remove rav1e conditional, because it is always available + +------------------------------------------------------------------- +Mon Dec 11 12:26:56 UTC 2023 - pgajdos@suse.com + +- security update +- added patches + fix CVE-2023-49462 [bsc#1217898], read16 segv + + libheif-CVE-2023-49462.patch + fix CVE-2023-49464 [bsc#1217900], UAF + + libheif-CVE-2023-49464.patch + +------------------------------------------------------------------- +Wed Nov 22 09:38:48 UTC 2023 - Dirk Müller + +- update to 1.17.5: + * Fixes installation of the Gnome "heif.thumbnailer" config + file. + +------------------------------------------------------------------- +Mon Nov 20 22:18:40 UTC 2023 - Dirk Müller + +- update to 1.17.4: + * ispe boxes in AVIF images with clap boxes were written with + the wrong size (would only happen with svt-av1 encoder), + always output MIAF brand for AVIF images + * fix kvazaar encoding with odd image sizes and encodings with + non-4:2:0 chroma + +------------------------------------------------------------------- +Fri Nov 3 14:49:07 UTC 2023 - Arjen de Korte + +- update to 1.17.3 + * Bug fix #1026: corrected transform box generation for + heif_orientation_flip_vertically and + heif_orientation_rotate_90_cw_then_flip_vertically + +- update to 1.17.2: + * #1010 loading of HEIF files with extra zero bytes at the end + * #1015 / #1017 default nclx values now match sRGB + * support JPEG2000 images with alpha channel + * various smaller fixes + +------------------------------------------------------------------- +Thu Oct 19 16:12:42 UTC 2023 - Arjen de Korte + +- update to 1.17.1: + * fix issue of loading images with premultiplied alpha channel + * correctly set compatible_version for macOS dylib builds + * fix loading HDR PNGs, but encoding them as 8-bit SDR + * fix saving AVIF with alpha using the SVT-AV1 encoder +- cmake-presets version 3 requires cmake >= 3.21 + +------------------------------------------------------------------- +Tue Oct 17 21:09:55 UTC 2023 - Arjen de Korte + +- update to 1.17.0: + * Kvazaar encoder (HEIC) as alternative to x265 + * ffmpeg decoder (HEIC) decoding with potential hardware decoder support + * jpegdec / jpegenc codecs for JPEG in HEIF + * j2kdec, j2kenc codecs for JPEG-2000 in HEIF (still experimental) + * added support for region masks + * added support for alpha channels in images decoded with JS/WASM + * heif-enc and heif-convert can be called with only input filenames, + input and output filename, or with -o option. This makes the use of the + two command more consistent. + * added 4:2:2 <-> 4:4:4 color conversion with bilinear upscaling / average + filtering + * heif_context_get_image_handle() can now also access non-top-level images + * add script to build Android libraries for all platforms + * known bugs have been fixed + +------------------------------------------------------------------- +Mon May 22 19:32:26 UTC 2023 - Arjen de Korte + +- update to 1.16.2: + * adds an option to heif-convert to set the PNG compression level + * fixes a few build issues with some compilers + * fixes the --encoder option in heif-enc + * fixes heif_item_get_properties_of_type and + heif_item_get_transformation_properties + +------------------------------------------------------------------- +Wed May 3 11:14:59 UTC 2023 - Arjen de Korte + +- Package the optional plugins in separate packages, so it is possible + to install a minimal version of the library without pulling in the + libraries needed by the plugins only. +- BuildRequires pkgconfig(libwebp) as it is required to make sharp-yuv + work. + +------------------------------------------------------------------- +Wed May 3 07:38:09 UTC 2023 - Dirk Müller + +- update to 1.16.1: + * Small maintenance update that fixes building the gdk-pixbuf + loader. + * The source package name has also been changed back to the old + naming scheme. + * Support for HEIFv2 regions (rgan) and user annotations + (udes). This enables to annotate regions in the image with + several geometric primitives and assign user text + descriptions to them. Thank you @bradh for the contributions. + Mask support will be added soon. + * Previously, chroma was downsampled and upsampled with a + simple nearest-neighbor method. We now included the sharp-yuv + chroma downsampling algorithm. This gives improved image + quality when images are downsampled to 4:2:0 and upsampled + with bilinear interpolation. Thank you @maryla-uc for the + contributions. + * The bilinear chroma upsampling and averaging downsampling + algorithms are also new. You can choose what to use. + * We added experimental support for decoding uncompressed + images according to ISO/IEC 23001-17:2023. This is work in + progress and currently decoding only. Thank you @bradh for + the contributions. + * There are new APIs to query the image transformations. Thus, + you may choose to get the original image and apply the + transformations yourself. + * A longstanding bug writing non-compliant 'ispe' boxes (image + size) has been fixed. Files should be standard compliant now. + * When building binary packages, you can now make use of a + CMake presets to set a default configuration. + * The deprecated autotools build files have been removed. + +------------------------------------------------------------------- +Thu Mar 30 18:46:30 UTC 2023 - Arjen de Korte + +- update to 1.15.2 + * Fixes an incompatibility with AOM v3.6.0. + * A couple of smaller fixes. + +------------------------------------------------------------------- +Thu Feb 28 15:21:03 UTC 2023 - Manfred Hollstein + +- Remove no longer existing files avif.xml and heif.xml from the + files list + +------------------------------------------------------------------- +Thu Feb 16 18:49:09 UTC 2023 - Arjen de Korte + +- update to 1.15.1 + * fix compilation without plugins + +- update to 1.15.0 + * codec plugin system now also works with Windows + * heif_convert: manually choose which decoder should be used + * support for CLLI (content light level box), MDCV (mastering + display colour volume), PASP (pixel aspect) information + * ICC profile support in gdk-pixbuf loader + * various fixes + +- build with plugins enabled on Tumbleweed +- remove upstreamed patches + - 2ca02a128b2f76f7f293aa86a2ce1e04a8306c65.patch + - b6812284a2d70f29a5121ec3dbe652da07fdbbb7.patch + +------------------------------------------------------------------- +Thu Feb 2 19:25:04 UTC 2023 - Manfred Hollstein + +- Use chrpath during build to delete otherwise illegal runtime + directories stored as RPATH in the executables + +------------------------------------------------------------------- +Fri Jan 27 14:32:03 UTC 2023 - Dirk Müller + +- add 2ca02a128b2f76f7f293aa86a2ce1e04a8306c65.patch + b6812284a2d70f29a5121ec3dbe652da07fdbbb7.patch: (bsc#1206945) + * replace internal API with public API and fix typo (Fixes #745) + +------------------------------------------------------------------- +Fri Jan 27 12:03:34 UTC 2023 - Arjen de Korte + +- The fix for rpath error for the examples sub-package was mistakenly + moved + +------------------------------------------------------------------- +Fri Jan 20 14:37:00 UTC 2023 - Arjen de Korte + +- Add missing BuildRequires for SVT-AV1 support for Tumbleweed (only + for x86_64) + +------------------------------------------------------------------- +Sun Jan 15 12:31:38 UTC 2023 - Arjen de Korte + +- Disable dynamic plugin interface and build plugins statically instead + (boo#1206945) + +------------------------------------------------------------------- +Sat Jan 7 16:16:22 UTC 2023 - Dirk Müller + +- update to v1.14.2: + * A function name typo in the C++ wrapper was corrected in v1.14.1, but + the old function name should not have been removed from the API + * (ColorProfile_nclx::set_color_primaries()). The old name is added to the + API again in this release. + +------------------------------------------------------------------- +Tue Jan 3 12:43:46 UTC 2023 - Dirk Müller + +- update to v1.14.1: + * various issues is the build system + * encoding images smaller than 64x64 with svt-av1 + * the 'quality' parameter for svt-av1 + * a potentially wrong image orientation for PNG inputs + * crash on non-null terminated XMP input + * HDR RGB to YCbCr conversion coefficients for limited range coefficients + +------------------------------------------------------------------- +Sat Dec 3 10:35:42 UTC 2022 - Dirk Müller + +- update to 1.14.0: + * adds SVT-AV1 encoder as AVIF backend + * dynamic plugin interface for installing codecs independently from libheif (currently Unix only) + * add XMP header compression (using zlib) + * library should now be initialized with heif_init() + * heif_convert: extract EXIF and XMP to separate files + * heif_enc: add benchmarking function to compare codecs + * copy EXIF/XMP between HEIC/AVIF files and JPEG/PNG in all kinds of combinations + * remove EXIF orientation tag from input when converting to HEIC/AVIF and + * generate irot/imir boxes matching the input orientation + +------------------------------------------------------------------- +Thu Nov 3 01:53:22 UTC 2022 - Yifan Jiang + +- The newly added thumbnailer is not only useful for gnome, so + rename the sub-package gnome-heif-thumbnailer to heif-thumbnailer + before its debut +- Supplement libeheif1 with heif-thumbnailer + +------------------------------------------------------------------- +Tue Nov 1 18:10:22 UTC 2022 - Andreas Schneider + +- Create a gnome-heif-thumbnailer sub-package (boo#1204865) + +------------------------------------------------------------------- +Mon Oct 31 08:41:43 UTC 2022 - Michael Vetter + +- Update to 1.13.0: + * pay attention to the correct chroma sample positions + * heif_image now holds a list of decoding warnings + * use AOM AOM_USAGE_ALL_INTRA mode instead of AOM_USAGE_GOOD_QUALITY + * 'strict' decoding mode with more checks for standard conformity of input + * support for EXIF data >64k in JPEG output + * proper library initialization and cleanup + * separate quality settings for alpha channel (AOM) + * improve color conversion speed (no lroundf) + * build and packaging fixes +- Remove 0f8496f22d284e1a69df12fe0b72f375aed31315.patch: contained +- boo#1204865: No HEIC image preview in nautilus fixed by update + +------------------------------------------------------------------- +Fri Aug 26 12:51:15 UTC 2022 - Andreas Schneider + +- Support version 1.0.0 of dav1d +- Added 0f8496f22d284e1a69df12fe0b72f375aed31315.patch + +------------------------------------------------------------------- +Fri Aug 12 16:13:06 UTC 2022 - David Haller + +- Fix rpath error for the examples sub-package + +------------------------------------------------------------------- +Fri May 27 16:27:00 UTC 2022 - Stanislav Brabec + +- Add missing gdk-pixbuf loader scriptlets (bsc#1199987). +- Recommend gdk-pixbuf-loader-libheif whenever both related + packages are installed. + +------------------------------------------------------------------- +Fri Jun 11 17:55:11 UTC 2021 - Bjørn Lie + +- Update to version 1.12.0: + + Check for MIAF conformance and add as compatible brand. + + Signaling of premultiplied alpha. + + Parse AV1 obu_sequence_header for av1C box. + + Write pixi box in AVIFs. + + Save alpha as monochrome in AVIF if possible. + + Many build fixes. + +------------------------------------------------------------------- +Wed Apr 7 23:21:55 UTC 2021 - Dirk Müller + +- update to 1.11.0: + * fix writing ispe box in HEIFs + * nclx output profile encoding parameters + * change the way nclx profiles is written so that macOS can read them + * API for listing file brands and checking file type + * fix heif_image_handle_get_depth_image_representation_info() + +------------------------------------------------------------------- +Fri Jan 8 07:26:59 UTC 2021 - Dominique Leuenberger + +- Add baselibs.conf: generate libheif1-32bit, which is a new + dependency for ImageMagick-32bit after that one now enabled + libheif support. + +------------------------------------------------------------------- +Fri Dec 25 15:20:28 UTC 2020 - Bjørn Lie + +- Build with dav1d and rav1e support, do this via: + + Add pkgconfig(dav1d) BuildRequires. + + Add conditional pkgconfig(rav1e) BuildRequires (currently + Tumbleweed only). +- Drop libheif-lang Recommends: Package does not exist. + +------------------------------------------------------------------- +Thu Dec 17 16:54:31 UTC 2020 - malcolmlewis@opensuse.org + +- Re-download tarball and check with osc service runall + download_files, all ok. + +------------------------------------------------------------------- +Wed Dec 16 14:16:35 UTC 2020 - malcolmlewis@opensuse.org + +- Updated to version 1.10.0: + * New API: may access all (vendor-dependent) auxiliary images + (e.g. hdrgainmap, semanticskinmatte, ...). + * When ICC profile is present, will now write two color boxes + (nclx and ICC) into AVIF files. Also reads files with two color + boxes. + * Alpha image is now saved as monochrome. + * Loading of 16bit greyscale PNGs in heif_enc. + * Deprecated heif_enc option "-E". + * Remove dependency on alloca(). + * Bug fixes. + +------------------------------------------------------------------- +Sun Nov 1 15:21:34 UTC 2020 - malcolmlewis@opensuse.org + +- Add build condition to enable additional options, codecs and + example binaries. +- Remove rav1e and dav1d support for the moment as still WIP. + +------------------------------------------------------------------- +Tue Oct 13 16:49:04 UTC 2020 - Andreas Schneider + +- Fix the License + +------------------------------------------------------------------- +Mon Oct 12 20:12:32 UTC 2020 - Andreas Schneider + +- Only build with AV1-AVIF support +- Update to version 1.9.1 + * https://github.com/strukturag/libheif/releases/tag/v1.9.1 +- fixed CVE-2020-23109 [bsc#1192382] + (bca0162018df9a32d21c05aad1fa203881fa7813) + +------------------------------------------------------------------- +Wed Jul 08 15:54:52 UTC 2018 - plinnell@opensuse.org + +- initial package for 1.3.2 diff --git a/libheif.spec b/libheif.spec new file mode 100644 index 0000000..31b2619 --- /dev/null +++ b/libheif.spec @@ -0,0 +1,379 @@ +# +# spec file for package libheif +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define gdk_pixbuf_binary_version 2.10.0 +%bcond_with x265 +%bcond_with kvazaar +%bcond_with svtenc +%if 0%{?suse_version} > 1500 +%ifarch aarch64 riscv64 x86_64 +%bcond_without svtenc +%endif +%endif + +Name: libheif +Version: 1.17.6 +Release: 0 +Summary: HEIF/AVIF file format decoder and encoder +License: GPL-2.0-or-later +Group: Productivity/Graphics/Other +URL: https://github.com/strukturag/libheif +Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz +Source99: baselibs.conf +BuildRequires: chrpath +BuildRequires: cmake +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: pkgconfig +BuildRequires: pkgconfig(aom) +BuildRequires: pkgconfig(dav1d) +BuildRequires: pkgconfig(gdk-pixbuf-2.0) +BuildRequires: pkgconfig(libavcodec) +BuildRequires: pkgconfig(libjpeg) +BuildRequires: pkgconfig(libopenjp2) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libwebp) +%if %{with kvazaar} +BuildRequires: pkgconfig(kvazaar) +%endif +BuildRequires: pkgconfig(rav1e) +%if %{with svtenc} +BuildRequires: pkgconfig(SvtAv1Enc) +%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. + +%if %{with kvazaar} +%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. +%endif + +%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 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. + +%if %{with svtenc} +%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. +%endif + +%if %{with x265} +%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. +%endif + +%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}. + +%if %{with x265} +%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}. +%endif + +%prep +%autosetup -p1 + +%build +%cmake \ + -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 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_FFMPEG_DECODER=ON \ + -DWITH_FFMPEG_DECODER_PLUGIN=ON \ + -DCMAKE_SKIP_RPATH=ON \ + -DBUILD_TESTING=OFF \ + -DWITH_REDUCED_VISIBILITY=ON \ + -DWITH_DEFLATE_HEADER_COMPRESSION=ON \ + -DWITH_LIBSHARPYUV=ON \ + -DWITH_FUZZERS=OFF \ +%if 0%{?suse_version} <= 1500 + -DCMAKE_CXX_FLAGS="-pthread" \ +%endif + -DPLUGIN_DIRECTORY=%{_libexecdir}/libheif \ + %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-convert \ + 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 libheif1 -p /sbin/ldconfig +%postun -n libheif1 -p /sbin/ldconfig + +%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 + +%files openjpeg +%{_libexecdir}/libheif/libheif-j2kdec.so +%{_libexecdir}/libheif/libheif-j2kenc.so + +%files rav1e +%{_libexecdir}/libheif/libheif-rav1e.so + +%if %{with svtenc} +%files svtenc +%{_libexecdir}/libheif/libheif-svtenc.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-enc +%{_bindir}/heif-info +%{_mandir}/man1/heif-convert.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 + +%changelog