Hello community, here is the log from the commit of package nlopt for openSUSE:Factory checked in at 2018-06-08 23:13:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nlopt (Old) and /work/SRC/openSUSE:Factory/.nlopt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nlopt" Fri Jun 8 23:13:38 2018 rev:11 rq:613774 version:2.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/nlopt/nlopt.changes 2016-08-03 11:44:10.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.nlopt.new/nlopt.changes 2018-06-08 23:13:54.503438119 +0200 @@ -1,0 +2,14 @@ +Sat Jun 2 13:23:21 UTC 2018 - badshah...@gmail.com + +- Add patches to fix compilation against octave 4.4: + * nlopt-octave4.4-prefixdir.patch: Fix how to find octave's + prefix dir in configure.ac: octave-config no longer supports + the keyword PREFIX and uses OCTAVE_HOME in its stead; patch + being sent upstream. Add BuildRequires: libtool and regenerate + build files (autoreconf -fvi) before configuring build. + * nlopt-octave4.4-do_multi_index_op.patch: Replace + do_multi_index_op by feval; the former is dropped from octave + 4.4; patch being sent upstream. +- Package python modules installed to sitelib as well. + +------------------------------------------------------------------- New: ---- nlopt-octave4.4-do_multi_index_op.patch nlopt-octave4.4-prefixdir.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nlopt.spec ++++++ --- /var/tmp/diff_new_pack.8wVR2T/_old 2018-06-08 23:13:55.175413852 +0200 +++ /var/tmp/diff_new_pack.8wVR2T/_new 2018-06-08 23:13:55.179413708 +0200 @@ -1,7 +1,7 @@ # # spec file for package nlopt # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,9 +20,9 @@ Version: 2.4.2 Release: 0 Summary: A library for nonlinear optimization -License: LGPL-2.0 +License: LGPL-2.0-only Group: Development/Libraries/C and C++ -Url: http://ab-initio.mit.edu/wiki/index.php/NLopt +URL: http://ab-initio.mit.edu/wiki/index.php/NLopt Source0: http://ab-initio.mit.edu/nlopt/%{name}-%{version}.tar.gz # PATCH-FIX-UPSTREAM nlopt-2.3-pkgconfig.patch Patch1: nlopt-2.3-pkgconfig.patch @@ -30,13 +30,19 @@ Patch2: pythondir.patch # PATCH-FIX-UPSTREAM nlopt-octave-4.0.patch -- https://github.com/stevengj/nlopt/issues/33 Patch3: nlopt-octave-4.0.patch +# PATCH-FIX-UPSTREAM nlopt-octave4.4-prefixdir.patch badshah...@opensuse.org -- Fix how to find octave's prefix dir in configure.ac: octave-config no longer supports the keyword PREFIX and uses OCTAVE_HOME in its stead; patch being sent upstream +Patch4: nlopt-octave4.4-prefixdir.patch +# PATCH-FIX-UPSTREAM nlopt-octave4.4-do_multi_index_op.patch badshah...@opensuse.org -- Replace do_multi_index_op by feval; the former is dropped from octave 4.4; patch being sent upstream +Patch5: nlopt-octave4.4-do_multi_index_op.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: hdf5-devel BuildRequires: octave-devel BuildRequires: pkgconfig BuildRequires: python-numpy-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-build +## For Patch4 +BuildRequires: libtool +# %description NLopt is a free/open-source library for nonlinear optimization, @@ -94,41 +100,41 @@ %patch1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build +autoreconf -fvi %configure --enable-shared \ --disable-static make %{?_smp_mflags} %install -%makeinstall -find %{buildroot} -name '*.la' -exec rm -f {} ';' +%make_install +find %{buildroot} -type f -name "*.la" -delete -print %fdupes %{buildroot}%{py_sitedir} %post -n lib%{name}0 -p /sbin/ldconfig - %postun -n lib%{name}0 -p /sbin/ldconfig %files -n lib%{name}0 -%defattr(-,root,root,-) %{_libdir}/*.so.* %files devel -%defattr(-,root,root,-) -%doc AUTHORS COPYING NEWS README TODO +%license COPYING +%doc AUTHORS NEWS README TODO %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/%{name}.pc %{_mandir}/man3/%{name}.* %files -n python-%{name} -%defattr(-,root,root,-) -%doc COPYING +%license COPYING %{python_sitearch}/* +%{python_sitelib}/* %files -n octave-nlopt_optimize -%defattr(-,root,root,-) -%doc COPYING +%license COPYING %dir %{_libdir}/octave/*/site %dir %{_libdir}/octave/*/site/oct %dir %{_libdir}/octave/*/site/oct/* ++++++ nlopt-octave4.4-do_multi_index_op.patch ++++++ diff --git a/octave/nlopt_optimize-oct.cc b/octave/nlopt_optimize-oct.cc index 819db4e..9d5b8a4 100644 --- a/octave/nlopt_optimize-oct.cc +++ b/octave/nlopt_optimize-oct.cc @@ -23,6 +23,7 @@ #include <octave/oct.h> #include <octave/oct-map.h> #include <octave/ov.h> +#include <octave/parse.h> #include <math.h> #include <stdio.h> @@ -84,7 +84,12 @@ static double user_function(unsigned n, const double *x, for (unsigned i = 0; i < n; ++i) xm(i) = x[i]; args(0) = xm; - octave_value_list res = data->f->do_multi_index_op(gradient ? 2 : 1, args); + octave_value_list res +#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2) + = octave::feval(data->f, args, gradient ? 2 : 1); +#else + = data->f->do_multi_index_op(gradient ? 2 : 1, args); +#endif if (res.length() < (gradient ? 2 : 1)) gripe_user_supplied_eval("nlopt_optimize"); else if (!res(0).is_real_scalar() @@ -121,7 +126,12 @@ static double user_function1(unsigned n, const double *x, for (unsigned i = 0; i < n; ++i) xm(i) = x[i]; args(0) = xm; - octave_value_list res = f->do_multi_index_op(gradient ? 2 : 1, args); + octave_value_list res +#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2) + = octave::feval(f, args, gradient ? 2 : 1); +#else + = f->do_multi_index_op(gradient ? 2 : 1, args); +#endif if (res.length() < (gradient ? 2 : 1)) gripe_user_supplied_eval("nlopt_optimize"); else if (!res(0).is_real_scalar() ++++++ nlopt-octave4.4-prefixdir.patch ++++++ Index: nlopt-2.4.2/configure.ac =================================================================== --- nlopt-2.4.2.orig/configure.ac +++ nlopt-2.4.2/configure.ac @@ -225,7 +225,7 @@ elif test x"$OCT_INSTALL_DIR" = "x"; the AC_CHECK_PROGS(OCTAVE_CONFIG, octave-config, echo) AC_MSG_CHECKING(octave prefix) - OCTAVE_PREFIX=`$OCTAVE_CONFIG --print PREFIX 2> /dev/null` + OCTAVE_PREFIX=`$OCTAVE_CONFIG --print OCTAVE_HOME 2> /dev/null` AC_MSG_RESULT($OCTAVE_PREFIX) AC_MSG_CHECKING(where octave plugins go)