Sync from SUSE:ALP:Source:Standard:1.0 libjpeg-turbo revision de3094534ad69255f5c29f2eb8aaa19b

This commit is contained in:
Adrian Schröter 2024-02-19 17:55:59 +01:00
commit 624cb90f15
9 changed files with 1343 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>libjpeg62-turbo</package>
</multibuild>

13
baselibs.conf Normal file
View File

@ -0,0 +1,13 @@
libjpeg8
libjpeg8-devel
conflicts "jpeg-devel-<targettype>"
provides "jpeg-devel-<targettype>"
requires "libjpeg8-<targettype> = <version>"
libjpeg62
obsoletes "libjpeg-<targettype> = 6.2.0"
libjpeg62-devel
obsoletes "libjpeg-devel-<targettype> = 6.2.0"
conflicts "jpeg-devel-<targettype>"
provides "jpeg-devel-<targettype>"
requires "libjpeg62-<targettype> = <version>"
libturbojpeg0

View File

@ -0,0 +1,38 @@
--- a/jdhuff.c
+++ b/jdhuff.c
@@ -649,3 +649,35 @@
entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
}
}
+/*
+ * BEWARE OF KLUDGE: This subroutine is a hack for decoding illegal JPEG-in-
+ * TIFF encapsulations produced by Microsoft's Wang Imaging
+ * for Windows application with the public-domain TIFF Library. Based upon an
+ * examination of selected output files, this program apparently divides a JPEG
+ * bit-stream into consecutive horizontal TIFF "strips", such that the JPEG
+ * encoder's/decoder's DC coefficients for each image component are reset before
+ * each "strip". Moreover, a "strip" is not necessarily encoded in a multiple
+ * of 8 bits, so one must sometimes discard 1-7 bits at the end of each "strip"
+ * for alignment to the next input-Byte storage boundary. IJG JPEG Library
+ * decoder state is not normally exposed to client applications, so this sub-
+ * routine provides the TIFF Library with a "hook" to make these corrections.
+ * It should be called after "jpeg_start_decompress()" and before
+ * "jpeg_finish_decompress()", just before decoding each "strip" using
+ * "jpeg_read_raw_data()" or "jpeg_read_scanlines()".
+ *
+ * This kludge is not sanctioned or supported by the Independent JPEG Group, and
+ * future changes to the IJG JPEG Library might invalidate it. Do not send bug
+ * reports about this code to IJG developers. Instead, contact the author for
+ * advice: Scott B. Marovich <marovich@hpl.hp.com>, Hewlett-Packard Labs, 6/01.
+ */
+GLOBAL(void)
+jpeg_reset_huff_decode (register j_decompress_ptr cinfo,register float *refbw)
+{ register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
+ register int ci = 0;
+
+ /* Re-initialize DC predictions */
+ do entropy->saved.last_dc_val[ci] = -refbw[ci << 1];
+ while (++ci < cinfo->comps_in_scan);
+ /* Discard encoded input bits, up to the next Byte boundary */
+ entropy->bitstate.bits_left &= ~7;
+}

BIN
libjpeg-turbo-3.0.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

1002
libjpeg-turbo.changes Normal file

File diff suppressed because it is too large Load Diff

30
libjpeg-turbo.keyring Normal file
View File

@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.6
Comment: Hostname: sks.pod02.fleetstreetops.com
mQINBF+tkd4BEADFFp/owDcrHfGDEfxJfaDaUlHaxs2F5jWvhyThimpJbuDdrtZ06dAw7CJ+
LY/53Xo1ogZJZb1UuJ9qFunkA601WmbKeOOxSj4UNdQM+T8oMxJklnQh3iNTb4DeLh6+eS2j
VO/q4lEGYC3XwuinuhpqMsvAFfbDkgSp3nm0rI2hEOysm+UBp/xyBISPzUYKzZGC24MKt8Nz
oevKq86JfVUMkvgb756fWoRrbBkGn3tZEDr3EClMTiQSyxdKdVpwa9EtEuezXptgbQcjXV5H
Hhh8XEF9zbnkY7VYaCn/Cd0ETjscPRig9H2IFjSyF5tmAfezGB5D5kCRu60ufCnFG1YXIuD2
Mc0o9msHfEwD7Uy7jRgxpgljMeaQhRG2tcwd1fW34vNOBd5spRNULGkdlbzAOczd6RTNrD10
24xE5OHve2t1+Qc9TyJz8mjAk2bbbeFNYjKTMbKIrxfBEL+kYpUD9mr1xl7lM3qZKrwFvu/C
Rp1rohvW9M7JZLusYthyA8Cv/OL8bQkTYc1Cpod1QCtN1OKt33cyjEKkO5B5EKay0x1vz85X
ATXUbEUeeFe6TLICylK18FxM6i6D7aKJcw0cu1nigvWFrnBhc84xz0d6PwhXGFYVkvMIPFBX
R98rWMJi6Aryby1oQModVyjgefMEl167NNGFUVfjmTZSJP4ywwARAQABtF1UaGUgbGlianBl
Zy10dXJibyBQcm9qZWN0IChTaWduaW5nIGtleSBmb3Igb2ZmaWNpYWwgYmluYXJpZXMpIDxp
bmZvcm1hdGlvbkBsaWJqcGVnLXR1cmJvLm9yZz6JAjYEEwECACAFAl+tkd4CGwMGCwkIBwMC
BBUCCAMEFgIDAQIeAQIXgAAKCRB+wtu29Nv0NEBcEACbJw1RHP2T622KVvO5oq2RW5vRn4Rv
+hOyJgZHsgNkchP+6QqxgVPdxl3N7la286KfDblFGsqvNt7sce873Qlh/KuMcJ+3mBbmO8v7
4mRbG9aLk/M0UdlZBTnGs9D26jpXfyOGOXVeiFW621ghKq7WbdpXa75rK4afpVP9VFvgvw51
Ms9ZoAI81+rnp+H2Kkmo328i+HZcIaGo2K/F6rRvhdEz24PwFA9o8xHmSIHiBUYv/oOrlqM3
VFXcAGwU7zAIATUSmPgmdmcrxlKI75wwAm4tCxk5Vo1BPxCQEP7rjblPDkqLhTjhwphhSu0S
NfpLopiIB4IH8iaM02DhC7SNILhCyKcTyTLdiDQLbY1tCEfYdu90kmD7lLBR+Ek0exOec3QL
ZR8bajj7gmABfL1gkw0UJWST/H+crmTYV2Iu6T96zQo/37xg0XeWKQUsRQv85dK0qyvUxBAp
964ey07DuFz/eLJbX9FzeHhEWS+QRMHntrn211BzhSm7BPWx79wmmyQ8xhof29Z+DsfluS5X
yDnwA9KaZ4g77Ig9sub8RNJxJfVrXns2tTBnVLsysNbdIMT0M42NPk3QWCGcNhCwoyri7fu3
1AGjeo7bg1mqP4xFZVxsx7CWimFPBemClj+R94c7URT1I5IEK7Q+HxkML49Ou3IF2+aEXKJP
geTXZ4hGBBMRAgAGBQJfrZInAAoJEIXHBE4DP94W3McAoNmyT2L9j+7JbZgNkuKz442R2s7K
AKDh2mL458y99LgK/U7AtLi8uWnVvA==
=R+n+
-----END PGP PUBLIC KEY BLOCK-----

230
libjpeg-turbo.spec Normal file
View File

@ -0,0 +1,230 @@
#
# spec file for package libjpeg-turbo
#
# 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/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
%global flavor libjpeg-turbo
%endif
%define asan_build 0
%define debug_build 0
%define srcver 3.0.2
%if "%{flavor}" == "libjpeg-turbo"
%define major 8
%define minor 3
%define micro 2
%define tmajor 0
%define tminor 3
%define tmicro 0
%define tlibver %{tmajor}.%{tminor}.%{tmicro}
%endif
%if "%{flavor}" == "libjpeg62-turbo"
%define major 62
%define minor 4
%define micro 0
%endif
%define libver %{major}.%{minor}.%{micro}
Name: %{flavor}
Version: %{srcver}
Release: 0
Summary: A SIMD-accelerated library for manipulating JPEG image files
License: BSD-3-Clause
URL: https://libjpeg-turbo.org/
Source0: https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%{version}/libjpeg-turbo-%{version}.tar.gz
Source1: https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%{version}/libjpeg-turbo-%{version}.tar.gz.sig
Source2: libjpeg-turbo.keyring
Source3: baselibs.conf
Patch1: libjpeg-turbo-1.3.0-tiff-ojpeg.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: nasm
BuildRequires: pkgconfig
%if "%{flavor}" == "libjpeg-turbo"
Conflicts: jpeg%{major}
Obsoletes: jpeg = 6b
Obsoletes: jpeg = 8.0.1
Obsoletes: jpeg = 8.0.2
Provides: jpeg = %{version}
Obsoletes: jpeg < %{version}
Provides: jpegtran = %{version}
%{?suse_build_hwcaps_libs}
%endif
%if "%{flavor}" == "libjpeg62-turbo"
# needed for tests as we remove the lib here
BuildRequires: libturbojpeg0 >= 8.2.2
Conflicts: jpeg%{major}
%endif
%description
The libjpeg-turbo package contains a library of functions for manipulating
JPEG images. It supports architecture-specific SIMD instructions,
such as SSE/SSE2/AVX2, AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
%if "%{flavor}" == "libjpeg-turbo"
It also includes the following command line utilities:
djpeg - decompress a JPEG file to an image file
jpegtran - lossless transformation of JPEG files
rdjpgcom - display text comments from a JPEG file
wrjpgcom - insert text comments into a JPEG file
tjbench - a JPEG decompression/compression benchmark
%endif
%package -n libjpeg%{major}
Version: %{libver}
Release: 0
Summary: A SIMD-accelerated JPEG compression/decompression library
%description -n libjpeg%{major}
A library for manipulating JPEG images. It supports
architecture-specific SIMD instructions, such as SSE/SSE2/AVX2,
AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
%if "%{flavor}" == "libjpeg-turbo"
%package -n libturbojpeg%{tmajor}
Version: %{version}
Release: 0
Summary: A SIMD-accelerated JPEG compression/decompression library
%description -n libturbojpeg%{tmajor}
A library for manipulating JPEG images. It supports
architecture-specific SIMD instructions, such as SSE/SSE2/AVX2,
AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
%endif
%package -n libjpeg%{major}-devel
Version: %{libver}
Release: 0
Summary: Development Tools for applications which will use the Libjpeg Library
Requires: libjpeg%{major} = %{version}
%if "%{flavor}" == "libjpeg-turbo"
Requires: libturbojpeg%{tmajor} = %{version}
%endif
Conflicts: libjpeg-devel
Provides: libjpeg-devel = %{version}
Obsoletes: libjpeg-devel < %{version}
%description -n libjpeg%{major}-devel
The libjpeg-devel package includes the header files and libraries
necessary for compiling and linking programs which will manipulate JPEG
files using the libjpeg library.
%prep
%autosetup -p1 -n libjpeg-turbo-%{srcver}
%build
MYLDFLAGS="-Wl,-z,relro,-z,now"
MYCFLAGS="%{optflags}"
%if %{asan_build}
MYLDFLAGS="$MYLDFLAGS -lasan"
MYCFLAGS="$MYCFLAGS -fsanitize=address"
%endif
%if %{debug_build}
MYCFLAGS="$MYCFLAGS -O0 -g"
%endif
%cmake \
%if "%{flavor}" == "libjpeg-turbo"
-DWITH_JPEG8=ON \
%endif
%if %{debug_build} || %{asan_build}
-DCMAKE_BUILD_TYPE=DEBUG \
-DCMAKE_C_FLAGS_DEBUG="$MYCFLAGS" \
%endif
%ifarch armv6l armv6hl
-DWITH_SIMD=FALSE \
%endif
%ifarch x86_64 %{ix86} aarch64 ppc64le
-DREQUIRE_SIMD=TRUE \
%endif
-DCMAKE_SHARED_LINKER_FLAGS="$MYLDFLAGS" \
-DENABLE_STATIC=OFF \
%ifarch s390x riscv64
-DFLOATTEST=fp-contract \
%endif
%{nil}
%make_build
%check
%if %{asan_build}
# ASAN needs /proc to be mounted
exit 0
%endif
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
%if 0%{?fedora_version} || 0%{?centos_version}
ctest --output-on-failure --force-new-ctest-process
%else
%ctest
%endif
%install
%if 0%{?fedora_version} || 0%{?centos_version}
make DESTDIR=%{buildroot} install/fast
%else
%cmake_install
%endif
# Remove docs, we'll select docs manually
rm -rf %{buildroot}%{_datadir}/doc/
%if "%{flavor}" == "libjpeg62-turbo"
# Remove unwanted files
rm %{buildroot}%{_bindir}/*
rm %{buildroot}%{_mandir}/man1/*
# libjpegturbo is provided with libjpeg-turbo.spec yet
rm %{buildroot}%{_includedir}/turbojpeg.h
rm %{buildroot}%{_libdir}/libturbojpeg.so*
rm %{buildroot}%{_libdir}/pkgconfig/libturbojpeg.pc
rm -r %{buildroot}%{_libdir}/cmake
%endif
%post -n libjpeg%{major} -p /sbin/ldconfig
%postun -n libjpeg%{major} -p /sbin/ldconfig
%if "%{flavor}" == "libjpeg-turbo"
%post -n libturbojpeg%{tmajor} -p /sbin/ldconfig
%postun -n libturbojpeg%{tmajor} -p /sbin/ldconfig
%endif
%if "%{flavor}" == "libjpeg-turbo"
%files
%doc README.md change.log ChangeLog.md
%doc usage.txt wizard.txt
%{_bindir}/*
%{_mandir}/man1/*
%endif
%files -n libjpeg%{major}
%license LICENSE.md
%{_libdir}/libjpeg.so.%{libver}
%{_libdir}/libjpeg.so.%{major}
%if "%{flavor}" == "libjpeg-turbo"
%files -n libturbojpeg%{tmajor}
%license LICENSE.md
%{_libdir}/libturbojpeg.so.%{tmajor}
%{_libdir}/libturbojpeg.so.%{tlibver}
%endif
%files -n libjpeg%{major}-devel
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%{_libdir}/pkgconfig/libjpeg.pc
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt tjexample.c
%if "%{flavor}" == "libjpeg-turbo"
%{_libdir}/libturbojpeg.so
%{_libdir}/pkgconfig/libturbojpeg.pc
%dir %{_libdir}/cmake/libjpeg-turbo
%{_libdir}/cmake/libjpeg-turbo/*
%endif
%changelog