commit:     1c975626cefbea18e1d2e1c1c1bfbedc662b1cda
Author:     Mark Wright <gienah <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 21 04:54:05 2020 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Sun Jun 21 04:54:05 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c975626

sci-libs/nlopt: Bump to 2.6.2

Thanks to Marian Kyral for starting work on the ebuild bump.

Closes: https://bugs.gentoo.org/724640
Package-Manager: Portage-2.3.101, Repoman-2.3.22
Signed-off-by: Mark Wright <gienah <AT> gentoo.org>

 sci-libs/nlopt/Manifest           |  1 +
 sci-libs/nlopt/nlopt-2.6.2.ebuild | 95 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+)

diff --git a/sci-libs/nlopt/Manifest b/sci-libs/nlopt/Manifest
index 1f8348cf56b..459d271131f 100644
--- a/sci-libs/nlopt/Manifest
+++ b/sci-libs/nlopt/Manifest
@@ -1 +1,2 @@
 DIST nlopt-2.4.2.tar.gz 2361992 BLAKE2B 
c1c9f533c7e7b3bb61e81343ebd26b87e05434fdbea1f347fc5f6a6c10160289ce105a51c6540296f3f1d122d31b415452da49b84516cd13fabc73372e4cfd0e
 SHA512 
136aacc00a69f77e8a7ce5dc26a5f3f027bc8c01b97aa1f43919462e0a412154eabfb01be258e082dffe61f9b554bb2bfbb550a7b82c7c77c7b22874a64a9703
+DIST v2.6.2.tar.gz 2040229 BLAKE2B 
f1f4124de574600ddbef8a885bbdd3a4f57b469b2f958ce94bbc831cf9bfa8a845e438fccfe4ab219a73a5675b8d880f6d49e0e7cbe9d0966777b0d2344521d4
 SHA512 
61e5c01140a57c0ad2a0acd82ad50dce1b5679dc281e55cbbc332e876b19a689013100617545a42b721d8c487df37d6ccd67859171243433fe29468f259b556b

diff --git a/sci-libs/nlopt/nlopt-2.6.2.ebuild 
b/sci-libs/nlopt/nlopt-2.6.2.ebuild
new file mode 100644
index 00000000000..f21aa295b04
--- /dev/null
+++ b/sci-libs/nlopt/nlopt-2.6.2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{6..9} )
+
+inherit python-r1 cmake
+
+DESCRIPTION="Non-linear optimization library"
+HOMEPAGE="https://ab-initio.mit.edu/nlopt/";
+SRC_URI="https://github.com/stevengj/nlopt/archive/v${PV}.tar.gz";
+
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+IUSE="cxx guile octave python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       guile? ( dev-scheme/guile:* )
+       octave? ( sci-mathematics/octave )
+       python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep 
'dev-python/numpy-python2[${PYTHON_USEDEP}]' -2)
+               $(python_gen_cond_dep 'dev-python/numpy[${PYTHON_USEDEP}]' -3)
+       )
+       "
+DEPEND="
+       ${RDEPEND}
+       python? ( dev-lang/swig )
+       "
+
+src_prepare() {
+       cmake_src_prepare
+       use python && python_copy_sources
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DNLOPT_CXX=$(usex cxx)
+               -DNLOPT_FORTRAN=$(usex test)
+               -DNLOPT_GUILE=$(usex guile)
+               -DNLOPT_OCTAVE=$(usex octave)
+               -DNLOPT_PYTHON=$(usex python)
+               -DNLOPT_SWIG=$(usex python)
+               -DNLOPT_TESTS=$(usex test)
+       )
+       if use python; then
+               python_foreach_impl run_in_build_dir cmake_src_configure
+       else
+               cmake_src_configure
+       fi
+}
+
+src_compile() {
+       if use python; then
+               python_foreach_impl run_in_build_dir cmake_src_compile
+       else
+               cmake_src_compile
+       fi
+}
+
+src_test() {
+       do_test() {
+               local a f
+               cd "${BUILD_DIR}"/test
+               for a in {1..$(usex cxx 9 7)}; do
+                       for f in {5..9}; do
+                               ./testopt -a $a -o $f || die "algorithm $a 
function $f failed"
+                       done
+               done
+       }
+       if use python; then
+               python_foreach_impl run_in_build_dir do_test
+       else
+               do_test
+       fi
+}
+
+nlopt_install() {
+       cmake_src_install
+       python_optimize
+}
+
+src_install() {
+       if use python; then
+               python_foreach_impl run_in_build_dir nlopt_install
+       else
+               cmake_src_install
+       fi
+       local r
+       for r in */README; do newdoc ${r} README.$(dirname ${r}); done
+}

Reply via email to