diff --git a/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch b/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7f104fa477594ab7103ed637b2c64b60f692dde --- /dev/null +++ b/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch @@ -0,0 +1,102 @@ +From 035ea386d1b6a99a8a1e2ab57cc1fc903569136c Mon Sep 17 00:00:00 2001 +From: DRC +Date: Thu, 6 Jul 2023 12:04:22 -0400 +Subject: [PATCH] Build: Fix regression test concurrency issues + +- The example-*bit-*-decompress test must run after the + example-*bit-*-compress test, since the latter generates + testout*-example.jpg. + +- Add -static to the filenames of all output files generated by the + "static" regression tests, to avoid conflicts with the "shared" + regression tests. + +- Add the PID to the filenames of all files generated by the tjunittest + packed-pixel image I/O tests. + +- Check the return value of MD5File() in tjunittest to avoid a segfault + if the file doesn't exist. (Prior to the fix described above, that + could occur if two instances of tjunittest ran concurrently from the + same directory with the same -bmp and -precision arguments.) + +Fixes #705 +--- + CMakeLists.txt | 10 ++++++---- + tjunittest.c | 8 ++++++-- + 2 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index efd101a07..f0b9e9377 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1004,7 +1004,7 @@ foreach(libtype ${TEST_LIBTYPES}) + + if(sample_bits EQUAL 12) + set(tjbench tjbench12) +- set(testout testout12) ++ set(testout testout12${suffix}) + + set(MD5_PPM_GRAY_TILE 2f799249148b1a9d0e61fa4408f6c397) + set(MD5_PPM_420_8x8_TILE b25684e1af37be504ee3fd137757353f) +@@ -1024,7 +1024,7 @@ foreach(libtype ${TEST_LIBTYPES}) + set(MD5_PPM_444_TILE 2f571a032e4dbc8ef40f75219d336b0b) + else() + set(tjbench tjbench) +- set(testout testout) ++ set(testout testout${suffix}) + + set(MD5_PPM_GRAY_TILE 2c3b567086e6ca0c5e6d34ad8d6f6fe8) + set(MD5_PPM_420_8x8_TILE efca1bdf0226df01777137778cf986ec) +@@ -1160,7 +1160,7 @@ foreach(libtype ${TEST_LIBTYPES}) + set(cjpeg cjpeg12) + set(djpeg djpeg12) + set(jpegtran jpegtran12) +- set(testout testout12) ++ set(testout testout12${suffix}) + + set(TESTORIG testorig12.jpg) + set(MD5_JPEG_RGB_ISLOW 9d7369207c520d37f2c1cbfcb82b2964) +@@ -1222,7 +1222,7 @@ foreach(libtype ${TEST_LIBTYPES}) + set(cjpeg cjpeg) + set(djpeg djpeg) + set(jpegtran jpegtran) +- set(testout testout) ++ set(testout testout${suffix}) + + set(TESTORIG testorig.jpg) + set(MD5_JPEG_RGB_ISLOW 1d44a406f61da743b5fd31c0a9abdca3) +@@ -1632,6 +1632,8 @@ foreach(libtype ${TEST_LIBTYPES}) + add_test(example-${sample_bits}bit-${libtype}-decompress + ${CMAKE_CROSSCOMPILING_EMULATOR} example${suffix} decompress + ${EXAMPLE_12BIT_ARG} ${testout}-example.jpg ${testout}-example.ppm) ++ set_tests_properties(example-${sample_bits}bit-${libtype}-decompress ++ PROPERTIES DEPENDS example-${sample_bits}bit-${libtype}-compress) + add_test(example-${sample_bits}bit-${libtype}-decompress-cmp + ${CMAKE_CROSSCOMPILING_EMULATOR} ${MD5CMP} ${MD5_PPM_EXAMPLE_DECOMPRESS} + ${testout}-example.ppm) +diff --git a/tjunittest.c b/tjunittest.c +index bbe44bb17..b033c4f17 100644 +--- a/tjunittest.c ++++ b/tjunittest.c +@@ -977,8 +977,8 @@ static int doBmpTest(const char *ext, int width, int align, int height, int pf, + THROW("Could not allocate memory"); + initBitmap(buf, width, pitch, height, pf, bottomUp); + +- SNPRINTF(filename, 80, "test_bmp%d_%s_%d_%s.%s", precision, pixFormatStr[pf], +- align, bottomUp ? "bu" : "td", ext); ++ SNPRINTF(filename, 80, "test_bmp%d_%s_%d_%s_%d.%s", precision, pixFormatStr[pf], ++ align, bottomUp ? "bu" : "td", getpid(), ext); + if (precision == 8) { + TRY_TJ(handle, tj3SaveImage8(handle, filename, (unsigned char *)buf, width, + pitch, height, pf)); +@@ -990,6 +990,10 @@ static int doBmpTest(const char *ext, int width, int align, int height, int pf, + width, pitch, height, pf)); + } + md5sum = MD5File(filename, md5buf); ++ if (!md5sum) { ++ printf("\n Could not determine MD5 sum of %s\n", filename); ++ retval = -1; goto bailout; ++ } + if (strcasecmp(md5sum, md5ref)) + THROW_MD5(filename, md5sum, md5ref); + diff --git a/libjpeg-turbo-2.1.5.1.tar.gz b/libjpeg-turbo-2.1.5.1.tar.gz deleted file mode 100644 index 0a4a0fa277688681057bc09fd56e5c92de98ffd9..0000000000000000000000000000000000000000 Binary files a/libjpeg-turbo-2.1.5.1.tar.gz and /dev/null differ diff --git a/libjpeg-turbo-3.0.0.tar.gz b/libjpeg-turbo-3.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0b61a85869fed57428804f286d0947dc83c5dfe2 Binary files /dev/null and b/libjpeg-turbo-3.0.0.tar.gz differ diff --git a/libjpeg-turbo-cmake.patch b/libjpeg-turbo-cmake.patch index 4129d6102c1baa2e211562d262a4e863b4f43b1c..973e081073a8948906999b8fd0126176278264e8 100644 --- a/libjpeg-turbo-cmake.patch +++ b/libjpeg-turbo-cmake.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 1198ece..39ebbc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1464,8 +1464,6 @@ +@@ -1687,8 +1687,6 @@ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) @@ -11,7 +11,7 @@ index 1198ece..39ebbc7 100644 if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND CMAKE_C_LINKER_SUPPORTS_PDB) install(FILES "$" -@@ -1476,15 +1474,6 @@ +@@ -1699,15 +1697,6 @@ install(TARGETS turbojpeg-static EXPORT ${CMAKE_PROJECT_NAME}Targets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) @@ -27,12 +27,12 @@ index 1198ece..39ebbc7 100644 endif() install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -@@ -1511,18 +1500,6 @@ +@@ -1734,18 +1723,6 @@ install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg -- ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt +- ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.c - ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c - ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt - ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt @@ -46,7 +46,7 @@ index 1198ece..39ebbc7 100644 if(UNIX OR MINGW) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cjpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/djpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/jpegtran.1 -@@ -1546,7 +1523,7 @@ +@@ -1769,7 +1746,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h diff --git a/libjpeg-turbo.spec b/libjpeg-turbo.spec index 9428466bb4405cdc85e23282305bc97c356015f5..e4b1c84e78b37933f50d6773ec21c9f9a0605336 100644 --- a/libjpeg-turbo.spec +++ b/libjpeg-turbo.spec @@ -1,6 +1,6 @@ %define anolis_release 1 Name: libjpeg-turbo -Version: 2.1.5.1 +Version: 3.0.0 Release: %{anolis_release}%{?dist} Summary: A MMX/SSE2/SIMD accelerated library for manipulating JPEG image files License: IJG @@ -8,6 +8,8 @@ URL: http://sourceforge.net/projects/libjpeg-turbo Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Patch0: libjpeg-turbo-cmake.patch +# Fix test running order +Patch1: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch BuildRequires: gcc BuildRequires: cmake @@ -101,7 +103,7 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir} %doc README.md README.ijg ChangeLog.md %files devel -%doc coderules.txt jconfig.txt libjpeg.txt structure.txt example.txt +%doc coderules.txt jconfig.txt libjpeg.txt structure.txt %{_includedir}/jconfig*.h %{_includedir}/jerror.h %{_includedir}/jmorecfg.h @@ -137,6 +139,9 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{_libdir}/pkgconfig/libturbojpeg.pc %changelog +* Mon Jul 31 2023 Funda Wang - 3.0.0-1 +- New version 3.0.0 + * Wed Feb 15 2023 Funda Wang - 2.1.5.1-1 - New version 2.1.5.1