summaryrefslogtreecommitdiff
path: root/sci-libs/nlopt/nlopt-2.6.2.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/nlopt/nlopt-2.6.2.ebuild')
-rw-r--r--sci-libs/nlopt/nlopt-2.6.2.ebuild19
1 files changed, 17 insertions, 2 deletions
diff --git a/sci-libs/nlopt/nlopt-2.6.2.ebuild b/sci-libs/nlopt/nlopt-2.6.2.ebuild
index f21aa295b041..21c2ada3624a 100644
--- a/sci-libs/nlopt/nlopt-2.6.2.ebuild
+++ b/sci-libs/nlopt/nlopt-2.6.2.ebuild
@@ -5,11 +5,11 @@ EAPI=7
PYTHON_COMPAT=( python2_7 python3_{6..9} )
-inherit python-r1 cmake
+inherit python-r1 cmake fortran-2
DESCRIPTION="Non-linear optimization library"
HOMEPAGE="https://ab-initio.mit.edu/nlopt/"
-SRC_URI="https://github.com/stevengj/nlopt/archive/v${PV}.tar.gz"
+SRC_URI="https://github.com/stevengj/nlopt/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2.1 MIT"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
@@ -52,6 +52,12 @@ src_configure() {
else
cmake_src_configure
fi
+ if use static-libs; then
+ mycmakeargs+=(
+ -DBUILD_SHARED_LIBS=OFF
+ )
+ BUILD_DIR="${S}_static-libs" run_in_build_dir cmake_src_configure
+ fi
}
src_compile() {
@@ -60,6 +66,9 @@ src_compile() {
else
cmake_src_compile
fi
+ if use static-libs; then
+ BUILD_DIR="${S}_static-libs" run_in_build_dir cmake_src_compile
+ fi
}
src_test() {
@@ -77,6 +86,9 @@ src_test() {
else
do_test
fi
+ if use static-libs; then
+ BUILD_DIR="${S}_static-libs" run_in_build_dir do_test
+ fi
}
nlopt_install() {
@@ -90,6 +102,9 @@ src_install() {
else
cmake_src_install
fi
+ if use static-libs; then
+ BUILD_DIR="${S}_static-libs" run_in_build_dir dolib.a libnlopt.a
+ fi
local r
for r in */README; do newdoc ${r} README.$(dirname ${r}); done
}