From 059a6a28ac26ef3bcb28e46b9694ee0c2f75dc043729141bd2eb6a915245cc87 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 20 Aug 2020 15:51:11 +0000 Subject: [PATCH] Accepting request 826911 from home:dirkmueller:branches:graphics - update to 2.12.6: * Use size_t for malloc_sizes - remove gcc9-Update-const-var-openmp-const-var-handling.patch (upstream) OBS-URL: https://build.opensuse.org/request/show/826911 OBS-URL: https://build.opensuse.org/package/show/graphics/libimagequant?expand=0&rev=9 --- ...-const-var-openmp-const-var-handling.patch | 72 ------------------- libimagequant-2.12.2.tar.gz | 3 - libimagequant-2.12.6.tar.gz | 3 + libimagequant.changes | 7 ++ libimagequant.spec | 8 +-- 5 files changed, 13 insertions(+), 80 deletions(-) delete mode 100644 gcc9-Update-const-var-openmp-const-var-handling.patch delete mode 100644 libimagequant-2.12.2.tar.gz create mode 100644 libimagequant-2.12.6.tar.gz diff --git a/gcc9-Update-const-var-openmp-const-var-handling.patch b/gcc9-Update-const-var-openmp-const-var-handling.patch deleted file mode 100644 index 88e3dbc..0000000 --- a/gcc9-Update-const-var-openmp-const-var-handling.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 62c4bf1dc8bda1e53fbb65e596a141c5a15a4f00 Mon Sep 17 00:00:00 2001 -From: Nicholas Vinson -Date: Sat, 4 May 2019 14:03:48 -0700 -Subject: [PATCH] Update const-var openmp const-var handling - -OpenMP 4.0 dropped the data-sharing rule that predetermined const-vars -as "shared". GCC implemented this rule change with GCC-9. Because of -the rule change, libimagequant fails to build with gcc-9.1.0. This -patch updates the code so that it is conformant with OpenMP 4.0 rules. ---- - kmeans.c | 5 +++++ - libimagequant.c | 5 +++++ - mediancut.c | 5 +++++ - 3 files changed, 15 insertions(+) - -diff --git a/kmeans.c b/kmeans.c -index 7ee273d..c8630ae 100644 ---- a/kmeans.c -+++ b/kmeans.c -@@ -73,8 +73,13 @@ LIQ_PRIVATE double kmeans_do_iteration(histogram *hist, colormap *const map, kme - const int hist_size = hist->size; - - double total_diff=0; -+#if __GNUC__ >= 9 -+ #pragma omp parallel for if (hist_size > 2000) \ -+ schedule(static) default(none) shared(achv,average_color,callback,hist_size,map,n) reduction(+:total_diff) -+#else - #pragma omp parallel for if (hist_size > 2000) \ - schedule(static) default(none) shared(average_color,callback) reduction(+:total_diff) -+#endif - for(int j=0; j < hist_size; j++) { - float diff; - unsigned int match = nearest_search(n, &achv[j].acolor, achv[j].tmp.likely_colormap_index, &diff); -diff --git a/libimagequant.c b/libimagequant.c -index 3506564..114e5f1 100644 ---- a/libimagequant.c -+++ b/libimagequant.c -@@ -1276,8 +1276,13 @@ LIQ_NONNULL static float remap_to_palette(liq_image *const input_image, unsigned - LIQ_ARRAY(kmeans_state, average_color, (KMEANS_CACHE_LINE_GAP+map->colors) * max_threads); - kmeans_init(map, max_threads, average_color); - -+#if __GNUC__ >= 9 -+ #pragma omp parallel for if (rows*cols > 3000) \ -+ schedule(static) default(none) shared(acolormap,average_color,cols,input_image,map,n,output_pixels,rows,transparent_index) reduction(+:remapping_error) -+#else - #pragma omp parallel for if (rows*cols > 3000) \ - schedule(static) default(none) shared(acolormap) shared(average_color) reduction(+:remapping_error) -+#endif - for(int row = 0; row < rows; ++row) { - const f_pixel *const row_pixels = liq_image_get_row_f(input_image, row); - const f_pixel *const bg_pixels = input_image->background && acolormap[transparent_index].acolor.a < 1.f/256.f ? liq_image_get_row_f(input_image->background, row) : NULL; -diff --git a/mediancut.c b/mediancut.c -index 447a4af..4421cb4 100644 ---- a/mediancut.c -+++ b/mediancut.c -@@ -195,8 +195,13 @@ static double prepare_sort(struct box *b, hist_item achv[]) - - const unsigned int ind1 = b->ind; - const unsigned int colors = b->colors; -+#if __GNUC__ >= 9 -+ #pragma omp parallel for if (colors > 25000) \ -+ schedule(static) default(none) shared(achv, channels, colors, ind1) -+#else - #pragma omp parallel for if (colors > 25000) \ - schedule(static) default(none) shared(achv, channels) -+#endif - for(unsigned int i=0; i < colors; i++) { - const float *chans = (const float *)&achv[ind1 + i].acolor; - // Only the first channel really matters. When trying median cut many times --- -2.21.0 - diff --git a/libimagequant-2.12.2.tar.gz b/libimagequant-2.12.2.tar.gz deleted file mode 100644 index 71ac271..0000000 --- a/libimagequant-2.12.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:23ccecb4898ec17474914cfd2fbc4684425f7fd249117f2f1e3f3ba0bf8159e6 -size 75611 diff --git a/libimagequant-2.12.6.tar.gz b/libimagequant-2.12.6.tar.gz new file mode 100644 index 0000000..92460b6 --- /dev/null +++ b/libimagequant-2.12.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b34964512c0dbe550c5f1b394c246c42a988cd73b71a76c5838aa2b4a96e43a0 +size 96355 diff --git a/libimagequant.changes b/libimagequant.changes index f33cf78..d7f2ed4 100644 --- a/libimagequant.changes +++ b/libimagequant.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Aug 15 23:47:10 UTC 2020 - Dirk Mueller + +- update to 2.12.6: + * Use size_t for malloc_sizes +- remove gcc9-Update-const-var-openmp-const-var-handling.patch (upstream) + ------------------------------------------------------------------- Tue May 14 08:55:03 UTC 2019 - Martin Liška diff --git a/libimagequant.spec b/libimagequant.spec index 3f749cf..88a8d85 100644 --- a/libimagequant.spec +++ b/libimagequant.spec @@ -1,7 +1,7 @@ # # spec file for package libimagequant # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,13 @@ %define sover 0 %define libname %{name}%{sover} Name: libimagequant -Version: 2.12.2 +Version: 2.12.6 Release: 0 Summary: Palette quantization library License: GPL-3.0-or-later Group: Development/Languages/C and C++ -Url: https://pngquant.org/lib/ +URL: https://pngquant.org/lib/ Source: https://github.com/ImageOptim/libimagequant/archive/%{version}/%{name}-%{version}.tar.gz -Patch0: gcc9-Update-const-var-openmp-const-var-handling.patch BuildRequires: pkgconfig BuildRequires: pkgconfig(lcms2) @@ -53,7 +52,6 @@ C library for conversion of RGBA images to 8-bit indexed-color %prep %setup -q -%patch0 -p1 %build # This is not an autoconf configure, but the script simply ignores parameters it does not know