unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add lpsolve.
@ 2015-05-16 19:10 Andreas Enge
  2015-05-17 20:12 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Enge @ 2015-05-16 19:10 UTC (permalink / raw)
  To: guix-devel

Hello,

the attached patch adds a dependency of libreoffice with a build system
of its own. Since there is no check target, I have not tried whether the
resulting binary actually works as needed by libreoffice. We will see...

Comments are welcome.

Andreas


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

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index f27903c..5c7fe6d 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1338,3 +1338,57 @@ library with poor performance.")
 library for graphics software based on the OpenGL Shading Language (GLSL)
 specifications.")
     (license license:expat)))
+
+(define-public lpsolve
+  (package
+    (name "lpsolve")
+    (version "5.5.2.0")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
+                          "/lp_solve_" version "_source.tar.gz"))
+      (sha256
+       (base32
+        "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
+      (modules '((guix build utils)))
+      (snippet
+       '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
+          (("^c=cc") "c=gcc")
+          ;; Pretend to be on a 64 bit platform to obtain a common directory
+          ;; name for the build results on all architectures; nothing else
+          ;; seems to depend on it.
+          (("^PLATFORM=.*$") "PLATFORM=ux64\n")))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no check target
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'build
+           (lambda _
+             (with-directory-excursion "lpsolve55"
+               (system* "bash" "ccc"))
+             (with-directory-excursion "lp_solve"
+               (system* "bash" "ccc"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (lib (string-append out "/lib")))
+               (mkdir-p lib)
+               (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
+                          (string-append lib "/liblpsolve55.a"))
+               (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
+                          (string-append lib "/liblpsolve55.so"))
+               (mkdir-p bin)
+               (copy-file "lp_solve/bin/ux64/lp_solve"
+                          (string-append bin "/lp_solve"))
+               #t))))))
+    (home-page "http://lpsolve.sourceforge.net/")
+    (synopsis "Mixed Integer Linear Programming (MILP) solver")
+    (description
+     "lp_solve is a mixed integer linear programming solver based on the
+revised simplex and the branch-and-bound methods.")
+    (license license:lgpl2.1)))
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add lpsolve.
  2015-05-16 19:10 [PATCH] gnu: Add lpsolve Andreas Enge
@ 2015-05-17 20:12 ` Ludovic Courtès
  2015-05-18 11:12   ` Andreas Enge
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2015-05-17 20:12 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Andreas Enge <andreas@enge.fr> skribis:

> * gnu/packages/maths.scm (lpsolve): New variable.

LGTM!

> +    (synopsis "Mixed Integer Linear Programming (MILP) solver")

I’d write it “Mixed integer linear programming (MILP) solver”.

> +    (license license:lgpl2.1)))

LGPLv2.1-only?

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add lpsolve.
  2015-05-17 20:12 ` Ludovic Courtès
@ 2015-05-18 11:12   ` Andreas Enge
  2015-05-18 19:35     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Enge @ 2015-05-18 11:12 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

On Sun, May 17, 2015 at 10:12:52PM +0200, Ludovic Courtès wrote:
> I’d write it “Mixed integer linear programming (MILP) solver”.

Okay.

> > +    (license license:lgpl2.1)))
> LGPLv2.1-only?

Well, I do not quite know where I took this from any more. The distribution
says:
"free (see LGPL for the GNU lesser general public license)"
and refers to LGPL.txt, which is not contained in the tarball, however.
The sourceforge website states
"License GNU Library or Lesser General Public License version 2.0 (LGPLv2)".

By calling it "lesser" and not "library", they must mean 2.1 at least.
As there are no further specifications, I suppose this means 2.1+?

I also realised I forgot to install the header files. There are quite a
few .h files after unpacking the tarball; I will try to track those that
are used by the demo program also included.

Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add lpsolve.
  2015-05-18 11:12   ` Andreas Enge
@ 2015-05-18 19:35     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-05-18 19:35 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Andreas Enge <andreas@enge.fr> skribis:

> On Sun, May 17, 2015 at 10:12:52PM +0200, Ludovic Courtès wrote:

[...]

>> > +    (license license:lgpl2.1)))
>> LGPLv2.1-only?
>
> Well, I do not quite know where I took this from any more. The distribution
> says:
> "free (see LGPL for the GNU lesser general public license)"
> and refers to LGPL.txt, which is not contained in the tarball, however.
> The sourceforge website states
> "License GNU Library or Lesser General Public License version 2.0 (LGPLv2)".
>
> By calling it "lesser" and not "library", they must mean 2.1 at least.
> As there are no further specifications, I suppose this means 2.1+?

I think so, yes.

> I also realised I forgot to install the header files. There are quite a
> few .h files after unpacking the tarball; I will try to track those that
> are used by the demo program also included.

Yeah, these may be useful.  ;-)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-18 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-16 19:10 [PATCH] gnu: Add lpsolve Andreas Enge
2015-05-17 20:12 ` Ludovic Courtès
2015-05-18 11:12   ` Andreas Enge
2015-05-18 19:35     ` Ludovic Courtès

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).