gnu: nlopt: Update to 2.7.1.

* gnu/packages/maths.scm (nlopt): Update to 2.7.1.
[source]: Fetch from git.
[build-system]: Use cmake-build-system.
[arguments]: Adjuts 'set-libnlopt-file-name phase.
[inputs]: Replace guile-2.0 with guile-3.0; add octave and python.
[native-inputs]: Add swig.
This commit is contained in:
Ricardo Wurmus 2022-05-28 09:48:15 +02:00
parent 48328055d8
commit 2e2fed31a3
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -5,7 +5,7 @@
;;; Copyright © 2014-2022 Eric Bavier <bavier@posteo.net> ;;; Copyright © 2014-2022 Eric Bavier <bavier@posteo.net>
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch> ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org> ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
;;; Copyright © 20152021 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 20152022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
@ -152,6 +152,7 @@ (define-module (gnu packages maths)
#:use-module (gnu packages serialization) #:use-module (gnu packages serialization)
#:use-module (gnu packages shells) #:use-module (gnu packages shells)
#:use-module (gnu packages sphinx) #:use-module (gnu packages sphinx)
#:use-module (gnu packages swig)
#:use-module (gnu packages tcl) #:use-module (gnu packages tcl)
#:use-module (gnu packages texinfo) #:use-module (gnu packages texinfo)
#:use-module (gnu packages tex) #:use-module (gnu packages tex)
@ -1915,34 +1916,34 @@ (define-public n2p2
(define-public nlopt (define-public nlopt
(package (package
(name "nlopt") (name "nlopt")
(version "2.4.2") (version "2.7.1")
(source (origin (source (origin
(method url-fetch) (method git-fetch)
(uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-" (uri (git-reference
version ".tar.gz")) (url "https://github.com/stevengj/nlopt/")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0")))) (base32 "1xpdza28i8w441fwv6a5f3qk4zi7ys6ws9fx6kr5ny27dfdz6rr1"))))
(build-system gnu-build-system) (build-system cmake-build-system)
(arguments (arguments
`(;; Shared libraries are not built by default. They are required to `(#:phases
;; build the Guile, Octave, and Python bindings.
#:configure-flags '("--enable-shared")
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-before 'configure 'set-libnlopt-file-name (add-before 'configure 'set-libnlopt-file-name
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Make sure the Scheme module refers to the library by its ;; Make sure the Scheme module refers to the library by its
;; absolute file name (we cannot do that from a snippet ;; absolute file name.
;; because the expansion of @libdir@ contains
;; ${exec_prefix}.)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(substitute* "swig/nlopt.scm.in" (substitute* "src/swig/nlopt-guile.i"
(("libnlopt") (("\"nlopt_guile\"")
(string-append out "/lib/libnlopt"))) (format #f "~s"
#t)))))) `(format #f "~anlopt_guile"
(inputs (list guile-2.0)) (if (getenv "NLOPT_UNINSTALLED")
(native-inputs (list pkg-config)) ""
,(format #f "~a/lib/guile/3.0/extensions/" out))))))
(setenv "NLOPT_UNINSTALLED" "1")))))))
(inputs (list guile-3.0 octave python))
(native-inputs (list pkg-config swig))
(home-page "http://ab-initio.mit.edu/wiki/") (home-page "http://ab-initio.mit.edu/wiki/")
(synopsis "Library for nonlinear optimization") (synopsis "Library for nonlinear optimization")
(description "NLopt is a library for nonlinear optimization, providing a (description "NLopt is a library for nonlinear optimization, providing a