| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 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.git")
|
| 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 |
| 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) |
| 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)))
|