Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/mathgl/, sci-libs/mathgl/files/
Date: Sun, 01 Apr 2018 21:55:25
Message-Id: 1522619680.e77c75e99ed8208c5eafdf74af09eb9631c8c160.monsieurp@gentoo
1 commit: e77c75e99ed8208c5eafdf74af09eb9631c8c160
2 Author: Jouni Kosonen <jouni.kosonen <AT> tukesoft <DOT> com>
3 AuthorDate: Mon Feb 19 16:05:27 2018 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 1 21:54:40 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e77c75e9
7
8 sci-libs/mathgl: version bump to 2.4.1.
9
10 Closes: https://bugs.gentoo.org/596150
11 Closes: https://github.com/gentoo/gentoo/pull/7229
12
13 sci-libs/mathgl/Manifest | 1 +
14 sci-libs/mathgl/files/mathgl-2.4.1-mutex.patch | 16 +++
15 sci-libs/mathgl/mathgl-2.4.1.ebuild | 180 +++++++++++++++++++++++++
16 3 files changed, 197 insertions(+)
17
18 diff --git a/sci-libs/mathgl/Manifest b/sci-libs/mathgl/Manifest
19 index 4e77e01a129..f36f9767c84 100644
20 --- a/sci-libs/mathgl/Manifest
21 +++ b/sci-libs/mathgl/Manifest
22 @@ -1,2 +1,3 @@
23 DIST STIX_font.tgz 2450541 BLAKE2B f725eb0264d9c3cb7c32a935e8857c4a21cb905a1dc6c9cc8a16408afdc7dd9b6fcd312a8c2f77aff5484605a39a9ee36e86ad0234adb5d6bcc5c8839101194c SHA512 c9124ec552074c98f15d6d3572a063598ca6bc598e3e78dcb5a5d57ae3928b5327a1374635f428ea1cefc9e51ee1d1aa9bd6ba9a306429fc6965140251d368b5
24 DIST mathgl-2.3.4.tar.gz 21361705 BLAKE2B 652cae42ace83077c5e5add2164a99d9a4f0b76a95d9ddd9b5570c04e87ce06c6cf127af85c451f74c7aa59e411c02c970e5fea7ed501a690f6d1a1456dcbd9c SHA512 2ddc45750ae2373c26e199f43b7f9546e0d4540c7b11a1e6280c83632face42f50bcb8276c60b0c2208ca0b6a7506e3fc0d195a8c1aa9e774ba812643b81336d
25 +DIST mathgl-2.4.1.tar.gz 22665490 BLAKE2B a9c9e0ec7d145262994a754dfbcf1f789d2777f9334c8b4e73696265adba4d2fd7283621857318264c2162841e81427df21f7bc7b951d83876fbc066d3b9068f SHA512 10fd016662ca60b9507942691f85b4d9151104319627732f4add0175475f7e8dff16e3645bb858c283b747f34e58f410d0532e94dc64cf8cf472938d3966402d
26
27 diff --git a/sci-libs/mathgl/files/mathgl-2.4.1-mutex.patch b/sci-libs/mathgl/files/mathgl-2.4.1-mutex.patch
28 new file mode 100644
29 index 00000000000..4ce7bb73311
30 --- /dev/null
31 +++ b/sci-libs/mathgl/files/mathgl-2.4.1-mutex.patch
32 @@ -0,0 +1,16 @@
33 +diff --git a/src/canvas.cpp b/src/canvas.cpp
34 +index ba4ffededb9b..7ea755d18265 100644
35 +--- a/src/canvas.cpp
36 ++++ b/src/canvas.cpp
37 +@@ -1219,9 +1219,9 @@ void mglCanvas::Pop()
38 + {
39 + B = stack.back();
40 + #if MGL_HAVE_PTHREAD
41 +- pthread_mutex_lock(&m);
42 ++ pthread_mutex_lock(&mutexStk);
43 + stack.pop_back();
44 +- pthread_mutex_unlock(&m);
45 ++ pthread_mutex_unlock(&mutexStk);
46 + #else
47 + #pragma omp critical(stk)
48 + stack.pop_back();
49
50 diff --git a/sci-libs/mathgl/mathgl-2.4.1.ebuild b/sci-libs/mathgl/mathgl-2.4.1.ebuild
51 new file mode 100644
52 index 00000000000..461956958f1
53 --- /dev/null
54 +++ b/sci-libs/mathgl/mathgl-2.4.1.ebuild
55 @@ -0,0 +1,180 @@
56 +# Copyright 1999-2018 Gentoo Foundation
57 +# Distributed under the terms of the GNU General Public License v2
58 +
59 +EAPI=6
60 +
61 +PYTHON_COMPAT=( python2_7 )
62 +WX_GTK_VER=3.0
63 +
64 +inherit cmake-utils eutils python-single-r1 wxwidgets multilib flag-o-matic
65 +
66 +DESCRIPTION="Math Graphics Library"
67 +HOMEPAGE="http://mathgl.sourceforge.net/"
68 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz mirror://sourceforge/${PN}/STIX_font.tgz"
69 +
70 +LICENSE="LGPL-3"
71 +SLOT="0/7.5.0"
72 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
73 +IUSE="doc fltk gif glut gsl hdf hdf5 jpeg lua mpi octave opengl openmp pdf
74 + png python qt5 static-libs threads wxwidgets zlib"
75 +
76 +LANGS="ru"
77 +for l in ${LANGS}; do
78 + IUSE+=" l10n_${l}"
79 +done
80 +unset l
81 +
82 +RDEPEND="
83 + virtual/opengl
84 + fltk? ( x11-libs/fltk:1 )
85 + gif? ( media-libs/giflib )
86 + glut? ( media-libs/freeglut )
87 + gsl? ( >=sci-libs/gsl-2 )
88 + hdf? ( sci-libs/hdf )
89 + hdf5? ( >=sci-libs/hdf5-1.8[mpi=] )
90 + jpeg? ( virtual/jpeg:0 )
91 + lua? ( >=dev-lang/lua-5.1:0 )
92 + octave? ( >=sci-mathematics/octave-3.4.0 )
93 + openmp? ( sys-cluster/openmpi )
94 + pdf? ( media-libs/libharu )
95 + png? ( media-libs/libpng:0 )
96 + python? ( dev-python/numpy[${PYTHON_USEDEP}] ${PYTHON_DEPS} )
97 + qt5? (
98 + dev-qt/qtcore:5
99 + dev-qt/qtgui:5
100 + dev-qt/qtprintsupport:5
101 + dev-qt/qtwidgets:5
102 + )
103 + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )
104 + zlib? ( sys-libs/zlib )"
105 +
106 +DEPEND="${RDEPEND}
107 + doc? ( app-text/texi2html virtual/texi2dvi )
108 + octave? ( dev-lang/swig )
109 + python? ( dev-lang/swig )"
110 +
111 +REQUIRED_USE="
112 + mpi? ( hdf5 )
113 + openmp? ( !threads )
114 + png? ( zlib )
115 + pdf? ( png )
116 + python? ( ${PYTHON_REQUIRED_USE} )"
117 +
118 +PATCHES=(
119 + "${FILESDIR}"/${P}-mutex.patch
120 +)
121 +
122 +pkg_setup() {
123 + use mpi && export CC=mpicc CXX=mpicxx
124 + use python && python-single-r1_pkg_setup
125 +}
126 +
127 +src_unpack() {
128 + default
129 + if ! [[ -d "${S}"/fonts ]]; then
130 + mkdir "${S}"/fonts || die
131 + fi
132 + cd "${S}"/fonts || die
133 + unpack STIX_font.tgz
134 +}
135 +
136 +src_prepare() {
137 + # fix for location of hdf headers
138 + sed -i -e 's:hdf/::g' src/data_io.cpp || die
139 + # bored of reporting bad libdir upstream
140 + sed -i \
141 + -e '/DESTINATION/s:lib$:lib${LIB_SUFFIX}:g' \
142 + {src,widgets}/CMakeLists.txt || die
143 + echo "" > lang/install.m || die
144 + # fix desktop file
145 + sed -i -e 's/.png//' udav/udav.desktop || die
146 + # prevent sandbox violation
147 + sed -i -e 's/update-mime-database/true/' udav/CMakeLists.txt || die
148 + sed -i -e 's/update-desktop-database/true/' udav/CMakeLists.txt || die
149 +
150 + use python && \
151 + append-cppflags \
152 + -I"$(${EPYTHON} -c 'import numpy; print(numpy.get_include())')"
153 + use wxwidgets && need-wxwidgets unicode
154 + cmake-utils_src_prepare
155 +}
156 +
157 +src_configure() {
158 + local mycmakeargs=()
159 + if use hdf; then
160 + mycmakeargs+=(
161 + -DHDF4_INCLUDE_DIR="${EPREFIX}/usr/include"
162 + )
163 + fi
164 + mycmakeargs+=(
165 + # No clue about this option:
166 + # option(enable-mgl2 "Use names 'libmgl2-*' instead of 'libmgl-*'")
167 + -DMathGL_INSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
168 + -Denable-all-docs=$(usex doc)
169 + -Denable-fltk=$(usex fltk)
170 + -Denable-gif=$(usex gif)
171 + -Denable-glut=$(usex glut)
172 + -Denable-gsl=$(usex gsl)
173 + -Denable-hdf4=$(usex hdf)
174 + -Denable-hdf5=$(usex hdf5)
175 + -Denable-jpeg=$(usex jpeg)
176 + -Denable-lua=$(usex lua)
177 + -Denable-mpi=$(usex mpi)
178 + -Denable-octave=$(usex octave)
179 + -Denable-opengl=$(usex opengl)
180 + -Denable-openmp=$(usex openmp)
181 + -Denable-pdf=$(usex pdf)
182 + -Denable-png=$(usex png)
183 + -Denable-qt4=OFF
184 + -Denable-qt5=$(usex qt5)
185 + -Denable-qt5asqt=$(usex qt5)
186 + -Denable-pthread=$(usex threads)
187 + -Denable-pthr-widget=$(usex threads)
188 + -Denable-python=$(usex python)
189 + -Denable-wx=$(usex wxwidgets)
190 + -Denable-zlib=$(usex zlib)
191 + )
192 + cmake-utils_src_configure
193 + # to whoever cares: TODO: do for multiple python ABI
194 + if use python; then
195 + sed -i \
196 + -e "s:--prefix=\(.*\) :--prefix=\$ENV{DESTDIR}\1 :" \
197 + "${CMAKE_BUILD_DIR}"/lang/cmake_install.cmake || die
198 + fi
199 +}
200 +
201 +src_install() {
202 + cmake-utils_src_install
203 + dodoc README* *.txt AUTHORS
204 + if ! use static-libs; then
205 + rm "${ED}"/usr/$(get_libdir)/*.a || die
206 + fi
207 + if use qt5 ; then
208 + local lang
209 + insinto /usr/share/udav
210 + for lang in ${LANGS} ; do
211 + use l10n_${lang} && doins udav/udav_${lang}.qm
212 + done
213 + fi
214 + if use octave ; then
215 + insinto /usr/share/${PN}/octave
216 + doins "${CMAKE_BUILD_DIR}"/lang/${PN}.tar.gz
217 + fi
218 + use python && python_optimize
219 +}
220 +
221 +pkg_postinst() {
222 + if use octave; then
223 + octave <<-EOF
224 + pkg install ${EROOT}/usr/share/${PN}/octave/${PN}.tar.gz
225 + EOF
226 + fi
227 +}
228 +
229 +pkg_prerm() {
230 + if use octave; then
231 + octave <<-EOF
232 + pkg uninstall ${PN}
233 + EOF
234 + fi
235 +}