media-libs/vigra: Fix compilation error and add -9999
authorCraig Andrews <candrews@gentoo.org>
Fri, 9 Nov 2018 21:27:39 +0000 (16:27 -0500)
committerCraig Andrews <candrews@gentoo.org>
Mon, 19 Nov 2018 20:13:07 +0000 (15:13 -0500)
Closes: https://bugs.gentoo.org/664720
Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: Craig Andrews <candrews@gentoo.org>
media-libs/vigra/files/vigra-1.11.1-fix-incorrect-template-parameter-type.patch [new file with mode: 0644]
media-libs/vigra/vigra-1.11.1-r1.ebuild [new file with mode: 0644]
media-libs/vigra/vigra-9999.ebuild [new file with mode: 0644]

diff --git a/media-libs/vigra/files/vigra-1.11.1-fix-incorrect-template-parameter-type.patch b/media-libs/vigra/files/vigra-1.11.1-fix-incorrect-template-parameter-type.patch
new file mode 100644 (file)
index 0000000..88ed61e
--- /dev/null
@@ -0,0 +1,139 @@
+From 81958d302494e137f98a8b1d7869841532f90388 Mon Sep 17 00:00:00 2001
+From: JaimeIvanCervantes <jimmycc80@hotmail.com>
+Date: Fri, 16 Jun 2017 13:21:45 -0700
+Subject: [PATCH] multi_convolution: Fix for incorrect template parameter type
+ when using unsigned int N for TinyVector SIZE. (Fixes #414)
+
+---
+ include/vigra/multi_convolution.hxx | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/include/vigra/multi_convolution.hxx b/include/vigra/multi_convolution.hxx
+index 1b5efa740..ec89bcf58 100644
+--- a/include/vigra/multi_convolution.hxx
++++ b/include/vigra/multi_convolution.hxx
+@@ -1426,7 +1426,7 @@ gaussianSmoothMultiArray(MultiArrayView<N, T1, S1> const & source,
+                   class T2, class S2>
+         void
+         gaussianGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                                   MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                                   MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                                    double sigma,
+                                    ConvolutionOptions<N> opt = ConvolutionOptions<N>());
+@@ -1435,7 +1435,7 @@ gaussianSmoothMultiArray(MultiArrayView<N, T1, S1> const & source,
+                                   class T2, class S2>
+         void
+         gaussianGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                                   MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                                   MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                                    ConvolutionOptions<N> opt);
+         // likewise, but execute algorithm in parallel
+@@ -1443,7 +1443,7 @@ gaussianSmoothMultiArray(MultiArrayView<N, T1, S1> const & source,
+                                   class T2, class S2>
+         void
+         gaussianGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                                   MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                                   MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                                    BlockwiseConvolutionOptions<N> opt);
+     }
+     \endcode
+@@ -1590,7 +1590,7 @@ template <unsigned int N, class T1, class S1,
+                           class T2, class S2>
+ inline void
+ gaussianGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                           MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                           MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                            ConvolutionOptions<N> opt )
+ {
+     if(opt.to_point != typename MultiArrayShape<N>::type())
+@@ -1614,7 +1614,7 @@ template <unsigned int N, class T1, class S1,
+           class T2, class S2>
+ inline void
+ gaussianGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                           MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                           MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                            double sigma,
+                            ConvolutionOptions<N> opt = ConvolutionOptions<N>())
+ {
+@@ -1653,7 +1653,7 @@ gaussianGradientMagnitudeImpl(MultiArrayView<N+1, T1, S1> const & src,
+     dest.init(0.0);
+     typedef typename NumericTraits<T1>::RealPromote TmpType;
+-    MultiArray<N, TinyVector<TmpType, N> > grad(dest.shape());
++    MultiArray<N, TinyVector<TmpType, int(N)> > grad(dest.shape());
+     using namespace multi_math;
+@@ -1771,7 +1771,7 @@ gaussianGradientMagnitude(MultiArrayView<N+1, Multiband<T1>, S1> const & src,
+                                   class T2, class S2>
+         void
+         symmetricGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                                    MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                                    MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                                     ConvolutionOptions<N> opt = ConvolutionOptions<N>());
+         // execute algorithm in parallel
+@@ -1779,7 +1779,7 @@ gaussianGradientMagnitude(MultiArrayView<N+1, Multiband<T1>, S1> const & src,
+                                   class T2, class S2>
+         void
+         symmetricGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                                    MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                                    MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                                     BlockwiseConvolutionOptions<N> opt);
+     }
+     \endcode
+@@ -1895,7 +1895,7 @@ template <unsigned int N, class T1, class S1,
+                           class T2, class S2>
+ inline void
+ symmetricGradientMultiArray(MultiArrayView<N, T1, S1> const & source,
+-                            MultiArrayView<N, TinyVector<T2, N>, S2> dest,
++                            MultiArrayView<N, TinyVector<T2, int(N)>, S2> dest,
+                             ConvolutionOptions<N> opt = ConvolutionOptions<N>())
+ {
+     if(opt.to_point != typename MultiArrayShape<N>::type())
+@@ -2214,14 +2214,14 @@ laplacianOfGaussianMultiArray(MultiArrayView<N, T1, S1> const & source,
+         template <unsigned int N, class T1, class S1,
+                                   class T2, class S2>
+         void
+-        gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N>, S1> const & vectorField,
++        gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, int(N)>, S1> const & vectorField,
+                                      MultiArrayView<N, T2, S2> divergence,
+                                      ConvolutionOptions<N> const & opt);
+         template <unsigned int N, class T1, class S1,
+                                   class T2, class S2>
+         void
+-        gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N>, S1> const & vectorField,
++        gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, int(N)>, S1> const & vectorField,
+                                      MultiArrayView<N, T2, S2> divergence,
+                                      double sigma,
+                                      ConvolutionOptions<N> opt = ConvolutionOptions<N>());
+@@ -2231,7 +2231,7 @@ laplacianOfGaussianMultiArray(MultiArrayView<N, T1, S1> const & source,
+         template <unsigned int N, class T1, class S1,
+                                   class T2, class S2>
+         void
+-        gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N>, S1> const & vectorField,
++        gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, int(N)>, S1> const & vectorField,
+                                      MultiArrayView<N, T2, S2> divergence,
+                                      BlockwiseConvolutionOptions<N> const & opt);
+     }
+@@ -2324,7 +2324,7 @@ gaussianDivergenceMultiArray(Iterator vectorField, Iterator vectorFieldEnd,
+ template <unsigned int N, class T1, class S1,
+                           class T2, class S2>
+ inline void
+-gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N>, S1> const & vectorField,
++gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, int(N)>, S1> const & vectorField,
+                              MultiArrayView<N, T2, S2> divergence,
+                              ConvolutionOptions<N> const & opt)
+ {
+@@ -2338,7 +2338,7 @@ gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N>, S1> const & ve
+ template <unsigned int N, class T1, class S1,
+                           class T2, class S2>
+ inline void
+-gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, N>, S1> const & vectorField,
++gaussianDivergenceMultiArray(MultiArrayView<N, TinyVector<T1, int(N)>, S1> const & vectorField,
+                              MultiArrayView<N, T2, S2> divergence,
+                              double sigma,
+                              ConvolutionOptions<N> opt = ConvolutionOptions<N>())
diff --git a/media-libs/vigra/vigra-1.11.1-r1.ebuild b/media-libs/vigra/vigra-1.11.1-r1.ebuild
new file mode 100644 (file)
index 0000000..c5e8c81
--- /dev/null
@@ -0,0 +1,149 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_P="${P}-src"
+MY_V="${PV//\./-}"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads,xml"
+
+inherit cmake-utils python-r1
+
+DESCRIPTION="C++ computer vision library emphasizing customizable algorithms and structures"
+HOMEPAGE="https://ukoethe.github.io/vigra/"
+
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/ukoethe/${PN}.git"
+       inherit git-r3
+else
+       SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${MY_V}/${MY_P}.tar.gz"
+       KEYWORDS="~amd64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc +fftw +hdf5 +jpeg mpi openexr +png +python test +tiff valgrind"
+
+# runtime dependency on python:2.7 is required by the vigra-config script
+RDEPEND="
+       dev-lang/python:2.7
+       >=dev-libs/boost-1.52.0-r6:=[python?,${PYTHON_USEDEP}]
+       fftw? ( sci-libs/fftw:3.0 )
+       hdf5? ( >=sci-libs/hdf5-1.8.0:=[mpi?] )
+       jpeg? ( virtual/jpeg:0 )
+       openexr? ( media-libs/openexr:= )
+       png? ( media-libs/libpng:0= )
+       python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+       tiff? ( media-libs/tiff:0= )
+       valgrind? ( dev-util/valgrind )"
+
+DEPEND="${RDEPEND}
+       doc? (
+               app-doc/doxygen
+               python? ( >=dev-python/sphinx-1.1.3-r5[${PYTHON_USEDEP}] )
+       )
+       test? ( >=dev-python/nose-1.1.2-r1[${PYTHON_USEDEP}] )"
+
+REQUIRED_USE="
+       doc? ( hdf5 fftw )
+       python? ( hdf5 ${PYTHON_REQUIRED_USE} )
+       test? ( hdf5 python fftw )"
+
+# Severely broken, also disabled in Fedora, bugs #390447, #653442
+RESTRICT="test"
+
+DOCS=( README.md )
+
+PATCHES=(
+       "${FILESDIR}/${P}-fix-incorrect-template-parameter-type.patch"
+)
+
+pkg_setup() {
+       use python && python_setup
+}
+
+src_prepare() {
+       einfo "Removing shipped docs and VCS files"
+       rm -rf doc || die
+       rm .git* .travis.yml || die
+
+       cmake-utils_src_prepare
+
+       # Don't use python_fix_shebang because we can't put this behind USE="python"
+       sed -i -e '/env/s:python:python2:' config/vigra-config.in || die
+}
+
+src_configure() {
+       vigra_configure() {
+               local libdir="$(get_libdir)"
+
+               local mycmakeargs=(
+                       -DAUTOEXEC_TESTS=OFF
+                       -DDOCDIR="${BUILD_DIR}/doc"
+                       -DDOCINSTALL="share/doc/${P}"
+                       -DLIBDIR_SUFFIX="${libdir/lib}"
+                       -DUSE_DOC=$(usex doc ON OFF) # unused
+                       -DUSE_FFTW3=$(usex fftw ON OFF) # unused
+                       -DUSE_JPEG=$(usex jpeg ON OFF) # unused
+                       -DUSE_MPI=$(usex mpi ON OFF) # unused
+                       -DUSE_PNG=$(usex png ON OFF) # unused
+                       -DUSE_TIFF=$(usex tiff ON OFF) # unused
+                       -DWITH_HDF5=$(usex hdf5 ON OFF)
+                       -DWITH_OPENEXR=$(usex openexr ON OFF)
+                       -DWITH_VALGRIND=$(usex valgrind ON OFF)
+                       -DWITH_VIGRANUMPY=$(usex python ON OFF)
+                       -DBUILD_TESTING=$(usex test ON OFF) # unused
+                       -DUSE_AUTOBUILD_TESTS=$(usex test ON OFF) # unused
+                       -DUSE_CREATE_CTEST_TARGETS=$(usex test ON OFF) # unused
+               )
+               cmake-utils_src_configure
+       }
+
+       if use python; then
+               python_foreach_impl vigra_configure
+       else
+               # required for docdir
+               _cmake_check_build_dir init
+               vigra_configure
+       fi
+}
+
+src_compile() {
+       local VIGRA_BUILD_DIR
+       vigra_compile() {
+               cmake-utils_src_compile
+               VIGRA_BUILD_DIR="${BUILD_DIR}"
+       }
+       if use python; then
+               python_foreach_impl vigra_compile
+       else
+               vigra_compile
+       fi
+
+       if use doc; then
+               einfo "Generating Documentation"
+               # use build dir from last compile command
+               VARTEXFONTS="${T}/fonts" BUILD_DIR="${VIGRA_BUILD_DIR}" cmake-utils_src_make doc
+       fi
+}
+
+src_install() {
+       if use python; then
+               python_foreach_impl cmake-utils_src_install
+               python_optimize
+       else
+               cmake-utils_src_install
+       fi
+}
+
+src_test() {
+       # perhaps disable tests (see #390447)
+       vigra_test() {
+               PYTHONPATH="${BUILD_DIR}/vigranumpy/vigra" cmake-utils_src_test
+       }
+       if use python; then
+               python_foreach_impl vigra_test
+       else
+               vigra_test
+       fi
+}
diff --git a/media-libs/vigra/vigra-9999.ebuild b/media-libs/vigra/vigra-9999.ebuild
new file mode 100644 (file)
index 0000000..4073587
--- /dev/null
@@ -0,0 +1,144 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_P="${P}-src"
+MY_V="${PV//\./-}"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads,xml"
+
+inherit cmake-utils python-r1
+
+DESCRIPTION="C++ computer vision library emphasizing customizable algorithms and structures"
+HOMEPAGE="https://ukoethe.github.io/vigra/"
+
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/ukoethe/${PN}.git"
+       inherit git-r3
+else
+       SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${MY_V}/${MY_P}.tar.gz"
+       KEYWORDS="~amd64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc +fftw +hdf5 +jpeg mpi openexr +png +python test +tiff valgrind"
+
+# runtime dependency on python:2.7 is required by the vigra-config script
+RDEPEND="
+       dev-lang/python:2.7
+       >=dev-libs/boost-1.52.0-r6:=[python?,${PYTHON_USEDEP}]
+       fftw? ( sci-libs/fftw:3.0 )
+       hdf5? ( >=sci-libs/hdf5-1.8.0:=[mpi?] )
+       jpeg? ( virtual/jpeg:0 )
+       openexr? ( media-libs/openexr:= )
+       png? ( media-libs/libpng:0= )
+       python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+       tiff? ( media-libs/tiff:0= )
+       valgrind? ( dev-util/valgrind )"
+
+DEPEND="${RDEPEND}
+       doc? (
+               app-doc/doxygen
+               python? ( >=dev-python/sphinx-1.1.3-r5[${PYTHON_USEDEP}] )
+       )
+       test? ( >=dev-python/nose-1.1.2-r1[${PYTHON_USEDEP}] )"
+
+REQUIRED_USE="
+       doc? ( hdf5 fftw )
+       python? ( hdf5 ${PYTHON_REQUIRED_USE} )
+       test? ( hdf5 python fftw )"
+
+# Severely broken, also disabled in Fedora, bugs #390447, #653442
+RESTRICT="test"
+
+DOCS=( README.md )
+
+pkg_setup() {
+       use python && python_setup
+}
+
+src_prepare() {
+       einfo "Removing shipped docs and VCS files"
+       rm -rf doc || die
+
+       cmake-utils_src_prepare
+
+       # Don't use python_fix_shebang because we can't put this behind USE="python"
+       sed -i -e '/env/s:python:python2:' config/vigra-config.in || die
+}
+
+src_configure() {
+       vigra_configure() {
+               local libdir="$(get_libdir)"
+
+               local mycmakeargs=(
+                       -DAUTOEXEC_TESTS=OFF
+                       -DDOCDIR="${BUILD_DIR}/doc"
+                       -DDOCINSTALL="share/doc/${P}"
+                       -DLIBDIR_SUFFIX="${libdir/lib}"
+                       -DUSE_DOC=$(usex doc ON OFF) # unused
+                       -DUSE_FFTW3=$(usex fftw ON OFF) # unused
+                       -DUSE_JPEG=$(usex jpeg ON OFF) # unused
+                       -DUSE_MPI=$(usex mpi ON OFF) # unused
+                       -DUSE_PNG=$(usex png ON OFF) # unused
+                       -DUSE_TIFF=$(usex tiff ON OFF) # unused
+                       -DWITH_HDF5=$(usex hdf5 ON OFF)
+                       -DWITH_OPENEXR=$(usex openexr ON OFF)
+                       -DWITH_VALGRIND=$(usex valgrind ON OFF)
+                       -DWITH_VIGRANUMPY=$(usex python ON OFF)
+                       -DBUILD_TESTING=$(usex test ON OFF) # unused
+                       -DUSE_AUTOBUILD_TESTS=$(usex test ON OFF) # unused
+                       -DUSE_CREATE_CTEST_TARGETS=$(usex test ON OFF) # unused
+               )
+               cmake-utils_src_configure
+       }
+
+       if use python; then
+               python_foreach_impl vigra_configure
+       else
+               # required for docdir
+               _cmake_check_build_dir init
+               vigra_configure
+       fi
+}
+
+src_compile() {
+       local VIGRA_BUILD_DIR
+       vigra_compile() {
+               cmake-utils_src_compile
+               VIGRA_BUILD_DIR="${BUILD_DIR}"
+       }
+       if use python; then
+               python_foreach_impl vigra_compile
+       else
+               vigra_compile
+       fi
+
+       if use doc; then
+               einfo "Generating Documentation"
+               # use build dir from last compile command
+               VARTEXFONTS="${T}/fonts" BUILD_DIR="${VIGRA_BUILD_DIR}" cmake-utils_src_make doc
+       fi
+}
+
+src_install() {
+       if use python; then
+               python_foreach_impl cmake-utils_src_install
+               python_optimize
+       else
+               cmake-utils_src_install
+       fi
+}
+
+src_test() {
+       # perhaps disable tests (see #390447)
+       vigra_test() {
+               PYTHONPATH="${BUILD_DIR}/vigranumpy/vigra" cmake-utils_src_test
+       }
+       if use python; then
+               python_foreach_impl vigra_test
+       else
+               vigra_test
+       fi
+}