Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/vigra/
Date: Mon, 08 Apr 2019 21:15:20
Message-Id: 1554757982.bf5b286286b23a33a24f718e8bd765b9617f73e3.asturm@gentoo
1 commit: bf5b286286b23a33a24f718e8bd765b9617f73e3
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 8 21:08:23 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 8 21:13:02 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf5b2862
7
8 media-libs/vigra: Revbump with lots of fixes from 9999
9
10 Bug: https://bugs.gentoo.org/682860
11 Package-Manager: Portage-2.3.62, Repoman-2.3.12
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 media-libs/vigra/vigra-1.11.1-r2.ebuild | 163 ++++++++++++++++++++++++++++++++
15 1 file changed, 163 insertions(+)
16
17 diff --git a/media-libs/vigra/vigra-1.11.1-r2.ebuild b/media-libs/vigra/vigra-1.11.1-r2.ebuild
18 new file mode 100644
19 index 00000000000..97c69bf3221
20 --- /dev/null
21 +++ b/media-libs/vigra/vigra-1.11.1-r2.ebuild
22 @@ -0,0 +1,163 @@
23 +# Copyright 1999-2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +MY_P="${P}-src"
29 +MY_V="${PV//\./-}"
30 +PYTHON_COMPAT=( python2_7 )
31 +PYTHON_REQ_USE="threads,xml"
32 +inherit cmake-utils python-r1
33 +
34 +DESCRIPTION="C++ computer vision library emphasizing customizable algorithms and structures"
35 +HOMEPAGE="https://ukoethe.github.io/vigra/"
36 +
37 +if [[ ${PV} == *9999 ]] ; then
38 + EGIT_REPO_URI="https://github.com/ukoethe/${PN}.git"
39 + inherit git-r3
40 +else
41 + SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${MY_V}/${MY_P}.tar.gz"
42 + KEYWORDS="~amd64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
43 +fi
44 +
45 +LICENSE="MIT"
46 +SLOT="0"
47 +IUSE="doc +fftw +hdf5 +jpeg mpi openexr +png +python test +tiff valgrind +zlib"
48 +
49 +REQUIRED_USE="
50 + doc? ( hdf5 fftw )
51 + python? ( hdf5 ${PYTHON_REQUIRED_USE} )
52 + test? ( hdf5 python fftw )"
53 +
54 +BDEPEND="
55 + doc? (
56 + app-doc/doxygen
57 + >=dev-python/sphinx-1.1.3-r5[${PYTHON_USEDEP}]
58 + )
59 + test? (
60 + >=dev-python/nose-1.1.2-r1[${PYTHON_USEDEP}]
61 + valgrind? ( dev-util/valgrind )
62 + )
63 +"
64 +# runtime dependency on python:2.7 is required by the vigra-config script
65 +DEPEND="
66 + dev-lang/python:2.7
67 + fftw? ( sci-libs/fftw:3.0 )
68 + hdf5? ( >=sci-libs/hdf5-1.8.0:=[mpi=] )
69 + jpeg? ( virtual/jpeg:0 )
70 + openexr? (
71 + media-libs/openexr:=
72 + media-libs/ilmbase:=
73 + )
74 + png? ( media-libs/libpng:0= )
75 + python? (
76 + dev-libs/boost:=[python?,${PYTHON_USEDEP}]
77 + dev-python/numpy[${PYTHON_USEDEP}]
78 + ${PYTHON_DEPS}
79 + )
80 + tiff? ( media-libs/tiff:0= )
81 + zlib? ( sys-libs/zlib )
82 +"
83 +RDEPEND="${DEPEND}"
84 +
85 +# Severely broken, also disabled in Fedora, bugs #390447, #653442
86 +RESTRICT="test"
87 +
88 +PATCHES=(
89 + "${FILESDIR}/${P}-fix-incorrect-template-parameter-type.patch"
90 + "${FILESDIR}/${P}-lib_suffix.patch"
91 +)
92 +
93 +pkg_setup() {
94 + if use python || use doc; then
95 + python_setup
96 + fi
97 +}
98 +
99 +src_prepare() {
100 + vigra_disable() {
101 + if ! use ${1}; then
102 + sed -e "/^VIGRA_FIND_PACKAGE.*${2:-$1}/Is/^/#disabled by USE=${1}: /" \
103 + -i CMakeLists.txt || die "failed to disable ${1}"
104 + fi
105 + }
106 +
107 + cmake-utils_src_prepare
108 +
109 + if [[ ${PV} != *9999 ]]; then
110 + rm -r doc || die "failed to remove shipped docs"
111 + fi
112 +
113 + vigra_disable fftw fftw3
114 + vigra_disable fftw fftw3f
115 + vigra_disable jpeg
116 + vigra_disable png
117 + vigra_disable tiff
118 + vigra_disable zlib
119 +
120 + # Don't use python_fix_shebang because we can't put this behind USE="python"
121 + sed -i -e '/env/s:python:python2:' config/vigra-config.in || die
122 +}
123 +
124 +src_configure() {
125 + vigra_configure() {
126 + local mycmakeargs=(
127 + -DAUTOEXEC_TESTS=OFF
128 + -DDOCDIR="${BUILD_DIR}/doc"
129 + -DDOCINSTALL="share/doc/${PF}"
130 + -DWITH_HDF5=$(usex hdf5)
131 + -DWITH_OPENEXR=$(usex openexr)
132 + -DWITH_VALGRIND=$(usex valgrind)
133 + -DWITH_VIGRANUMPY=$(usex python)
134 + )
135 + cmake-utils_src_configure
136 + }
137 +
138 + if use python; then
139 + python_foreach_impl vigra_configure
140 + else
141 + # required for docdir
142 + _cmake_check_build_dir init
143 + vigra_configure
144 + fi
145 +}
146 +
147 +src_compile() {
148 + local VIGRA_BUILD_DIR
149 + vigra_compile() {
150 + cmake-utils_src_compile
151 + VIGRA_BUILD_DIR="${BUILD_DIR}"
152 + }
153 + if use python; then
154 + python_foreach_impl vigra_compile
155 + else
156 + vigra_compile
157 + fi
158 +
159 + if use doc; then
160 + einfo "Generating Documentation"
161 + # use build dir from last compile command
162 + VARTEXFONTS="${T}/fonts" BUILD_DIR="${VIGRA_BUILD_DIR}" cmake-utils_src_make doc
163 + fi
164 +}
165 +
166 +src_install() {
167 + if use python; then
168 + python_foreach_impl cmake-utils_src_install
169 + python_optimize
170 + else
171 + cmake-utils_src_install
172 + fi
173 +}
174 +
175 +src_test() {
176 + # perhaps disable tests (see #390447)
177 + vigra_test() {
178 + PYTHONPATH="${BUILD_DIR}/vigranumpy/vigra" cmake-utils_src_test
179 + }
180 + if use python; then
181 + python_foreach_impl vigra_test
182 + else
183 + vigra_test
184 + fi
185 +}