commit:     209273b20054ce83a2aa71c62d256dea7e564cc6
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 21 09:02:05 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Aug 21 09:03:08 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=209273b2

sci-mathematics/octave: version bump

Gentoo-bug: 590676, 590792
* EAPI=6
* Make patches -p1 compliant
* Use pkg-config for finding curses flags

Package-Manager: portage-2.3.0

 sci-mathematics/octave/Manifest                    |   1 +
 .../octave/files/octave-3.4.3-texi.patch           |   4 +-
 .../octave/files/octave-3.8.1-pkgbuilddir.patch    |   4 +-
 .../octave/files/octave-4.0.3-imagemagick.patch    | 139 ++++++++++++++++
 .../files/octave-4.0.3-ncurses-pkgconfig.patch     |  42 +++++
 sci-mathematics/octave/octave-4.0.3.ebuild         | 175 +++++++++++++++++++++
 6 files changed, 361 insertions(+), 4 deletions(-)

diff --git a/sci-mathematics/octave/Manifest b/sci-mathematics/octave/Manifest
index 30a329a..3aa2d42 100644
--- a/sci-mathematics/octave/Manifest
+++ b/sci-mathematics/octave/Manifest
@@ -3,3 +3,4 @@ DIST octave-3.8.2.tar.bz2 17834980 SHA256 
83bbd701aab04e7e57d0d5b8373dd54719bebb
 DIST octave-4.0.0.tar.xz 15759196 SHA256 
cf6be2fac6796fda68971e249c96d026ce4a1b0ed074ce49a5791365a958c474 SHA512 
54559686d017b7fe731a89a24e74d08781365028d2799a86f25ebf4c433013eab03e5b4381a992b79e40bce1827a6eee2aefd0798b739128dd8dd7b41d936b89
 WHIRLPOOL 
0e0154dac5ac76268d99533186a88f54bc811817cdf2222c3c0bc22ff456fd23829f7015eebcb9d441665c1d2782ed57c06ab00880f64d63b22ef4aad43f132a
 DIST octave-4.0.1.tar.xz 15637340 SHA256 
d58f4861f93dbf4c98f3574d6066cfa25001349bd58ce063cf443efba4e1c287 SHA512 
7fa22b50c9116c917b2a2bd63d81a8106eba95842a5de736fbf89ee6ea3dbd5542c183ab6229b62f548ad07abbf67514152a8e553e8fbdf86036d44ced669798
 WHIRLPOOL 
7bcc16a1e01543dc0baab92993a305c6fea7fc9eb9d806004a1b3e11479c34d8a40000de60e2291a27c846d54abc35883a16583bc324681d7897624fa40d98bb
 DIST octave-4.0.2.tar.xz 15668728 SHA256 
98c11ecead8ea759eb1d010ad6319a63a1c6199d3a7e2abbafe453c753090403 SHA512 
e79d43528d47a2b3f0fbc9e43eefd5fb8e199dd3818ffd745c1424c7cfca9397186dab129b6f61ee52f5c5203d613e5290d8dc5e32b318cfdd3d38f7facf63cd
 WHIRLPOOL 
bf870ef3b6affb4a157951d99132078f528b52be403f7d01bfd98fd657d4089ebbf5fb78f340ce18e59ae27d5eddb9edbbf76583810bcf2dbd5c9ce8ea3434cd
+DIST octave-4.0.3.tar.xz 15697064 SHA256 
dc2bec8c68fa5733a5847563634b1729356a84f3a5071008ecdb793293f0aa85 SHA512 
bad009235b04be09c051dd27ebef7df2542adec0a0b57c070662deebe33a0cdceb7d6816653f5afc3fc0cc1287ba1ca1a5c50858169004210224039374c9c55d
 WHIRLPOOL 
69546306417c85b65ae371035be906d5968b1af358ba16ff3c979a925766be92b933d386b6b594c70befaf8ddd95cf27fcd94934c03713688d05141e86a92dd0

diff --git a/sci-mathematics/octave/files/octave-3.4.3-texi.patch 
b/sci-mathematics/octave/files/octave-3.4.3-texi.patch
index 661ddae..2ce38b2 100644
--- a/sci-mathematics/octave/files/octave-3.4.3-texi.patch
+++ b/sci-mathematics/octave/files/octave-3.4.3-texi.patch
@@ -1,5 +1,5 @@
---- doc/interpreter/Makefile.am.orig   2012-01-31 17:47:52.000000000 +0000
-+++ doc/interpreter/Makefile.am        2012-01-31 17:49:37.000000000 +0000
+--- a/doc/interpreter/Makefile.am
++++ b/doc/interpreter/Makefile.am
 @@ -202,6 +202,8 @@
        $(AWK) -f $(srcdir)/mkcontrib.awk $(srcdir)/contributors.in > $@-t
        mv $@-t $@

diff --git a/sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch 
b/sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch
index 98fe3d5..5cb2784 100644
--- a/sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch
+++ b/sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch
@@ -1,5 +1,5 @@
---- scripts/pkg/private/install.m.orig 2014-04-15 08:45:55.487258887 -0700
-+++ scripts/pkg/private/install.m      2014-04-15 12:12:40.985606248 -0700
+--- a/scripts/pkg/private/install.m
++++ b/scripts/pkg/private/install.m
 @@ -62,7 +62,14 @@
      for i = 1:length (files)
        tgz = files{i};

diff --git a/sci-mathematics/octave/files/octave-4.0.3-imagemagick.patch 
b/sci-mathematics/octave/files/octave-4.0.3-imagemagick.patch
new file mode 100644
index 0000000..5ad31c2
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.3-imagemagick.patch
@@ -0,0 +1,139 @@
+--- octave-4.0.3/libinterp/corefcn/__magick_read__.cc
++++ octave-4.0.3/libinterp/corefcn/__magick_read__.cc
+@@ -38,8 +38,15 @@
+ #include "gripes.h"
+ 
+ #ifdef HAVE_MAGICK
+-
++#define MAGICKCORE_EXCLUDE_DEPRECATED 1
+ #include <Magick++.h>
++#if !defined(QuantumRange) && defined(MaxRGB)
++#define QuantumRange MaxRGB
++#endif
++#if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(QuantumDepth)
++#define MAGICKCORE_QUANTUM_DEPTH QuantumDepth
++#endif
++
+ #include <clocale>
+ 
+ // In theory, it should be enough to check the class:
+@@ -121,12 +128,18 @@
+ get_depth (Magick::Image& img)
+ {
+   octave_idx_type depth = img.depth ();
++#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686)
++#define Magick MagickCore
++#endif
+   if (depth == 8
+       && img.channelDepth (Magick::RedChannel)     == 1
+       && img.channelDepth (Magick::CyanChannel)    == 1
+       && img.channelDepth (Magick::OpacityChannel) == 1
+       && img.channelDepth (Magick::GrayChannel)    == 1)
+     depth = 1;
++#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686)
++#undef Magick
++#endif
+ 
+   return depth;
+ }
+@@ -350,7 +363,10 @@
+   if (imvec[def_elem].depth () == 32)
+     divisor = std::numeric_limits<uint32_t>::max ();
+   else
+-    divisor = MaxRGB / ((uint64_t (1) << imvec[def_elem].depth ()) - 1);
++  {
++    using namespace Magick;
++    divisor = QuantumRange / ((uint64_t (1) << imvec[def_elem].depth ()) - 1);
++  }
+ 
+   // FIXME: this workaround should probably be fixed in GM by creating a
+   //        new ImageType BilevelMatteType
+@@ -484,7 +500,8 @@
+                 for (octave_idx_type row = 0; row < nRows; row++)
+                   {
+                     img_fvec[idx] = pix->red / divisor;
+-                    a_fvec[idx]   = (MaxRGB - pix->opacity) / divisor;
++                    using namespace Magick;
++                    a_fvec[idx]   = (QuantumRange - pix->opacity) / divisor;
+                     pix += row_shift;
+                     idx++;
+                   }
+@@ -563,7 +580,8 @@
+                     rbuf[idx]     = pix->red     / divisor;
+                     gbuf[idx]     = pix->green   / divisor;
+                     bbuf[idx]     = pix->blue    / divisor;
+-                    a_fvec[a_idx++] = (MaxRGB - pix->opacity) / divisor;
++                    using namespace Magick;
++                    a_fvec[a_idx++] = (QuantumRange - pix->opacity) / divisor;
+                     pix += row_shift;
+                     idx++;
+                   }
+@@ -650,7 +668,8 @@
+                     mbuf[idx]     = pix->green   / divisor;
+                     ybuf[idx]     = pix->blue    / divisor;
+                     kbuf[idx]     = pix->opacity / divisor;
+-                    a_fvec[a_idx++] = (MaxRGB - *apix) / divisor;
++                    using namespace Magick;
++                    a_fvec[a_idx++] = (QuantumRange - *apix) / divisor;
+                     pix += row_shift;
+                     idx++;
+                   }
+@@ -709,10 +728,11 @@
+       // Restore locale from before GraphicsMagick initialisation
+       setlocale (LC_ALL, locale.c_str ());
+ 
+-      if (QuantumDepth < 32)
++      using namespace Magick;
++      if (MAGICKCORE_QUANTUM_DEPTH < 32)
+         warning_with_id ("Octave:GraphicsMagic-Quantum-Depth",
+                          "your version of %s limits images to %d bits per 
pixel",
+-                         MagickPackageName, QuantumDepth);
++                         MagickPackageName, MAGICKCORE_QUANTUM_DEPTH);
+ 
+       initialized = true;
+     }
+@@ -1087,8 +1107,9 @@
+   // From GM documentation:
+   //  Color arguments are must be scaled to fit the Quantum size according to
+   //  the range of MaxRGB
++  using namespace Magick;
+   const double divisor = static_cast<double>((uint64_t (1) << bitdepth) - 1)
+-                         / MaxRGB;
++                         / QuantumRange;
+ 
+   const P *img_fvec = img.fortran_vec ();
+   const P *a_fvec   = alpha.fortran_vec ();
+@@ -1140,8 +1161,9 @@
+                 for (octave_idx_type row = 0; row < nRows; row++)
+                   {
+                     double grey = xround (double (*img_fvec) / divisor);
++                    using namespace Magick;
+                     Magick::Color c (grey, grey, grey,
+-                                     MaxRGB - xround (double (*a_fvec) / 
divisor));
++                                     QuantumRange - (double (*a_fvec) / 
divisor));
+                     pix[GM_idx] = c;
+                     img_fvec++;
+                     a_fvec++;
+@@ -1209,10 +1231,11 @@
+               {
+                 for (octave_idx_type row = 0; row < nRows; row++)
+                   {
++                    using namespace Magick;
+                     Magick::Color c (xround (double (*img_fvec)          / 
divisor),
+                                      xround (double (img_fvec[G_offset]) / 
divisor),
+                                      xround (double (img_fvec[B_offset]) / 
divisor),
+-                                     MaxRGB - xround (double (*a_fvec) / 
divisor));
++                                     QuantumRange - (double (*a_fvec) / 
divisor));
+                     pix[GM_idx] = c;
+                     img_fvec++;
+                     a_fvec++;
+@@ -1290,7 +1313,8 @@
+                                      xround (double (img_fvec[Y_offset]) / 
divisor),
+                                      xround (double (img_fvec[K_offset]) / 
divisor));
+                     pix[GM_idx] = c;
+-                    ind[GM_idx] = MaxRGB - xround (double (*a_fvec) / 
divisor);
++                    using namespace Magick;
++                    ind[GM_idx] = QuantumRange - (double (*a_fvec) / divisor);
+                     img_fvec++;
+                     a_fvec++;
+                     GM_idx += nCols;

diff --git a/sci-mathematics/octave/files/octave-4.0.3-ncurses-pkgconfig.patch 
b/sci-mathematics/octave/files/octave-4.0.3-ncurses-pkgconfig.patch
new file mode 100644
index 0000000..2034274
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.3-ncurses-pkgconfig.patch
@@ -0,0 +1,42 @@
+Instead of trying to find obscure termcap libraries, use pkg-config
+to detect the proper flags required for curses support.
+See also:
+https://bugs.gentoo.org/show_bug.cgi?id=590676
+
+--- a/m4/acinclude.m4
++++ b/m4/acinclude.m4
+@@ -1085,32 +1085,8 @@
+ dnl Find a suitable termlib to use.
+ dnl
+ AC_DEFUN([OCTAVE_CHECK_LIB_TERMLIB], [
+-  TERM_LIBS=
+-  ac_octave_save_LIBS="$LIBS"
+-  AC_SEARCH_LIBS([tputs],
+-                 [ncurses curses termcap terminfo termlib],
+-                 [], [])
+-  LIBS="$ac_octave_save_LIBS"
+-  case "$ac_cv_search_tputs" in
+-    -l*)
+-      TERM_LIBS="$ac_cv_search_tputs"
+-    ;;
+-    no)
+-      warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, 
-lcurses, or -ltermlib!"
+-      AC_MSG_WARN([$warn_termlibs])
+-    ;;
+-  esac
+-
+-dnl  Old code (9/9/2012).  Delete when new code is definitely proven.
+-dnl
+-dnl  for _termlib in ncurses curses termcap terminfo termlib; do
+-dnl    AC_CHECK_LIB([${_termlib}], [tputs], [
+-dnl      TERM_LIBS="-l${termlib}"
+-dnl      octave_cv_lib_found_termlib=yes
+-dnl      break])
+-dnl  done
+-
+-  AC_SUBST(TERM_LIBS)
++  PKG_CHECK_MODULES([TERM], [ncurses])
++  CPPFLAGS="${CPPFLAGS} ${TERM_CFLAGS}"
+ ])
+ dnl
+ dnl Check for the Qhull version.

diff --git a/sci-mathematics/octave/octave-4.0.3.ebuild 
b/sci-mathematics/octave/octave-4.0.3.ebuild
new file mode 100644
index 0000000..ef685a2
--- /dev/null
+++ b/sci-mathematics/octave/octave-4.0.3.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools flag-o-matic fortran-2 java-pkg-opt-2 pax-utils 
toolchain-funcs
+
+DESCRIPTION="High-level interactive language for numerical computations"
+LICENSE="GPL-3"
+HOMEPAGE="http://www.octave.org/";
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+SLOT="0/${PV}"
+IUSE="curl doc fftw +glpk gnuplot graphicsmagick gui hdf5 +imagemagick java 
jit opengl
+       postscript +qhull +qrupdate readline +sparse static-libs X zlib"
+REQUIRED_USE="?? ( graphicsmagick imagemagick )"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+RDEPEND="
+       app-text/ghostscript-gpl
+       dev-libs/libpcre:3=
+       sys-libs/ncurses:0=
+       virtual/blas
+       virtual/lapack
+       curl? ( net-misc/curl:0= )
+       fftw? ( sci-libs/fftw:3.0= )
+       glpk? ( sci-mathematics/glpk:0= )
+       gnuplot? ( sci-visualization/gnuplot )
+       gui? ( x11-libs/qscintilla:0= )
+       hdf5? ( sci-libs/hdf5:0= )
+       graphicsmagick? ( media-gfx/graphicsmagick:=[cxx] )
+       imagemagick? ( media-gfx/imagemagick:=[cxx] )
+       java? ( >=virtual/jre-1.6.0:* )
+       jit? (
+               >=sys-devel/autoconf-archive-2015.02.04
+               >=sys-devel/llvm-3.3:0= <sys-devel/llvm-3.6:0= )
+       opengl? (
+               media-libs/freetype:2=
+               media-libs/fontconfig:1.0=
+               >=x11-libs/fltk-1.3:1=[opengl,xft]
+               x11-libs/gl2ps:0=
+               virtual/glu )
+       postscript? (
+               app-text/epstool
+               media-gfx/pstoedit
+               media-gfx/transfig )
+       qhull? ( media-libs/qhull:0= )
+       qrupdate? ( sci-libs/qrupdate:0= )
+       readline? ( sys-libs/readline:0= )
+       sparse? (
+               sci-libs/arpack:0=
+               sci-libs/camd:0=
+               sci-libs/ccolamd:0=
+               sci-libs/cholmod:0=
+               sci-libs/colamd:0=
+               sci-libs/cxsparse:0=
+               sci-libs/umfpack:0= )
+       X? ( x11-libs/libX11:0= )
+       zlib? ( sys-libs/zlib:0= )"
+
+DEPEND="${RDEPEND}
+       qrupdate? ( app-misc/pax-utils )
+       sparse? ( app-misc/pax-utils )
+       java? ( >=virtual/jdk-1.6.0 )
+       doc? (
+               virtual/latex-base
+               dev-texlive/texlive-genericrecommended
+               dev-texlive/texlive-metapost )
+       sys-apps/texinfo
+       dev-util/gperf
+       virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.4.3-texi.patch
+       
"${FILESDIR}"/${PN}-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch
+       "${FILESDIR}"/${PN}-4.0.0-imagemagick-configure.patch
+       "${FILESDIR}"/${PN}-4.0.3-imagemagick.patch
+       "${FILESDIR}"/${PN}-3.8.1-pkgbuilddir.patch
+       "${FILESDIR}"/${PN}-4.0.3-ncurses-pkgconfig.patch
+)
+
+src_prepare() {
+       # nasty prefix hacks for fltk:1 and qt4 linking
+       if use prefix; then
+               use opengl && append-ldflags 
-Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/fltk-1"
+               use gui && append-ldflags 
-Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/qt4"
+       fi
+
+       # Octave fails to build with LLVM 3.5 
https://savannah.gnu.org/bugs/?41061
+       use jit && has_version ">=sys-devel/llvm-3.5" && \
+               PATCHES+=(
+                       "${FILESDIR}"/${PN}-4.0.0-llvm-3.5.patch
+               )
+
+       # Fix bug 501756
+       sed -i \
+               -e 's@A-Za-z0-9@[:alnum:]@g' \
+               -e 's@A-Za-z@[:alpha:]@g' \
+               libinterp/mkbuiltins || die
+
+       # occasional fail on install, force regeneration (bug #401189)
+       rm doc/interpreter/contributors.texi || die
+
+       default
+       eautoreconf
+}
+
+src_configure() {
+       # unfortunate dependency on mpi from hdf5 (bug #302621)
+       use hdf5 && has_version sci-libs/hdf5[mpi] && \
+               export CXX=mpicxx CC=mpicc FC=mpif77 F77=mpif77
+
+       local myconf
+       if use graphicsmagick; then
+               myconf="--with-magick=GraphicsMagick"
+       elif use imagemagick; then
+               myconf="--with-magick=ImageMagick"
+       else
+               myconf="--without-magick"
+       fi
+
+       econf ${myconf} \
+               --localstatedir="${EPREFIX}/var/state/octave" \
+               --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \
+               --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)" \
+               --disable-64 \
+               --enable-shared \
+               $(use_enable static-libs static) \
+               $(use_enable doc docs) \
+               $(use_enable java) \
+               $(use_enable gui) \
+               $(use_enable jit) \
+               $(use_enable readline) \
+               $(use_with curl) \
+               $(use_with fftw fftw3) \
+               $(use_with fftw fftw3f) \
+               $(use_enable fftw fftw-threads) \
+               $(use_with glpk) \
+               $(use_with hdf5) \
+               $(use_with opengl) \
+               $(use_with qhull) \
+               $(use_with qrupdate) \
+               $(use_with sparse arpack) \
+               $(use_with sparse umfpack) \
+               $(use_with sparse colamd) \
+               $(use_with sparse ccolamd) \
+               $(use_with sparse cholmod) \
+               $(use_with sparse cxsparse) \
+               $(use_with X x) \
+               $(use_with zlib z)
+}
+
+src_compile() {
+       default
+       if use java || use jit ; then
+               pax-mark m "${S}/src/.libs/octave-cli"
+       fi
+}
+
+src_install() {
+       default
+       if use doc; then
+               dodoc $(find doc -name \*.pdf)
+       else
+               # bug 566134, macros.texi is installed by make install if use 
doc
+               insinto /usr/share/${PN}/${PV}/etc
+               doins doc/interpreter/macros.texi
+       fi
+       [[ -e test/fntests.log ]] && dodoc test/fntests.log
+       use java && \
+               java-pkg_regjar "${ED}/usr/share/${PN}/${PV}/m/java/octave.jar"
+       echo "LDPATH=${EROOT}usr/$(get_libdir)/${PN}/${PV}" > 99octave
+       doenvd 99octave
+}

Reply via email to