commit:     8ecfa678744847c6e13bc5659e6d88c45a321ce5
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 14 18:10:07 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Nov 14 18:11:08 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ecfa678

media-libs/libraw: Allow for compiling with GCC 6

Gentoo-bug: 582852
* Patch by Peter Levine
* Add pkg_setup() check
* Disable building of static libraries
* Prune .la files unconditionally

Package-Manager: portage-2.3.2

 media-libs/libraw/files/libraw-0.17.2-gcc6.patch | 189 +++++++++++++++++++++++
 media-libs/libraw/libraw-0.17.2.ebuild           |  17 +-
 2 files changed, 203 insertions(+), 3 deletions(-)

diff --git a/media-libs/libraw/files/libraw-0.17.2-gcc6.patch 
b/media-libs/libraw/files/libraw-0.17.2-gcc6.patch
new file mode 100644
index 00000000..de5eb48
--- /dev/null
+++ b/media-libs/libraw/files/libraw-0.17.2-gcc6.patch
@@ -0,0 +1,189 @@
+Backport upstream patch to compile against GCC 6 from
+https://github.com/LibRaw/LibRaw/commit/eba7a66e23f2f62cc4c8115af8066f2df5da085a
+
+Patch by Peter Levine
+See also: https://bugs.gentoo.org/show_bug.cgi?id=582852
+
+--- a/dcraw/dcraw.c
++++ b/dcraw/dcraw.c
+@@ -5788,30 +5788,37 @@ void CLASS lin_interpolate()
+  */
+ void CLASS vng_interpolate()
+ {
+-  static const signed char *cp, terms[] = {
+-    -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01,
+-    -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01,
+-    -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03,
+-    -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06,
+-    -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04,
+-    -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01,
+-    -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40,
+-    -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11,
+-    -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11,
+-    -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22,
+-    -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44,
+-    -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10,
+-    -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04,
+-    +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40,
+-    +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20,
+-    +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08,
+-    +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20,
+-    +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44,
+-    +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60,
+-    +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80,
+-    +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40,
+-    +1,+0,+2,+1,0,0x10
+-  }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
++  struct interpolate_terms {
++    signed char y1, x1, y2, x2, weight;
++    unsigned char grads;
++  };
++  static const interpolate_terms terms[] = {
++    {-2,-2,+0,-1,0,0x01}, {-2,-2,+0,+0,1,0x01}, {-2,-1,-1,+0,0,0x01},
++    {-2,-1,+0,-1,0,0x02}, {-2,-1,+0,+0,0,0x03}, {-2,-1,+0,+1,1,0x01},
++    {-2,+0,+0,-1,0,0x06}, {-2,+0,+0,+0,1,0x02}, {-2,+0,+0,+1,0,0x03},
++    {-2,+1,-1,+0,0,0x04}, {-2,+1,+0,-1,1,0x04}, {-2,+1,+0,+0,0,0x06},
++    {-2,+1,+0,+1,0,0x02}, {-2,+2,+0,+0,1,0x04}, {-2,+2,+0,+1,0,0x04},
++    {-1,-2,-1,+0,0,0x80}, {-1,-2,+0,-1,0,0x01}, {-1,-2,+1,-1,0,0x01},
++    {-1,-2,+1,+0,1,0x01}, {-1,-1,-1,+1,0,0x88}, {-1,-1,+1,-2,0,0x40},
++    {-1,-1,+1,-1,0,0x22}, {-1,-1,+1,+0,0,0x33}, {-1,-1,+1,+1,1,0x11},
++    {-1,+0,-1,+2,0,0x08}, {-1,+0,+0,-1,0,0x44}, {-1,+0,+0,+1,0,0x11},
++    {-1,+0,+1,-2,1,0x40}, {-1,+0,+1,-1,0,0x66}, {-1,+0,+1,+0,1,0x22},
++    {-1,+0,+1,+1,0,0x33}, {-1,+0,+1,+2,1,0x10}, {-1,+1,+1,-1,1,0x44},
++    {-1,+1,+1,+0,0,0x66}, {-1,+1,+1,+1,0,0x22}, {-1,+1,+1,+2,0,0x10},
++    {-1,+2,+0,+1,0,0x04}, {-1,+2,+1,+0,1,0x04}, {-1,+2,+1,+1,0,0x04},
++    {+0,-2,+0,+0,1,0x80}, {+0,-1,+0,+1,1,0x88}, {+0,-1,+1,-2,0,0x40},
++    {+0,-1,+1,+0,0,0x11}, {+0,-1,+2,-2,0,0x40}, {+0,-1,+2,-1,0,0x20},
++    {+0,-1,+2,+0,0,0x30}, {+0,-1,+2,+1,1,0x10}, {+0,+0,+0,+2,1,0x08},
++    {+0,+0,+2,-2,1,0x40}, {+0,+0,+2,-1,0,0x60}, {+0,+0,+2,+0,1,0x20},
++    {+0,+0,+2,+1,0,0x30}, {+0,+0,+2,+2,1,0x10}, {+0,+1,+1,+0,0,0x44},
++    {+0,+1,+1,+2,0,0x10}, {+0,+1,+2,-1,1,0x40}, {+0,+1,+2,+0,0,0x60},
++    {+0,+1,+2,+1,0,0x20}, {+0,+1,+2,+2,0,0x10}, {+1,-2,+1,+0,0,0x80},
++    {+1,-1,+1,+1,0,0x88}, {+1,+0,+1,+2,0,0x08}, {+1,+0,+2,-1,0,0x40},
++    {+1,+0,+2,+1,0,0x10}
++  };
++  const interpolate_terms *cpt;
++  signed char *cp;
++  signed char chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 
};
+   ushort (*brow[5])[4], *pix;
+   int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4];
+   int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag;
+@@ -5829,11 +5836,11 @@ void CLASS vng_interpolate()
+   for (row=0; row < prow; row++)              /* Precalculate for VNG */
+     for (col=0; col < pcol; col++) {
+       code[row][col] = ip;
+-      for (cp=terms, t=0; t < 64; t++) {
+-      y1 = *cp++;  x1 = *cp++;
+-      y2 = *cp++;  x2 = *cp++;
+-      weight = *cp++;
+-      grads = *cp++;
++      for (cpt=&terms[0], t=0; t < 64, cpt = &terms[t]; t++) {
++      y1 = cpt->y1;  x1 = cpt->x1;
++      y2 = cpt->y2;  x2 = cpt->x2;
++      weight = cpt->weight;
++      grads = cpt->grads;
+       color = fcol(row+y1,col+x1);
+       if (fcol(row+y2,col+x2) != color) continue;
+       diag = (fcol(row,col+1) == color && fcol(row+1,col) == color) ? 2:1;
+@@ -16289,7 +16296,7 @@ void CLASS tiff_head (struct tiff_hdr *th, int full)
+   strncpy (th->desc, desc, 512);
+   strncpy (th->make, make, 64);
+   strncpy (th->model, model, 64);
+-  strcpy (th->soft, "dcraw v"DCRAW_VERSION);
++  strcpy (th->soft, "dcraw v" DCRAW_VERSION);
+   t = localtime (&timestamp);
+   sprintf (th->date, "%04d:%02d:%02d %02d:%02d:%02d",
+       t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+--- a/internal/dcraw_common.cpp
++++ b/internal/dcraw_common.cpp
+@@ -4618,30 +4618,37 @@ void CLASS lin_interpolate()
+  */
+ void CLASS vng_interpolate()
+ {
+-  static const signed char *cp, terms[] = {
+-    -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01,
+-    -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01,
+-    -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03,
+-    -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06,
+-    -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04,
+-    -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01,
+-    -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40,
+-    -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11,
+-    -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11,
+-    -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22,
+-    -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44,
+-    -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10,
+-    -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04,
+-    +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40,
+-    +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20,
+-    +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08,
+-    +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20,
+-    +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44,
+-    +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60,
+-    +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80,
+-    +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40,
+-    +1,+0,+2,+1,0,0x10
+-  }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
++  struct interpolate_terms {
++    signed char y1, x1, y2, x2, weight;
++    unsigned char grads;
++  };
++  static const interpolate_terms terms[] = {
++    {-2,-2,+0,-1,0,0x01}, {-2,-2,+0,+0,1,0x01}, {-2,-1,-1,+0,0,0x01},
++    {-2,-1,+0,-1,0,0x02}, {-2,-1,+0,+0,0,0x03}, {-2,-1,+0,+1,1,0x01},
++    {-2,+0,+0,-1,0,0x06}, {-2,+0,+0,+0,1,0x02}, {-2,+0,+0,+1,0,0x03},
++    {-2,+1,-1,+0,0,0x04}, {-2,+1,+0,-1,1,0x04}, {-2,+1,+0,+0,0,0x06},
++    {-2,+1,+0,+1,0,0x02}, {-2,+2,+0,+0,1,0x04}, {-2,+2,+0,+1,0,0x04},
++    {-1,-2,-1,+0,0,0x80}, {-1,-2,+0,-1,0,0x01}, {-1,-2,+1,-1,0,0x01},
++    {-1,-2,+1,+0,1,0x01}, {-1,-1,-1,+1,0,0x88}, {-1,-1,+1,-2,0,0x40},
++    {-1,-1,+1,-1,0,0x22}, {-1,-1,+1,+0,0,0x33}, {-1,-1,+1,+1,1,0x11},
++    {-1,+0,-1,+2,0,0x08}, {-1,+0,+0,-1,0,0x44}, {-1,+0,+0,+1,0,0x11},
++    {-1,+0,+1,-2,1,0x40}, {-1,+0,+1,-1,0,0x66}, {-1,+0,+1,+0,1,0x22},
++    {-1,+0,+1,+1,0,0x33}, {-1,+0,+1,+2,1,0x10}, {-1,+1,+1,-1,1,0x44},
++    {-1,+1,+1,+0,0,0x66}, {-1,+1,+1,+1,0,0x22}, {-1,+1,+1,+2,0,0x10},
++    {-1,+2,+0,+1,0,0x04}, {-1,+2,+1,+0,1,0x04}, {-1,+2,+1,+1,0,0x04},
++    {+0,-2,+0,+0,1,0x80}, {+0,-1,+0,+1,1,0x88}, {+0,-1,+1,-2,0,0x40},
++    {+0,-1,+1,+0,0,0x11}, {+0,-1,+2,-2,0,0x40}, {+0,-1,+2,-1,0,0x20},
++    {+0,-1,+2,+0,0,0x30}, {+0,-1,+2,+1,1,0x10}, {+0,+0,+0,+2,1,0x08},
++    {+0,+0,+2,-2,1,0x40}, {+0,+0,+2,-1,0,0x60}, {+0,+0,+2,+0,1,0x20},
++    {+0,+0,+2,+1,0,0x30}, {+0,+0,+2,+2,1,0x10}, {+0,+1,+1,+0,0,0x44},
++    {+0,+1,+1,+2,0,0x10}, {+0,+1,+2,-1,1,0x40}, {+0,+1,+2,+0,0,0x60},
++    {+0,+1,+2,+1,0,0x20}, {+0,+1,+2,+2,0,0x10}, {+1,-2,+1,+0,0,0x80},
++    {+1,-1,+1,+1,0,0x88}, {+1,+0,+1,+2,0,0x08}, {+1,+0,+2,-1,0,0x40},
++    {+1,+0,+2,+1,0,0x10}
++  };
++  const interpolate_terms *cpt;
++  signed char *cp;
++  signed char chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 
};
+   ushort (*brow[5])[4], *pix;
+   int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4];
+   int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag;
+@@ -4659,11 +4666,11 @@ void CLASS vng_interpolate()
+   for (row=0; row < prow; row++)              /* Precalculate for VNG */
+     for (col=0; col < pcol; col++) {
+       code[row][col] = ip;
+-      for (cp=terms, t=0; t < 64; t++) {
+-      y1 = *cp++;  x1 = *cp++;
+-      y2 = *cp++;  x2 = *cp++;
+-      weight = *cp++;
+-      grads = *cp++;
++      for (cpt=&terms[0], t=0; t < 64, cpt = &terms[t]; t++) {
++      y1 = cpt->y1;  x1 = cpt->x1;
++      y2 = cpt->y2;  x2 = cpt->x2;
++      weight = cpt->weight;
++      grads = cpt->grads;
+       color = fcol(row+y1,col+x1);
+       if (fcol(row+y2,col+x2) != color) continue;
+       diag = (fcol(row,col+1) == color && fcol(row+1,col) == color) ? 2:1;
+--- a/libraw/libraw_const.h
++++ b/libraw/libraw_const.h
+@@ -255,8 +255,7 @@ enum LibRaw_progress
+ 
+     LIBRAW_PROGRESS_THUMB_LOAD          = 1<<28,
+     LIBRAW_PROGRESS_TRESERVED1          = 1<<29,
+-    LIBRAW_PROGRESS_TRESERVED2          = 1<<30,
+-    LIBRAW_PROGRESS_TRESERVED3          = 1<<31
++    LIBRAW_PROGRESS_TRESERVED2          = 1<<30
+ };
+ #define LIBRAW_PROGRESS_THUMB_MASK 0x0fffffff
+ 

diff --git a/media-libs/libraw/libraw-0.17.2.ebuild 
b/media-libs/libraw/libraw-0.17.2.ebuild
index ac99526..0392425 100644
--- a/media-libs/libraw/libraw-0.17.2.ebuild
+++ b/media-libs/libraw/libraw-0.17.2.ebuild
@@ -35,15 +35,19 @@ DEPEND="${RDEPEND}
 S=${WORKDIR}/${MY_P}
 
 DOCS=( Changelog.txt README )
+PATCHES=( "${FILESDIR}"/${PN}-0.17.2-gcc6.patch )
 
 pkg_pretend() {
-       if use openmp ; then
-               tc-has-openmp || die "Please switch to an openmp compatible 
compiler"
-       fi
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
 }
 
 multilib_src_configure() {
        local myeconfargs=(
+               --disable-static
                $(use_enable demosaic demosaic-pack-gpl2)
                $(use_enable demosaic demosaic-pack-gpl3)
                $(use_enable examples)
@@ -55,3 +59,10 @@ multilib_src_configure() {
        ECONF_SOURCE="${S}" \
        econf "${myeconfargs[@]}"
 }
+
+multilib_src_install_all() {
+       einstalldocs
+
+       # package installs .pc files
+       find "${D}" -name '*.la' -delete || die
+}

Reply via email to