@@ -4522,31 +4522,75 @@ (define-public guile-gsl
(package
(name "guile-gsl")
(version "0.0.1")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/aartaka/guile-gsl")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "00dy33ibvfhzs5xp65g4g8d02wy4fiamjbp3pg87cghg41q4lwkr"))))
- (build-system guile-build-system)
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/aartaka/guile-gsl")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "00dy33ibvfhzs5xp65g4g8d02wy4fiamjbp3pg87cghg41q4lwkr"))))
+ (build-system gnu-build-system)
(arguments
- '(#:source-directory "modules"
- #:phases
- #~(modify-phases %standard-phases
- (add-before 'build 'substitute-gsl-so
- (lambda _
- (let ((gsl (string-append #$(this-package-input "lmdb")
- "/lib/libgsl.so")))
- (substitute* "modules/gsl/core.scm"
- (("libgsl.so") gsl))))))))
+ (list
+ #:modules `(((guix build guile-build-system)
+ #:select (target-guile-effective-version))
+ ,@%gnu-build-system-modules)
+ #:imported-modules `((guix build guile-build-system)
+ ,@%gnu-build-system-modules)
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'build 'substitute-gsl-so
+ (lambda _
+ (let ((gsl (string-append #$(this-package-input "gsl")
+ "/lib/libgsl.so")))
+ (substitute* "modules/gsl/core.scm"
+ (("libgsl.so")
+ gsl)))))
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "CC" "gcc")
+ (setenv "GUILE_AUTO_COMPILE" "0")
+ (invoke "make")
+ (setenv "LD_LIBRARY_PATH" "./")
+ (let* ((module-dir "modules")
+ (prefix (string-length module-dir)))
+ (for-each (lambda (file)
+ (let* ((base (string-drop (string-drop-right
+ file 4)
+ prefix))
+ (go (string-append "go" base
+ ".go")))
+ (invoke "guild"
+ "compile"
+ "-L"
+ module-dir
+ file
+ "-o"
+ go)))
+ (find-files module-dir "\\.scm$")))))
+ (delete 'check) ;no tests
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((lib (string-append #$output "/lib"))
+ (guile #$(this-package-input "guile"))
+ (version (target-guile-effective-version guile))
+ (scm (string-append "/share/guile/site/"
+ version))
+ (go (string-append "/lib/guile/" version
+ "/site-ccache")))
+ (install-file "libguilegslblas.so" lib)
+ (copy-recursively "modules/"
+ (string-append #$output scm))
+ (copy-recursively "go/"
+ (string-append #$output go))))))))
(native-inputs (list guile-3.0))
(inputs (list guile-3.0 gsl))
(home-page "https://github.com/aartaka/guile-gsl")
- (synopsis "Bindings for GNU Scientific library in Guile.")
- (description "This package provides Guile Scheme wrapper for libgsl.so.
+ (synopsis "Bindings for GNU Scientific library in Guile")
+ (description
+ "This package provides Guile Scheme wrapper for @code{libgsl.so}.
Only vector, matrix, and BLAS operations are covered for now.")
(license license:gpl3+))))