summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2010-07-20 19:43:50 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2010-07-20 19:43:50 +0000
commit1c8d9dc42df90baeb491383ca48580ed1fbb7694 (patch)
tree5dcd4515b8003b9f7be202110482735a2b7e5f8c /sci-libs/nlopt
parentVersion bump. Remove old. (diff)
downloadgentoo-2-1c8d9dc42df90baeb491383ca48580ed1fbb7694.tar.gz
gentoo-2-1c8d9dc42df90baeb491383ca48580ed1fbb7694.tar.bz2
gentoo-2-1c8d9dc42df90baeb491383ca48580ed1fbb7694.zip
Version bump. Adds python and guile bindings as well as algorithms. Switched to EAPI3, added support for multiple python
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sci-libs/nlopt')
-rw-r--r--sci-libs/nlopt/ChangeLog11
-rw-r--r--sci-libs/nlopt/files/nlopt-1.0.1-qsort.patch11
-rw-r--r--sci-libs/nlopt/metadata.xml4
-rw-r--r--sci-libs/nlopt/nlopt-1.0.1.ebuild41
-rw-r--r--sci-libs/nlopt/nlopt-2.2.ebuild83
5 files changed, 93 insertions, 57 deletions
diff --git a/sci-libs/nlopt/ChangeLog b/sci-libs/nlopt/ChangeLog
index 982a80ce9fb8..d615dd291a0d 100644
--- a/sci-libs/nlopt/ChangeLog
+++ b/sci-libs/nlopt/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sci-libs/nlopt
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/nlopt/ChangeLog,v 1.3 2009/11/24 13:52:00 markusle Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/nlopt/ChangeLog,v 1.4 2010/07/20 19:43:50 bicatali Exp $
+
+*nlopt-2.2 (20 Jul 2010)
+
+ 20 Jul 2010; Sébastien Fabbro <bicatali@gentoo.org> -nlopt-1.0.1.ebuild,
+ -files/nlopt-1.0.1-qsort.patch, +nlopt-2.2.ebuild, metadata.xml:
+ Version bump. Adds python and guile bindings as well as algorithms.
+ Switched to EAPI3, added support for multiple python
24 Nov 2009; Markus Dittrich <markusle@gentoo.org> nlopt-1.2.ebuild:
Added missing configure switch for octave use flag.
diff --git a/sci-libs/nlopt/files/nlopt-1.0.1-qsort.patch b/sci-libs/nlopt/files/nlopt-1.0.1-qsort.patch
deleted file mode 100644
index b5d2e8a7d617..000000000000
--- a/sci-libs/nlopt/files/nlopt-1.0.1-qsort.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- util/qsort_r.c.orig 2009-07-10 20:09:49.000000000 +0100
-+++ util/qsort_r.c 2009-07-10 20:11:41.000000000 +0100
-@@ -65,7 +65,7 @@
- int (*compar)(void *, const void *, const void *))
- {
- #ifdef HAVE_QSORT_R
-- qsort_r(base_, nmemb, size, thunk, compar);
-+#include <stdlib.h>
- #else
- char *base = (char *) base_;
- if (nmemb < 10) { /* use O(nmemb^2) algorithm for small enough nmemb */
diff --git a/sci-libs/nlopt/metadata.xml b/sci-libs/nlopt/metadata.xml
index cfbf29b467f5..c9d2d57542af 100644
--- a/sci-libs/nlopt/metadata.xml
+++ b/sci-libs/nlopt/metadata.xml
@@ -7,15 +7,13 @@
providing a common interface for a number of different free
optimization routines available online as well as original
implementations of various other algorithms. Its features include:
- * Callable from C, C++, Fortran, GNU Octave, and Matlab.
+ * Callable from variety of languages (C, C++, Fortran, Python, Octave,...)
* A common interface for many different algorithms—try a different
algorithm just by changing one parameter.
* Both global and local optimization algorithms.
* Both derivative-free and gradient-based optimization algorithms.
* Algorithms for unconstrained optimization, bound-constrained
optimization, and general nonlinear inequality constraints.
- * Free/open-source software under the GNU LGPL (and looser
- licenses for some portions of NLopt).
</longdescription>
<use>
<flag name='octave'>Add plugin for <pkg>sci-mathematics/octave</pkg></flag>
diff --git a/sci-libs/nlopt/nlopt-1.0.1.ebuild b/sci-libs/nlopt/nlopt-1.0.1.ebuild
deleted file mode 100644
index 2417fe8f98f6..000000000000
--- a/sci-libs/nlopt/nlopt-1.0.1.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/nlopt/nlopt-1.0.1.ebuild,v 1.1 2009/07/10 19:27:20 bicatali Exp $
-
-EAPI=2
-inherit eutils
-
-DESCRIPTION="Non-linear optimization library"
-SRC_URI="http://ab-initio.mit.edu/nlopt/${P}.tar.gz"
-HOMEPAGE="http://ab-initio.mit.edu/nlopt/"
-
-LICENSE="LGPL-2.1 MIT"
-KEYWORDS="~amd64 ~x86"
-
-SLOT="0"
-IUSE="octave cxx"
-
-DEPEND="octave? ( sci-mathematics/octave )"
-RDEPEND="${DEPEND}"
-
-src_prepare() {
- epatch "${FILESDIR}"/${P}-qsort.patch
-}
-
-src_configure() {
- if use octave; then
- export OCT_INSTALL_DIR=/usr/libexec/octave/site/oct/${CHOST}
- export M_INSTALL_DIR=/usr/share/octave/site/m
- else
- export MKOCTFILE=None
- fi
- econf \
- --enable-shared \
- $(use_with cxx)
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die "emake install failed"
- dodoc AUTHORS ChangeLog NEWS README
- for r in */README; do newdoc ${r} README.$(dirname ${r}); done
-}
diff --git a/sci-libs/nlopt/nlopt-2.2.ebuild b/sci-libs/nlopt/nlopt-2.2.ebuild
new file mode 100644
index 000000000000..03523f5d796e
--- /dev/null
+++ b/sci-libs/nlopt/nlopt-2.2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/nlopt/nlopt-2.2.ebuild,v 1.1 2010/07/20 19:43:50 bicatali Exp $
+
+EAPI=3
+SUPPORT_PYTHON_ABIS="1"
+PYTHON_DEPEND="python? *"
+inherit eutils python
+
+DESCRIPTION="Non-linear optimization library"
+HOMEPAGE="http://ab-initio.mit.edu/nlopt/"
+SRC_URI="${HOMEPAGE}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~amd64 ~x86"
+
+SLOT="0"
+IUSE="cxx guile octave python static-libs"
+
+DEPEND="guile? ( dev-scheme/guile )
+ octave? ( sci-mathematics/octave )
+ python? ( dev-python/numpy )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ if use python; then
+ sed -i \
+ -e '/^LTLIBRARIES/s:$(pyexec_LTLIBRARIES)::g' \
+ swig/Makefile.in || die
+ echo '#!/bin/sh' > py-compile
+ fi
+}
+
+src_configure() {
+ if use octave; then
+ export OCT_INSTALL_DIR="${EPREFIX}"/usr/libexec/octave/site/oct/${CHOST}
+ export M_INSTALL_DIR="${EPREFIX}"/usr/share/octave/site/m
+ else
+ export MKOCTFILE=None
+ fi
+ econf \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ $(use_with cxx) \
+ $(use_with guile) \
+ $(use_with octave) \
+ $(use_with python)
+}
+
+src_compile() {
+ default
+ if use python; then
+ python_copy_sources swig
+ compilation() {
+ emake \
+ PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
+ PYTHON_LDFLAGS="$(python_get_library -l)" \
+ PYTHON_SITE_PKG="$(python_get_sitedir)" \
+ PYTHON_VERSION="$(python_get_version)" \
+ pyexecdir="$(python_get_sitedir)" \
+ _nlopt.la
+ }
+ python_execute_function -s --source-dir swig compilation
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ if use python; then
+ installation() {
+ emake \
+ DESTDIR="${D}" \
+ pyexecdir="$(python_get_sitedir)" \
+ pythondir="$(python_get_sitedir)" \
+ install
+ }
+ python_execute_function -s --source-dir swig installation
+ python_clean_installation_image
+ fi
+
+ dodoc AUTHORS ChangeLog NEWS README
+ for r in */README; do newdoc ${r} README.$(dirname ${r}); done
+}