unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Roel Janssen <roel@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: Add nlopt.
Date: Tue, 03 May 2016 14:34:55 +0200	[thread overview]
Message-ID: <87bn4n5ngw.fsf@gnu.org> (raw)
In-Reply-To: <87h9efcqid.fsf@gnu.org>


Ludovic Courtès writes:

> Roel Janssen <roel@gnu.org> skribis:
>
>> Ludovic Courtès writes:
>
> [...]
>
>>> Still, according to luksan/COPYRIGHT, “[s]ubroutines PBUN, PNEW, PVAR,
>>> PSEN” are “for your personal use […] [n]ot for redistribution”.
>>>
>>> So my understanding is that we need to remove those four subroutines.
>>> The rest in that directory is LGPLv2.1+.
>>>
>>> WDYT?
>>
>> I agree to your understanding.
>>
>> A little later in the same file I found: "This library (with exception
>> of PBUN, PNEW, PVAR, PSEN) is a free software".
>>
>>> I don’t see it at
>>> <https://libreplanet.org/wiki/List_of_software_that_does_not_respect_the_Free_System_Distribution_Guidelines>.
>>> Debian has a package: <https://packages.debian.org/source/sid/nlopt>.
>>> Could you check if they apply any patches?
>>
>> I haven't found any patches.  So I dug a little deeper and attempted to
>> remove them myself with a patch, but I haven't been able to find these
>> subroutines.
>>
>> I ran the following commands on the root of the source directory:
>> grep -i -r "pbun" .
>> grep -i -r "pmin" .
>> grep -i -r "psen" .
>> grep -i -r "pvar" .
>>
>> And I haven't found the routines.  So I think we're safe.  That could
>> also be why Debian doesn't have a patch for this either.
>
> Indeed.  Actually, luksan/README states:
>
>   [We also did not convert the PMIN, PBUN, PNEW, or PVAR subroutines
>   since these were published in ACM Trans. on Math. Software (TOMS) and
>   are subject to the non-free ACM licensing conditions.]
>
> So indeed, the COPYRIGHT file is confusing, but we’re safe.
>
> Sorry for the false alarm.
>
>>> Besides, I suggest reusing the bits about Guile bindings from the patch
>>> I sent.
>>
>> Shall I prepare a new patch?
>
> Yes please.

I added your magic for Guile.  Here is the patch:

From 6221baadea331cff7e8ab6b9ea1b3bb7737b227f Mon Sep 17 00:00:00 2001
From: Roel Janssen <roel@gnu.org>
Date: Tue, 3 May 2016 14:30:25 +0200
Subject: [PATCH] gnu: Add nlopt.

* gnu/packages/maths.scm (nlopt): New variable.
---
 gnu/packages/maths.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index d37897d..0ad6f4b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -59,6 +59,7 @@
   #:use-module (gnu packages less)
   #:use-module (gnu packages lisp)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages guile)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages m4)
@@ -430,6 +431,41 @@ extremely large and complex data collections.")
     (license (license:x11-style
               "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
 
+(define-public nlopt
+  (package
+    (name "nlopt")
+    (version "2.4.2")
+    (source (origin
+      (method url-fetch)
+      (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
+                          version ".tar.gz"))
+      (sha256
+       (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--enable-shared") ; Also create a shared library.
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'fix-guile-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Make sure the Scheme module refers to the library by its
+             ;; absolute file name (we cannot do that from a snippet
+             ;; because the expansion of @libdir@ contains
+             ;; ${exec_prefix}.)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "swig/nlopt.scm.in"
+                 (("libnlopt")
+                  (string-append out "/lib/libnlopt")))
+               #t))))))
+    (inputs
+     `(("guile" ,guile-2.0)))
+    (home-page "http://ab-initio.mit.edu/wiki/")
+    (synopsis "Library for nonlinear optimization")
+    (description "NLopt is a library for nonlinear optimization, providing a
+common interface for a number of different free optimization routines available
+online as well as original implementations of various other algorithms.")
+    (license license:lgpl2.1+)))
+
 
 ;; For a fully featured Octave, users  are strongly recommended also to install
 ;; the following packages: texinfo, less, ghostscript, gnuplot.
-- 
2.7.4

  reply	other threads:[~2016-05-03 12:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 11:26 [PATCH] gnu: Add nlopt Roel Janssen
2016-04-07 15:44 ` Leo Famulari
2016-04-07 20:42   ` Alex Kost
2016-04-07 20:49   ` Roel Janssen
2016-04-08 10:18     ` Mathieu Lirzin
2016-04-09  5:56       ` Leo Famulari
2016-04-09 10:54         ` Mathieu Lirzin
2016-04-09 16:21           ` Leo Famulari
2016-04-07 20:48 ` Alex Kost
2016-04-07 21:20   ` Roel Janssen
2016-04-07 21:40 ` Ludovic Courtès
2016-04-07 22:52   ` Roel Janssen
2016-04-09 14:38     ` Ludovic Courtès
2016-05-03 11:02       ` Roel Janssen
2016-05-03 11:47         ` Ludovic Courtès
2016-05-03 12:34           ` Roel Janssen [this message]
2016-05-03 20:02             ` Ludovic Courtès
2016-05-03 20:17               ` Roel Janssen
2016-05-04  8:38                 ` Alex Kost
2016-05-04  8:52                   ` Roel Janssen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bn4n5ngw.fsf@gnu.org \
    --to=roel@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).