1 |
commit: 87724dc6e1a9e45bd820535078a4d07c963257f0 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 26 23:50:50 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 27 00:12:47 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87724dc6 |
7 |
|
8 |
media-libs/vigra: Fix cmake module install dir, backport python3_7 |
9 |
|
10 |
Use shipped documentation as building fails right now. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/701208 |
13 |
Package-Manager: Portage-2.3.79, Repoman-2.3.18 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
.../files/vigra-1.11.1-cmake-module-dir.patch | 17 ++++++++++ |
17 |
.../vigra/files/vigra-1.11.1-python3.7.patch | 30 +++++++++++++++++ |
18 |
.../{vigra-9999.ebuild => vigra-1.11.1-r3.ebuild} | 38 +++++++--------------- |
19 |
media-libs/vigra/vigra-9999.ebuild | 6 ++-- |
20 |
4 files changed, 61 insertions(+), 30 deletions(-) |
21 |
|
22 |
diff --git a/media-libs/vigra/files/vigra-1.11.1-cmake-module-dir.patch b/media-libs/vigra/files/vigra-1.11.1-cmake-module-dir.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..cfc56b34722 |
25 |
--- /dev/null |
26 |
+++ b/media-libs/vigra/files/vigra-1.11.1-cmake-module-dir.patch |
27 |
@@ -0,0 +1,17 @@ |
28 |
+CMake modules must be in cmake subdir. |
29 |
+ |
30 |
+--- a/CMakeLists.txt 2017-05-19 17:01:08.000000000 +0200 |
31 |
++++ b/CMakeLists.txt 2019-11-26 23:50:40.660462479 +0100 |
32 |
+@@ -368,10 +368,10 @@ |
33 |
+ |
34 |
+ # export targets: |
35 |
+ INSTALL(EXPORT vigra-targets |
36 |
+- DESTINATION lib${LIB_SUFFIX}/vigra) |
37 |
++ DESTINATION lib${LIB_SUFFIX}/cmake/vigra) |
38 |
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfig.cmake |
39 |
+ ${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfigVersion.cmake |
40 |
+- DESTINATION lib${LIB_SUFFIX}/vigra) |
41 |
++ DESTINATION lib${LIB_SUFFIX}/cmake/vigra) |
42 |
+ EXPORT(TARGETS vigraimpex FILE vigra-targets.cmake) |
43 |
+ |
44 |
+ ################################################## |
45 |
|
46 |
diff --git a/media-libs/vigra/files/vigra-1.11.1-python3.7.patch b/media-libs/vigra/files/vigra-1.11.1-python3.7.patch |
47 |
new file mode 100644 |
48 |
index 00000000000..2e6cd3469f8 |
49 |
--- /dev/null |
50 |
+++ b/media-libs/vigra/files/vigra-1.11.1-python3.7.patch |
51 |
@@ -0,0 +1,30 @@ |
52 |
+From a6fa62663c6a6b752ed0707e95f643e25867a0f9 Mon Sep 17 00:00:00 2001 |
53 |
+From: John Kirkham <kirkhamj@××××××××××××.org> |
54 |
+Date: Fri, 19 Oct 2018 11:32:42 -0400 |
55 |
+Subject: [PATCH] Receive `const char *` from `PyUnicode_AsUTF8` |
56 |
+ |
57 |
+In Python 3.7, `PyUnicode_AsUTF8` was changed to return a `const char *` |
58 |
+instead of a `char *`. This broke VIGRA as we were accepting a `char *` |
59 |
+in this case instead. Fortunately we do not need it to be mutable for |
60 |
+our use case. So just type the variable storing the result from |
61 |
+`PyUnicode_AsUTF8` as a `const char *`. Should still work on older |
62 |
+Python 3 versions that return `char *` as well. |
63 |
+ |
64 |
+ref: https://bugs.python.org/issue28769 |
65 |
+--- |
66 |
+ vigranumpy/src/core/vigranumpycore.cxx | 2 +- |
67 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
68 |
+ |
69 |
+diff --git a/vigranumpy/src/core/vigranumpycore.cxx b/vigranumpy/src/core/vigranumpycore.cxx |
70 |
+index ec38d3636..c81c6ae52 100644 |
71 |
+--- a/vigranumpy/src/core/vigranumpycore.cxx |
72 |
++++ b/vigranumpy/src/core/vigranumpycore.cxx |
73 |
+@@ -61,7 +61,7 @@ UInt32 pychecksum(python::str const & s) |
74 |
+ return checksum(data, size); |
75 |
+ #else |
76 |
+ Py_ssize_t size = 0; |
77 |
+- char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size); |
78 |
++ const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size); |
79 |
+ return checksum(data, size); |
80 |
+ #endif |
81 |
+ } |
82 |
|
83 |
diff --git a/media-libs/vigra/vigra-9999.ebuild b/media-libs/vigra/vigra-1.11.1-r3.ebuild |
84 |
similarity index 80% |
85 |
copy from media-libs/vigra/vigra-9999.ebuild |
86 |
copy to media-libs/vigra/vigra-1.11.1-r3.ebuild |
87 |
index 6d9d2266b16..f2b096eaf51 100644 |
88 |
--- a/media-libs/vigra/vigra-9999.ebuild |
89 |
+++ b/media-libs/vigra/vigra-1.11.1-r3.ebuild |
90 |
@@ -3,8 +3,6 @@ |
91 |
|
92 |
EAPI=7 |
93 |
|
94 |
-MY_P="${P}-src" |
95 |
-MY_V="${PV//\./-}" |
96 |
PYTHON_COMPAT=( python3_{6,7} ) |
97 |
PYTHON_REQ_USE="threads(+),xml" |
98 |
inherit cmake-utils python-r1 |
99 |
@@ -16,7 +14,7 @@ if [[ ${PV} == *9999 ]] ; then |
100 |
EGIT_REPO_URI="https://github.com/ukoethe/${PN}.git" |
101 |
inherit git-r3 |
102 |
else |
103 |
- SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${MY_V}/${MY_P}.tar.gz" |
104 |
+ SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${PV//\./-}/${P}-src.tar.gz" |
105 |
KEYWORDS="~amd64 ~arm64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" |
106 |
fi |
107 |
|
108 |
@@ -25,15 +23,10 @@ SLOT="0" |
109 |
IUSE="doc +fftw +hdf5 +jpeg mpi openexr +png +python test +tiff valgrind +zlib" |
110 |
|
111 |
REQUIRED_USE=" |
112 |
- doc? ( hdf5 fftw ${PYTHON_REQUIRED_USE} ) |
113 |
python? ( hdf5 ${PYTHON_REQUIRED_USE} ) |
114 |
test? ( hdf5 python fftw )" |
115 |
|
116 |
BDEPEND=" |
117 |
- doc? ( |
118 |
- app-doc/doxygen |
119 |
- >=dev-python/sphinx-1.1.3-r5 |
120 |
- ) |
121 |
test? ( |
122 |
>=dev-python/nose-1.1.2-r1[${PYTHON_USEDEP}] |
123 |
valgrind? ( dev-util/valgrind ) |
124 |
@@ -65,15 +58,18 @@ RDEPEND="${PYTHON_DEPS} |
125 |
RESTRICT="test" |
126 |
|
127 |
PATCHES=( |
128 |
+ # git master |
129 |
+ "${FILESDIR}/${P}-fix-incorrect-template-parameter-type.patch" |
130 |
+ "${FILESDIR}/${P}-boost-python.patch" |
131 |
+ "${FILESDIR}/${P}-python3.7.patch" # bug 701208 |
132 |
# TODO: upstream |
133 |
- "${FILESDIR}/${PN}-1.11.1-lib_suffix.patch" |
134 |
- "${FILESDIR}/${PN}-1.11.1-sphinx.ext.pngmath.patch" # thanks to Debian; bug 678308 |
135 |
+ "${FILESDIR}/${P}-lib_suffix.patch" |
136 |
+ "${FILESDIR}/${P}-cmake-module-dir.patch" |
137 |
+ "${FILESDIR}/${P}-sphinx.ext.pngmath.patch" # thanks to Debian; bug 678308 |
138 |
) |
139 |
|
140 |
pkg_setup() { |
141 |
- if use python || use doc; then |
142 |
- python_setup |
143 |
- fi |
144 |
+ use python && python_setup |
145 |
} |
146 |
|
147 |
src_prepare() { |
148 |
@@ -86,10 +82,6 @@ src_prepare() { |
149 |
|
150 |
cmake-utils_src_prepare |
151 |
|
152 |
- if [[ ${PV} != *9999 ]]; then |
153 |
- rm -r doc || die "failed to remove shipped docs" |
154 |
- fi |
155 |
- |
156 |
vigra_disable fftw fftw3 |
157 |
vigra_disable fftw fftw3f |
158 |
vigra_disable jpeg |
159 |
@@ -100,6 +92,7 @@ src_prepare() { |
160 |
# Don't use python_fix_shebang because we can't put this behind USE="python" |
161 |
sed -i -e '/env/s:python:python3:' config/vigra-config.in || die |
162 |
|
163 |
+ use doc || cmake_comment_add_subdirectory docsrc |
164 |
use test || cmake_comment_add_subdirectory test |
165 |
} |
166 |
|
167 |
@@ -107,8 +100,7 @@ src_configure() { |
168 |
vigra_configure() { |
169 |
local mycmakeargs=( |
170 |
-DAUTOEXEC_TESTS=OFF |
171 |
- -DDOCDIR="${BUILD_DIR}/doc" |
172 |
- -DDOCINSTALL="share/doc/${PF}" |
173 |
+ -DDOCINSTALL="share/doc/${PF}/html" |
174 |
-DWITH_HDF5=$(usex hdf5) |
175 |
-DWITH_OPENEXR=$(usex openexr) |
176 |
-DWITH_VALGRIND=$(usex valgrind) |
177 |
@@ -120,8 +112,6 @@ src_configure() { |
178 |
if use python; then |
179 |
python_foreach_impl vigra_configure |
180 |
else |
181 |
- # required for docdir |
182 |
- _cmake_check_build_dir init |
183 |
vigra_configure |
184 |
fi |
185 |
} |
186 |
@@ -137,12 +127,6 @@ src_compile() { |
187 |
else |
188 |
vigra_compile |
189 |
fi |
190 |
- |
191 |
- if use doc; then |
192 |
- einfo "Generating Documentation" |
193 |
- # use build dir from last compile command |
194 |
- VARTEXFONTS="${T}/fonts" BUILD_DIR="${VIGRA_BUILD_DIR}" cmake-utils_src_make doc |
195 |
- fi |
196 |
} |
197 |
|
198 |
src_install() { |
199 |
|
200 |
diff --git a/media-libs/vigra/vigra-9999.ebuild b/media-libs/vigra/vigra-9999.ebuild |
201 |
index 6d9d2266b16..c1094b89265 100644 |
202 |
--- a/media-libs/vigra/vigra-9999.ebuild |
203 |
+++ b/media-libs/vigra/vigra-9999.ebuild |
204 |
@@ -3,8 +3,6 @@ |
205 |
|
206 |
EAPI=7 |
207 |
|
208 |
-MY_P="${P}-src" |
209 |
-MY_V="${PV//\./-}" |
210 |
PYTHON_COMPAT=( python3_{6,7} ) |
211 |
PYTHON_REQ_USE="threads(+),xml" |
212 |
inherit cmake-utils python-r1 |
213 |
@@ -16,7 +14,7 @@ if [[ ${PV} == *9999 ]] ; then |
214 |
EGIT_REPO_URI="https://github.com/ukoethe/${PN}.git" |
215 |
inherit git-r3 |
216 |
else |
217 |
- SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${MY_V}/${MY_P}.tar.gz" |
218 |
+ SRC_URI="https://github.com/ukoethe/${PN}/releases/download/Version-${PV//\./-}/${P}-src.tar.gz" |
219 |
KEYWORDS="~amd64 ~arm64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" |
220 |
fi |
221 |
|
222 |
@@ -67,6 +65,7 @@ RESTRICT="test" |
223 |
PATCHES=( |
224 |
# TODO: upstream |
225 |
"${FILESDIR}/${PN}-1.11.1-lib_suffix.patch" |
226 |
+ "${FILESDIR}/${PN}-1.11.1-cmake-module-dir.patch" |
227 |
"${FILESDIR}/${PN}-1.11.1-sphinx.ext.pngmath.patch" # thanks to Debian; bug 678308 |
228 |
) |
229 |
|
230 |
@@ -140,6 +139,7 @@ src_compile() { |
231 |
|
232 |
if use doc; then |
233 |
einfo "Generating Documentation" |
234 |
+ doxygen -u ${VIGRA_BUILD_DIR}/docsrc/Doxyfile 2>/dev/null || die |
235 |
# use build dir from last compile command |
236 |
VARTEXFONTS="${T}/fonts" BUILD_DIR="${VIGRA_BUILD_DIR}" cmake-utils_src_make doc |
237 |
fi |