From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5C51C158094 for ; Mon, 18 Jul 2022 20:07:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8DFA9E0E0C; Mon, 18 Jul 2022 20:07:56 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6E2A7E0E0C for ; Mon, 18 Jul 2022 20:07:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 868B0340F13 for ; Mon, 18 Jul 2022 20:07:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0A6F44EC for ; Mon, 18 Jul 2022 20:07:54 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1658174867.61b86bf09b542f6cbbf044876c4a2571b97530c7.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/nlopt/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-libs/nlopt/nlopt-2.7.1-r1.ebuild X-VCS-Directories: sci-libs/nlopt/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 61b86bf09b542f6cbbf044876c4a2571b97530c7 X-VCS-Branch: master Date: Mon, 18 Jul 2022 20:07:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c07db550-4e2e-4850-88b5-96316126ee4e X-Archives-Hash: 7a21d370c0c8edaf0ebd2f2c6d4ecb91 commit: 61b86bf09b542f6cbbf044876c4a2571b97530c7 Author: Sam James gentoo org> AuthorDate: Mon Jul 18 20:07:41 2022 +0000 Commit: Sam James gentoo org> CommitDate: Mon Jul 18 20:07:47 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61b86bf0 sci-libs/nlopt: fix installed Python module location Closes: https://bugs.gentoo.org/859163 Signed-off-by: Sam James gentoo.org> sci-libs/nlopt/nlopt-2.7.1-r1.ebuild | 111 +++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/sci-libs/nlopt/nlopt-2.7.1-r1.ebuild b/sci-libs/nlopt/nlopt-2.7.1-r1.ebuild new file mode 100644 index 000000000000..a7ca0ef31672 --- /dev/null +++ b/sci-libs/nlopt/nlopt-2.7.1-r1.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +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}" +BDEPEND="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=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 + + 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 +}