summaryrefslogtreecommitdiff
path: root/sci-libs/nlopt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-09-19 12:11:50 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-09-19 12:11:50 +0100
commitfe0961fc9674dd24a017f474a34c1edbbd005965 (patch)
treedfdf05888e0f5fff9c1faafe6eb0dd5d827b63e5 /sci-libs/nlopt
parentbcd00c826070701606b0ccebf46234dfc792d3e9 (diff)
gentoo auto-resync : 19:09:2024 - 12:11:50
Diffstat (limited to 'sci-libs/nlopt')
-rw-r--r--sci-libs/nlopt/Manifest1
-rw-r--r--sci-libs/nlopt/nlopt-2.7.1-r100.ebuild115
2 files changed, 116 insertions, 0 deletions
diff --git a/sci-libs/nlopt/Manifest b/sci-libs/nlopt/Manifest
index c934bade1311..47c1eccd6664 100644
--- a/sci-libs/nlopt/Manifest
+++ b/sci-libs/nlopt/Manifest
@@ -1,4 +1,5 @@
DIST nlopt-2.7.1.tar.gz 2044180 BLAKE2B 6d459f94a26ee6dd7f72c73c48992bd047150aa525bc4ad088c8516127afc5c7843f6fbb6726c2f845271b87934c13e0892a063362ab50df51f92e81979111fb SHA512 e23cb522fc696010574c14b72be85acc0f8ccf0bf208bf2b8789c57d6c5a6e6d419ee10330581518b1c1567018ae909b626ce7761d4fbd5bf112916871e420e2
EBUILD nlopt-2.7.1-r1.ebuild 2158 BLAKE2B 88b1e4398b00988e964a7c5278a23eae12325464a8f8b89ad35b7bf69649d426b86ea14911a478ef96fd7f253cc09a90c080749e272f47a92a87443705edd084 SHA512 cdc065b3160bd91c75c5ebd90a34d6e8664ee615b275345935fe55ab217afdc4f3d1dc6953af8a202a19a560e0dadf692d8fff3dddcf1cd85953d503b511df18
+EBUILD nlopt-2.7.1-r100.ebuild 2302 BLAKE2B fbd71e1ab20ae0266cc2e3969f760f53365e521ee2a58c7e1bebc53d129f7b13d6d471642fe4a39b929e10f83266fdc3898465b2d6561729899bb59f0a2f84c3 SHA512 b3789c954b01fe71b9d8aa1a6b2a38dba5e2d57fea451e98c36acc97405127bd8d41a4bcdc48beaae0b1237667292507a319d1cc4b3fe1441ac65a57940a16cb
EBUILD nlopt-2.7.1-r2.ebuild 2179 BLAKE2B e53e1ba5ce1a66366777a57a73343ff5a120e17a5ed553a2abda4a609ffa8b3d06336b22634405a5a6e0d1fef3e87af68938c8d475fd606dcbf6b7979e74659a SHA512 064c39c1e414d5267e294b2e2ece192b9b6d6e22f2fa8f2ca2f1a29d54bf5e0140b99e500074a5e2dad18fd74cd00ccede1e9d530a1d4bf7516d8d76fa3d3d85
MISC metadata.xml 1203 BLAKE2B 305f090b1ca48c29668381d625cf3b6615e053fe25bdf66a0f15ca46069bc2e103a01bd0fbc6bd31788969b47e84316f00f7cf063b0d689c8b612ac5f97f63ea SHA512 c83b1388af4335dea54d8d227a044d9dcfc0389e7cd5204b502bda6c7a961601dfba8f828b1516d3c2576ea190a6384b9766997af1dc7ffa2a98353a26db1437
diff --git a/sci-libs/nlopt/nlopt-2.7.1-r100.ebuild b/sci-libs/nlopt/nlopt-2.7.1-r100.ebuild
new file mode 100644
index 000000000000..55bc5573894b
--- /dev/null
+++ b/sci-libs/nlopt/nlopt-2.7.1-r100.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GUILE_COMPAT=( 2-2 3-0 )
+PYTHON_COMPAT=( python3_{10..12} )
+FORTRAN_NEEDED="test"
+
+inherit python-r1 cmake guile-single 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 ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+IUSE="cxx guile octave python test"
+REQUIRED_USE="guile? ( ${GUILE_REQUIRED_USE} ) python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ guile? ( ${GUILE_DEPS} )
+ octave? ( >=sci-mathematics/octave-6:= )
+ python? (
+ ${PYTHON_DEPS}
+ dev-python/numpy[${PYTHON_USEDEP}]
+ )
+ "
+DEPEND="${RDEPEND}"
+BDEPEND="python? ( dev-lang/swig )"
+
+src_prepare() {
+ cmake_src_prepare
+
+ use guile && guile_bump_sources
+ 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=OFF
+ -DNLOPT_SWIG=$(usex python)
+ -DNLOPT_TESTS=$(usex test)
+ )
+
+ cmake_src_configure
+
+ if use python; then
+ python_configure() {
+ local mycmakeargs=(
+ ${mycmakeargs[@]}
+ -DNLOPT_PYTHON=ON
+ -DINSTALL_PYTHON_DIR="$(python_get_sitedir)"
+ )
+
+ cmake_src_configure
+ }
+
+ python_foreach_impl run_in_build_dir python_configure
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use python; then
+ python_foreach_impl run_in_build_dir 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
+ }
+
+ do_test
+
+ if use python; then
+ python_foreach_impl run_in_build_dir do_test
+ fi
+}
+
+nlopt_install() {
+ cmake_src_install
+ python_optimize
+}
+
+src_install() {
+ cmake_src_install
+
+ guile_unstrip_ccache
+ if use python; then
+ python_foreach_impl run_in_build_dir nlopt_install
+ fi
+
+ local r
+ for r in */README; do
+ newdoc ${r} README.$(dirname ${r})
+ done
+}