summaryrefslogtreecommitdiff
path: root/sci-libs/nlopt/files
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/nlopt/files')
-rw-r--r--sci-libs/nlopt/files/nlopt-2.3-as-needed.patch23
-rw-r--r--sci-libs/nlopt/files/nlopt-2.3-pkgconfig.patch10
-rw-r--r--sci-libs/nlopt/files/nlopt-2.4.2-fix-dynamic-underlinking.patch62
-rw-r--r--sci-libs/nlopt/files/nlopt-2.4.2-octave-4-map.patch49
4 files changed, 144 insertions, 0 deletions
diff --git a/sci-libs/nlopt/files/nlopt-2.3-as-needed.patch b/sci-libs/nlopt/files/nlopt-2.3-as-needed.patch
new file mode 100644
index 000000000000..928ec174b771
--- /dev/null
+++ b/sci-libs/nlopt/files/nlopt-2.3-as-needed.patch
@@ -0,0 +1,23 @@
+diff -Nur nlopt-2.3.orig/Makefile.am nlopt-2.3/Makefile.am
+--- nlopt-2.3.orig/Makefile.am 2012-08-03 02:07:09.000000000 +0100
++++ nlopt-2.3/Makefile.am 2012-08-03 02:13:13.000000000 +0100
+@@ -25,6 +25,7 @@
+
+ if WITH_CXX
+ libnlopt@NLOPT_SUFFIX@_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
++libnlopt@NLOPT_SUFFIX@_la_LIBADD += -lstdc++
+ else
+ libnlopt@NLOPT_SUFFIX@_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
+ endif
+diff -Nur nlopt-2.3.orig/swig/Makefile.am nlopt-2.3/swig/Makefile.am
+--- nlopt-2.3.orig/swig/Makefile.am 2012-08-03 02:07:09.000000000 +0100
++++ nlopt-2.3/swig/Makefile.am 2012-08-03 03:04:30.000000000 +0100
+@@ -9,7 +9,7 @@
+ # Guile wrapper
+
+ libnlopt@NLOPT_SUFFIX@_guile_la_SOURCES = nlopt-guile.cpp
+-libnlopt@NLOPT_SUFFIX@_guile_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la
++libnlopt@NLOPT_SUFFIX@_guile_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la @GUILE_LIBS@
+ libnlopt@NLOPT_SUFFIX@_guile_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+ libnlopt@NLOPT_SUFFIX@_guile_la_CPPFLAGS = $(GUILE_CPPFLAGS) -I$(top_builddir)/api
+
diff --git a/sci-libs/nlopt/files/nlopt-2.3-pkgconfig.patch b/sci-libs/nlopt/files/nlopt-2.3-pkgconfig.patch
new file mode 100644
index 000000000000..8a072b15e2e2
--- /dev/null
+++ b/sci-libs/nlopt/files/nlopt-2.3-pkgconfig.patch
@@ -0,0 +1,10 @@
+--- nlopt.pc.in.orig 2012-08-03 01:41:30.000000000 +0100
++++ nlopt.pc.in 2012-08-03 01:42:29.000000000 +0100
+@@ -6,5 +6,6 @@
+ Name: NLopt
+ Description: nonlinear optimization libary
+ Version: @VERSION@
+-Libs: -L${libdir} -lnlopt -lm
++Libs: -L${libdir} -lnlopt@NLOPT_SUFFIX@
++Libs.private: -lm
+ Cflags: -I${includedir}
diff --git a/sci-libs/nlopt/files/nlopt-2.4.2-fix-dynamic-underlinking.patch b/sci-libs/nlopt/files/nlopt-2.4.2-fix-dynamic-underlinking.patch
new file mode 100644
index 000000000000..beb9dd4de815
--- /dev/null
+++ b/sci-libs/nlopt/files/nlopt-2.4.2-fix-dynamic-underlinking.patch
@@ -0,0 +1,62 @@
+Fix underlinking issues, caused by missing -lpython27 and -lpthread
+
+--- nlopt-2.4.2/configure.ac
++++ nlopt-2.4.2/configure.ac
+@@ -161,33 +161,17 @@
+ dnl Python:
+ AM_PATH_PYTHON([],[have_python=yes],[have_python=no])
+ if test $have_python = yes; then
+- AC_ARG_VAR([PYTHON_CONFIG], [python-config program])
+- AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config],
+- [unknown], [`dirname $PYTHON`:$PATH])
+- AC_MSG_CHECKING([for Python include flags])
+- if test "x$PYTHON_CONFIG" = "xunknown"; then
+- pinc=-I`echo "import distutils.sysconfig; print (distutils.sysconfig.get_python_inc())" | $PYTHON - 2>/dev/null`
+- test "x$pinc" = "x-I" && pinc=""
+- else
+- pinc=`$PYTHON_CONFIG --includes 2>/dev/null`
+- fi
+- AC_MSG_RESULT([${pinc:-unknown}])
+- PYTHON_INCLUDES="$pinc"
+- save_CPPFLAGS=$CPPFLAGS
+- CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+- AC_CHECK_HEADER([Python.h], [], [AC_MSG_WARN([disabling Python wrappers])
+- have_python=no])
+- if test $have_python = yes; then
++ PKG_CHECK_MODULES([PYTHON], [python-2.7])
++ CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
++
+ AC_MSG_CHECKING([for Numpy include directory])
+ pinc=`echo "import numpy; print (numpy.get_include())" | $PYTHON - 2>/dev/null`
+ AC_MSG_RESULT([${pinc:-unknown}])
+- test -n "$pinc" && PYTHON_INCLUDES="$PYTHON_INCLUDES -I$pinc"
++ test -n "$pinc" && PYTHON_INCLUDES="$PYTHON_CFLAGS -I$pinc"
+ CPPFLAGS="$save_CPPFLAGS $PYTHON_INCLUDES"
+ AC_CHECK_HEADER([numpy/arrayobject.h],[],[
+ AC_MSG_WARN([disabling Python wrappers])
+ have_python=no],[#include <Python.h>])
+- fi
+- CPPFLAGS=$save_CPPFLAGS
+ fi
+
+ fi # with_python
+--- nlopt-2.4.2/swig/Makefile.am
++++ nlopt-2.4.2/swig/Makefile.am
+@@ -9,7 +9,7 @@
+ # Guile wrapper
+
+ libnlopt@NLOPT_SUFFIX@_guile_la_SOURCES = nlopt-guile.cpp
+-libnlopt@NLOPT_SUFFIX@_guile_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la @GUILE_LIBS@
++libnlopt@NLOPT_SUFFIX@_guile_la_LIBADD = -lpthread ../libnlopt@NLOPT_SUFFIX@.la @GUILE_LIBS@
+ libnlopt@NLOPT_SUFFIX@_guile_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+ libnlopt@NLOPT_SUFFIX@_guile_la_CPPFLAGS = $(GUILE_CPPFLAGS) -I$(top_srcdir)/api
+
+@@ -23,7 +23,7 @@
+ # Python wrapper
+
+ _nlopt_la_SOURCES = nlopt-python.cpp
+-_nlopt_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la
++_nlopt_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la @PYTHON_LIBS@
+ _nlopt_la_LDFLAGS = -module -version-info @SHARED_VERSION_INFO@
+ _nlopt_la_CPPFLAGS = $(PYTHON_INCLUDES) -I$(top_srcdir)/api
+
diff --git a/sci-libs/nlopt/files/nlopt-2.4.2-octave-4-map.patch b/sci-libs/nlopt/files/nlopt-2.4.2-octave-4-map.patch
new file mode 100644
index 000000000000..c82d99497e67
--- /dev/null
+++ b/sci-libs/nlopt/files/nlopt-2.4.2-octave-4-map.patch
@@ -0,0 +1,49 @@
+Fix issues caused by Octave-4 renaming Octave_map to octave_map
+See also
+https://bugs.gentoo.org/show_bug.cgi?id=569996
+https://github.com/stevengj/nlopt/commit/5326ab410c978f9d8c3cae7e4917f55c10ef2c2e?diff=unified
+
+--- nlopt-2.4.2_old/octave/nlopt_optimize-oct.cc 2014-05-20 20:35:58.000000000 +0200
++++ nlopt-2.4.2/octave/nlopt_optimize-oct.cc 2016-01-09 16:10:53.358491776 +0100
+@@ -30,5 +30,5 @@
+ #include "nlopt_optimize_usage.h"
+
+-static int struct_val_default(Octave_map &m, const std::string& k,
++static int struct_val_default(octave_map &m, const std::string& k,
+ int dflt)
+ {
+@@ -40,5 +40,5 @@
+ }
+
+-static double struct_val_default(Octave_map &m, const std::string& k,
++static double struct_val_default(octave_map &m, const std::string& k,
+ double dflt)
+ {
+@@ -50,5 +50,5 @@
+ }
+
+-static Matrix struct_val_default(Octave_map &m, const std::string& k,
++static Matrix struct_val_default(octave_map &m, const std::string& k,
+ Matrix &dflt)
+ {
+@@ -141,5 +141,5 @@
+ #define CHECK1(cond, msg) if (!(cond)) { fprintf(stderr, msg "\n\n"); nlopt_destroy(opt); nlopt_destroy(local_opt); return NULL; }
+
+-nlopt_opt make_opt(Octave_map &opts, int n)
++nlopt_opt make_opt(octave_map &opts, int n)
+ {
+ nlopt_opt opt = NULL, local_opt = NULL;
+@@ -196,5 +196,5 @@
+ && (opts.contents("local_optimizer"))(0).is_map(),
+ "opt.local_optimizer must be a structure");
+- Octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
++ octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
+ CHECK1((local_opt = make_opt(local_opts, n)),
+ "error initializing local optimizer");
+@@ -217,5 +217,5 @@
+
+ CHECK(args(0).is_map(), "opt must be structure")
+- Octave_map opts = args(0).map_value();
++ octave_map opts = args(0).map_value();
+
+ CHECK(args(1).is_real_matrix() || args(1).is_real_scalar(),