gnu: libretro-lowresnx: Update to 1.2.
[jackhill/guix/guix.git] / gnu / packages / java-maths.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages java-maths)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix utils)
25 #:use-module (guix build-system ant)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages gcc)
29 #:use-module (gnu packages java)
30 #:use-module (gnu packages maths)
31 #:use-module (gnu packages ruby))
32
33 (define-public java-jblas
34 (package
35 (name "java-jblas")
36 (version "1.2.4")
37 (source (origin
38 (method git-fetch)
39 (uri (git-reference
40 (url "https://github.com/mikiobraun/jblas")
41 (commit (string-append "jblas-" version))))
42 (file-name (git-file-name name version))
43 (sha256
44 (base32
45 "0afh48hq8i8li5z11x415c8slwsfrlib0w1xjfbg186mximqvv3g"))))
46 (build-system gnu-build-system)
47 (arguments
48 `(#:tests? #f ; there are none
49 #:configure-flags
50 (list (string-append "--libpath="
51 (assoc-ref %build-inputs "openblas")
52 "/lib")
53 "--build-type=openblas")
54 #:phases
55 (modify-phases %standard-phases
56 (add-after 'unpack 'make-writable
57 (lambda _
58 (map make-file-writable
59 (find-files "." ".*"))
60 #t))
61 (add-before 'build 'setenv-JAVA_HOME
62 (lambda* (#:key inputs #:allow-other-keys)
63 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
64 #t))
65 (add-after 'build 'build-jar
66 (lambda* (#:key inputs outputs #:allow-other-keys)
67 (setenv "M2_HOME" (assoc-ref outputs "out"))
68 (invoke "ant" "jar" (string-append "-Dversion=" ,version))))
69 (replace 'install
70 (lambda* (#:key outputs #:allow-other-keys)
71 (let ((target (string-append (assoc-ref outputs "out")
72 "/share/java")))
73 (mkdir-p target)
74 (install-file (string-append "jblas-" ,version ".jar") target))
75 #t)))))
76 (inputs
77 `(("openblas" ,openblas)))
78 (native-inputs
79 `(("ant" ,ant)
80 ("ruby" ,ruby) ; for configure script
81 ("gfortran" ,gfortran)
82 ("jdk" ,icedtea "jdk")))
83 (home-page "http://jblas.org")
84 (synopsis "Linear algebra for Java")
85 (description
86 "jblas is a fast linear algebra library for Java. jblas is based on BLAS
87 and LAPACK, the de-facto industry standard for matrix computations, and uses
88 state-of-the-art implementations for all its computational routines, making
89 jBLAS very fast.")
90 (license license:bsd-3)))