diff options
Diffstat (limited to 'sci-libs/nlopt')
-rw-r--r-- | sci-libs/nlopt/Manifest | 2 | ||||
-rw-r--r-- | sci-libs/nlopt/nlopt-2.7.1.ebuild | 97 |
2 files changed, 99 insertions, 0 deletions
diff --git a/sci-libs/nlopt/Manifest b/sci-libs/nlopt/Manifest index 2bcf88c97164..f6081120bd30 100644 --- a/sci-libs/nlopt/Manifest +++ b/sci-libs/nlopt/Manifest @@ -1,3 +1,5 @@ DIST nlopt-2.6.2.tar.gz 2040229 BLAKE2B f1f4124de574600ddbef8a885bbdd3a4f57b469b2f958ce94bbc831cf9bfa8a845e438fccfe4ab219a73a5675b8d880f6d49e0e7cbe9d0966777b0d2344521d4 SHA512 61e5c01140a57c0ad2a0acd82ad50dce1b5679dc281e55cbbc332e876b19a689013100617545a42b721d8c487df37d6ccd67859171243433fe29468f259b556b +DIST nlopt-2.7.1.tar.gz 2044180 BLAKE2B 6d459f94a26ee6dd7f72c73c48992bd047150aa525bc4ad088c8516127afc5c7843f6fbb6726c2f845271b87934c13e0892a063362ab50df51f92e81979111fb SHA512 e23cb522fc696010574c14b72be85acc0f8ccf0bf208bf2b8789c57d6c5a6e6d419ee10330581518b1c1567018ae909b626ce7761d4fbd5bf112916871e420e2 EBUILD nlopt-2.6.2-r1.ebuild 2307 BLAKE2B 9c57f104122725bb2660bde7259ff187256d26cffbb4f0bd399acd2b07dcbac522ea4c83ea2196c84a274fe3c188ee61830e0e09d93505a78df1d74618505364 SHA512 858cc72c427ec512c1ef07619fc44230b1b5fe9b1ca68899341a80c13db7a9a1ac82cc8a8dd3d419a832519739ec672361ee3acdb058f31140df9195101fefd9 +EBUILD nlopt-2.7.1.ebuild 1991 BLAKE2B c3e17104cf44dd3a64fe4a3e2bbcc348b27e4e3d465d1098404317d29a836e8ddb5efa3e443edb86b18250efe2668bdf08107406c6bf2ddce957e864f3dd3c73 SHA512 b94a753fcab605f2549f19d348736cef3a0d9017a71af65fec1b81555286b856ec888a7962ece98c67e03b5e16048c737e1643947eaa2fcd6528791640655991 MISC metadata.xml 1096 BLAKE2B 2b35b6f79c882fbae26b6bc68c75e30b0e2d48f540696cbbc48f06c2686e89a1a5f582d59d2c1ee3b47d5f813f4dbc20cd1d35228c7f968e327e41bb2f1f4da9 SHA512 5776b4b8faa1a6406f1d65bcd9de9ce4087580d98b5c3272804d442905c34d64c6e7d632022425e6e13b12161c94a99906a6196c3624b5b9b4aa1eac6fe9aa1e diff --git a/sci-libs/nlopt/nlopt-2.7.1.ebuild b/sci-libs/nlopt/nlopt-2.7.1.ebuild new file mode 100644 index 000000000000..814c7a1440fc --- /dev/null +++ b/sci-libs/nlopt/nlopt-2.7.1.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit python-r1 cmake fortran-2 + +DESCRIPTION="Non-linear optimization library" +HOMEPAGE="https://github.com/stevengj/nlopt" +SRC_URI="https://github.com/stevengj/nlopt/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="LGPL-2.1 MIT" +KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux" +SLOT="0" +IUSE="cxx guile octave python test" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +RESTRICT="!test? ( test )" + +RDEPEND=" + guile? ( dev-scheme/guile:* ) + octave? ( >=sci-mathematics/octave-6 ) + python? ( + ${PYTHON_DEPS} + dev-python/numpy[${PYTHON_USEDEP}] + ) + " +DEPEND=" + ${RDEPEND} + python? ( dev-lang/swig ) + " + +src_prepare() { + cmake_src_prepare + use python && python_copy_sources +} + +src_configure() { + # MATLAB detection causes problems (as in bug 826774) if we don't + # explicitly disable it. + local mycmakeargs=( + -DNLOPT_CXX=$(usex cxx) + -DNLOPT_FORTRAN=$(usex test) + -DNLOPT_GUILE=$(usex guile) + -DNLOPT_OCTAVE=$(usex octave) + -DNLOPT_MATLAB=OFF + -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 +} |