From cb4e1de75326662ca4ddf22b479d90649dde1e4c Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Fri, 18 Oct 2024 00:14:38 +0200 Subject: [PATCH] update to version 1.4.0 Signed-off-by: Toshaan Bharvani --- SOURCES/libwebp-cmakedir.patch | 12 ++ SOURCES/libwebp-freeglut.patch | 25 ++- SOURCES/libwebp-mingw-libsuffix.patch | 13 ++ SOURCES/libwebp-rpath.patch | 20 ++ SPECS/libwebp.spec | 294 ++++++++++++++++++++++---- 5 files changed, 314 insertions(+), 50 deletions(-) create mode 100644 SOURCES/libwebp-cmakedir.patch create mode 100644 SOURCES/libwebp-mingw-libsuffix.patch create mode 100644 SOURCES/libwebp-rpath.patch diff --git a/SOURCES/libwebp-cmakedir.patch b/SOURCES/libwebp-cmakedir.patch new file mode 100644 index 0000000..811794a --- /dev/null +++ b/SOURCES/libwebp-cmakedir.patch @@ -0,0 +1,12 @@ +diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt +--- libwebp-1.4.0/CMakeLists.txt 2024-04-14 15:30:20.053730120 +0200 ++++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:20.056730140 +0200 +@@ -784,7 +784,7 @@ install( + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +-set(ConfigPackageLocation ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake/) ++set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/) + install(EXPORT ${PROJECT_NAME}Targets NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${ConfigPackageLocation}) + diff --git a/SOURCES/libwebp-freeglut.patch b/SOURCES/libwebp-freeglut.patch index 99facf6..676e71d 100644 --- a/SOURCES/libwebp-freeglut.patch +++ b/SOURCES/libwebp-freeglut.patch @@ -1,7 +1,7 @@ -diff -rupN --no-dereference libwebp-1.2.0/CMakeLists.txt libwebp-1.2.0-new/CMakeLists.txt ---- libwebp-1.2.0/CMakeLists.txt 2021-01-21 04:43:45.000000000 +0100 -+++ libwebp-1.2.0-new/CMakeLists.txt 2021-02-01 11:37:20.760764115 +0100 -@@ -506,8 +506,8 @@ endif() +diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt +--- libwebp-1.4.0/CMakeLists.txt 2024-04-12 22:48:48.000000000 +0200 ++++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:19.981729641 +0200 +@@ -582,8 +582,8 @@ endif() if(WEBP_BUILD_VWEBP) # vwebp @@ -12,10 +12,19 @@ diff -rupN --no-dereference libwebp-1.2.0/CMakeLists.txt libwebp-1.2.0-new/CMake include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS}) parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "VWEBP_SRCS" "vwebp") add_executable(vwebp ${VWEBP_SRCS}) -diff -rupN --no-dereference libwebp-1.2.0/examples/vwebp.c libwebp-1.2.0-new/examples/vwebp.c ---- libwebp-1.2.0/examples/vwebp.c 2021-01-21 04:43:45.000000000 +0100 -+++ libwebp-1.2.0-new/examples/vwebp.c 2021-02-01 11:37:20.760764115 +0100 -@@ -27,7 +27,7 @@ +@@ -591,7 +591,7 @@ if(WEBP_BUILD_VWEBP) + vwebp + ${OPENGL_LIBRARIES} + exampleutil +- GLUT::GLUT ++ glut + imageioutil + webp + webpdemux) +diff -rupN --no-dereference libwebp-1.4.0/examples/vwebp.c libwebp-1.4.0-new/examples/vwebp.c +--- libwebp-1.4.0/examples/vwebp.c 2024-04-12 22:48:48.000000000 +0200 ++++ libwebp-1.4.0-new/examples/vwebp.c 2024-04-14 15:30:19.981729641 +0200 +@@ -28,7 +28,7 @@ #if defined(HAVE_GLUT_GLUT_H) #include #else diff --git a/SOURCES/libwebp-mingw-libsuffix.patch b/SOURCES/libwebp-mingw-libsuffix.patch new file mode 100644 index 0000000..9cda88c --- /dev/null +++ b/SOURCES/libwebp-mingw-libsuffix.patch @@ -0,0 +1,13 @@ +diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt +--- libwebp-1.4.0/CMakeLists.txt 2024-04-14 15:30:20.015729868 +0200 ++++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:20.020729901 +0200 +@@ -301,6 +301,9 @@ macro(set_version FILE TARGET_NAME NAME_ + MACHO_CURRENT_VERSION + ${LIBWEBP_MACHO_COMPATIBILITY_VERSION}.${LT_REVISION}) + endif() ++ if(WIN32) ++ set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX "-${LT_CURRENT_MINUS_AGE}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ endif(WIN32) + endmacro() + + # ############################################################################## diff --git a/SOURCES/libwebp-rpath.patch b/SOURCES/libwebp-rpath.patch new file mode 100644 index 0000000..e066270 --- /dev/null +++ b/SOURCES/libwebp-rpath.patch @@ -0,0 +1,20 @@ +diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt +--- libwebp-1.4.0/CMakeLists.txt 2024-04-14 15:30:20.089730360 +0200 ++++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:20.093730386 +0200 +@@ -114,11 +114,11 @@ endif() + include(cmake/deps.cmake) + include(GNUInstallDirs) + +-if(BUILD_SHARED_LIBS AND NOT DEFINED CMAKE_INSTALL_RPATH) +- # Set the rpath to match autoconf/libtool behavior. Note this must be set +- # before target creation. +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +-endif() ++# if(BUILD_SHARED_LIBS AND NOT DEFINED CMAKE_INSTALL_RPATH) ++# # Set the rpath to match autoconf/libtool behavior. Note this must be set ++# # before target creation. ++# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++# endif() + + # ############################################################################## + # Options. diff --git a/SPECS/libwebp.spec b/SPECS/libwebp.spec index 42f5852..e5ba380 100644 --- a/SPECS/libwebp.spec +++ b/SPECS/libwebp.spec @@ -1,26 +1,64 @@ %global _hardened_build 1 +%ifarch %{java_arches} +%bcond_without java +%else +%bcond_with java +%endif + +%if 0%{?rhel} +%bcond_with mingw +%else +%bcond_without mingw +%endif + Name: libwebp -Version: 1.2.0 -Release: 3%{?dist} +Version: 1.4.0 +Release: 1%{?dist} URL: http://webmproject.org/ Summary: Library and tools for the WebP graphics format # Additional IPR is licensed as well. See PATENTS file for details -License: BSD +License: Apache-2.0 AND LicenseRef-scancode-google-patent-license-webm AND BSD-3-Clause AND FSFULLRWD Source0: http://downloads.webmproject.org/releases/webp/%{name}-%{version}.tar.gz Source1: libwebp_jni_example.java +# Fix build with freeglut Patch0: libwebp-freeglut.patch - +# Add version suffix to mingw libraries +Patch1: libwebp-mingw-libsuffix.patch +# Fix cmake module install location +Patch2: libwebp-cmakedir.patch +# Kill rpath +Patch3: libwebp-rpath.patch + +BuildRequires: cmake +BuildRequires: freeglut-devel +BuildRequires: gcc +BuildRequires: giflib-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel -BuildRequires: giflib-devel BuildRequires: libtiff-devel +%if %{with java} BuildRequires: java-devel BuildRequires: jpackage-utils BuildRequires: swig -BuildRequires: autoconf automake libtool -BuildRequires: freeglut-devel -BuildRequires: make +%endif + +%if %{with mingw} +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-giflib +BuildRequires: mingw32-libpng +BuildRequires: mingw32-libjpeg + +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-gcc +BuildRequires: mingw64-binutils +BuildRequires: mingw64-giflib +BuildRequires: mingw64-libpng +BuildRequires: mingw64-libjpeg +%endif + %description WebP is an image format that does lossy compression of digital @@ -53,6 +91,7 @@ developers can use WebP to compress, archive and distribute digital images more efficiently. +%if %{with java} %package java Summary: Java bindings for libwebp, a library for the WebP format Requires: %{name}%{?_isa} = %{version}-%{release} @@ -61,6 +100,28 @@ Requires: jpackage-utils %description java Java bindings for libwebp. +%endif + + +%if %{with mingw} +%package -n mingw32-%{name} +Summary: MinGW Windows %{name} library +BuildArch: noarch + +%description -n mingw32-%{name} +MinGW Windows %{name} library. + + +%package -n mingw64-%{name} +Summary: MinGW Windows %{name} library +BuildArch: noarch + +%description -n mingw64-%{name} +MinGW Windows %{name} library. + + +%{?mingw_debug_package} +%endif %prep @@ -68,19 +129,18 @@ Java bindings for libwebp. %build -autoreconf -vif -%ifarch aarch64 -export CFLAGS="%{optflags} -frename-registers" +# Native build +%cmake +%cmake_build + +%if %{with mingw} +# MinGW build +%mingw_cmake -DWEBP_BUILD_VWEBP=OFF +%mingw_make_build %endif -# Neon disabled due to resulting CFLAGS conflict resulting in -# inlining failed in call to always_inline '[...]': target specific option mismatch -%configure --disable-static --enable-libwebpmux \ - --enable-libwebpdemux --enable-libwebpdecoder \ - --disable-neon -%make_build V=1 -make -C examples vwebp - -# swig generated Java bindings + +%if %{with java} +# SWIG generated Java bindings cp %{SOURCE1} . cd swig rm -rf libwebp.jar libwebp_java_wrap.c @@ -94,25 +154,64 @@ gcc %{__global_ldflags} %{optflags} -shared \ -I/usr/lib/jvm/java/include \ -I/usr/lib/jvm/java/include/linux \ -I../src \ - -L../src/.libs -lwebp libwebp_java_wrap.c \ + -L../%{_vpath_builddir} -lwebp libwebp_java_wrap.c \ -o libwebp_jni.so cd java javac com/google/webp/libwebp.java jar cvf ../libwebp.jar com/google/webp/*.class +%endif %install -%make_install +# Native build +%cmake_install + +%if %{with mingw} +# MinGW build +%mingw_make_install +rm -rf %{buildroot}%{mingw32_mandir} +rm -rf %{buildroot}%{mingw64_mandir} +%endif + find "%{buildroot}/%{_libdir}" -type f -name "*.la" -delete -# swig generated Java bindings +%if %{with java} +# SWIG generated Java bindings mkdir -p %{buildroot}/%{_libdir}/%{name}-java cp swig/*.jar swig/*.so %{buildroot}/%{_libdir}/%{name}-java/ +%endif + + +%{?mingw_debug_install_post} + + +%check +%ctest -%ldconfig_scriptlets +%files +%doc README.md PATENTS NEWS AUTHORS +%license COPYING +%{_libdir}/%{name}.so.7* +%{_libdir}/%{name}decoder.so.3* +%{_libdir}/%{name}demux.so.2* +%{_libdir}/%{name}mux.so.3* +%{_libdir}/libsharpyuv.so.0* +%files devel +%{_libdir}/%{name}.so +%{_libdir}/%{name}decoder.so +%{_libdir}/%{name}demux.so +%{_libdir}/%{name}mux.so +%{_libdir}/libsharpyuv.so +%{_includedir}/webp/ +%{_libdir}/pkgconfig/libwebp.pc +%{_libdir}/pkgconfig/libwebpdecoder.pc +%{_libdir}/pkgconfig/libwebpdemux.pc +%{_libdir}/pkgconfig/libwebpmux.pc +%{_libdir}/pkgconfig/libsharpyuv.pc +%{_libdir}/cmake/WebP/ %files tools %{_bindir}/cwebp @@ -124,31 +223,142 @@ cp swig/*.jar swig/*.so %{buildroot}/%{_libdir}/%{name}-java/ %{_bindir}/vwebp %{_mandir}/man*/* -%files -n %{name} -%doc README PATENTS NEWS AUTHORS -%license COPYING -%{_libdir}/%{name}.so.7* -%{_libdir}/%{name}decoder.so.3* -%{_libdir}/%{name}demux.so.2* -%{_libdir}/%{name}mux.so.3* - -%files devel -%{_libdir}/%{name}*.so -%{_includedir}/* -%{_libdir}/pkgconfig/* - +%if %{with java} %files java %doc libwebp_jni_example.java %{_libdir}/%{name}-java/ +%endif + +%if %{with mingw} +%files -n mingw32-libwebp +%license PATENTS COPYING +%{mingw32_bindir}/cwebp.exe +%{mingw32_bindir}/dwebp.exe +%{mingw32_bindir}/gif2webp.exe +%{mingw32_bindir}/img2webp.exe +%{mingw32_bindir}/webpinfo.exe +%{mingw32_bindir}/webpmux.exe +%{mingw32_bindir}/libwebp-7.dll +%{mingw32_bindir}/libwebpdecoder-3.dll +%{mingw32_bindir}/libwebpdemux-2.dll +%{mingw32_bindir}/libwebpmux-3.dll +%{mingw32_bindir}/libsharpyuv-0.dll +%{mingw32_includedir}/webp/ +%{mingw32_libdir}/pkgconfig/libwebp.pc +%{mingw32_libdir}/pkgconfig/libwebpdecoder.pc +%{mingw32_libdir}/pkgconfig/libwebpdemux.pc +%{mingw32_libdir}/pkgconfig/libwebpmux.pc +%{mingw32_libdir}/pkgconfig/libsharpyuv.pc +%{mingw32_libdir}/cmake/WebP/ +%{mingw32_libdir}/libwebp.dll.a +%{mingw32_libdir}/libwebpdecoder.dll.a +%{mingw32_libdir}/libwebpdemux.dll.a +%{mingw32_libdir}/libwebpmux.dll.a +%{mingw32_libdir}/libsharpyuv.dll.a + +%files -n mingw64-libwebp +%license PATENTS COPYING +%{mingw64_bindir}/cwebp.exe +%{mingw64_bindir}/dwebp.exe +%{mingw64_bindir}/gif2webp.exe +%{mingw64_bindir}/img2webp.exe +%{mingw64_bindir}/webpinfo.exe +%{mingw64_bindir}/webpmux.exe +%{mingw64_bindir}/libwebp-7.dll +%{mingw64_bindir}/libwebpdecoder-3.dll +%{mingw64_bindir}/libwebpdemux-2.dll +%{mingw64_bindir}/libwebpmux-3.dll +%{mingw64_bindir}/libsharpyuv-0.dll +%{mingw64_includedir}/webp/ +%{mingw64_libdir}/pkgconfig/libwebp.pc +%{mingw64_libdir}/pkgconfig/libwebpdecoder.pc +%{mingw64_libdir}/pkgconfig/libwebpdemux.pc +%{mingw64_libdir}/pkgconfig/libwebpmux.pc +%{mingw64_libdir}/pkgconfig/libsharpyuv.pc +%{mingw64_libdir}/cmake/WebP/ +%{mingw64_libdir}/libwebp.dll.a +%{mingw64_libdir}/libwebpdecoder.dll.a +%{mingw64_libdir}/libwebpdemux.dll.a +%{mingw64_libdir}/libwebpmux.dll.a +%{mingw64_libdir}/libsharpyuv.dll.a +%endif %changelog -* Mon Aug 09 2021 Mohan Boddu - 1.2.0-3 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 +* Sun Apr 14 2024 Sandro Mani - 1.4.0-1 +- Update to 1.4.0 + +* Wed Feb 14 2024 Martin Stransky - 1.3.2-5 +- Migrated to SPDX license + +* Thu Jan 25 2024 Fedora Release Engineering - 1.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1.3.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Sep 28 2023 Sandro Mani - 1.3.2-2 +- Backport upstream fix for CVE-2023-5129 + +* Mon Sep 18 2023 Sandro Mani - 1.3.2-1 +- Update to 1.3.2 + +* Wed Sep 13 2023 Boudhayan Bhattacharya - 1.3.1-3 +- Add patch for CVE-2023-4863 ref rhbz#2238543 + +* Thu Jul 20 2023 Fedora Release Engineering - 1.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jun 30 2023 Sandro Mani - 1.3.1-1 +- Update to 1.3.1 + +* Thu Jan 19 2023 Fedora Release Engineering - 1.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jan 13 2023 Sandro Mani - 1.3.0-1 +- Update to 1.3.0 + +* Thu Sep 22 2022 Sandro Mani - 1.2.4-2 +- Add libwebp_libsuffix.patch + +* Sun Aug 07 2022 Sandro Mani - 1.2.4-1 +- Update to 1.2.4 + +* Thu Jul 21 2022 Fedora Release Engineering - 1.2.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 20 2022 Sandro Mani - 1.2.3-1 +- Update to 1.2.3 + +* Tue Jul 05 2022 Sandro Mani - 1.2.2-6 +- Limit -java subpackage to %%java_arches + +* Fri Mar 25 2022 Sandro Mani - 1.2.2-5 +- Rebuild with mingw-gcc-12 + +* Thu Feb 24 2022 Sandro Mani - 1.2.2-4 +- Make mingw subpackages noarch + +* Sat Feb 19 2022 Sandro Mani - 1.2.2-3 +- Add mingw subpackage + +* Sat Feb 05 2022 Jiri Vanek - 1.2.2-2 +- Rebuilt for java-17-openjdk as system jdk + +* Thu Jan 20 2022 Sandro Mani - 1.2.2-1 +- Update to 1.2.2 + +* Thu Jan 06 2022 Peter Robinson - 1.2.1-3 +- Drop aarch64 CFLAGS FTB workaround + +* Sun Jan 02 2022 Dennis Gilmore - 1.2.2-2 +- do not disable neon support + +* Sun Aug 15 2021 Sandro Mani - 1.2.1-1 +- Update to 1.2.1 -* Fri Apr 16 2021 Mohan Boddu - 1.2.0-2 -- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 +* Thu Jul 22 2021 Fedora Release Engineering - 1.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Mon Feb 01 2021 Sandro Mani - 1.2.0-1 - Update to 1.2.0