unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Artyom Bologov <mail@aartaka.me>
To: 69443@debbugs.gnu.org
Subject: [bug#69443] [PATCH] gnu: Add guile-gsl.
Date: Wed, 28 Feb 2024 02:56:12 +0400	[thread overview]
Message-ID: <877ciptsq4.fsf@aartaka.me> (raw)

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

Hi y'all,

This is both a patch submission and a call for help—I'm far out of my
waters with this package and am not sure of the proper Guix-y way to
build it.

So the build sequence for Guile GSL is:
(1) Compile a bundled libguilegslblas.so with a C compiler, using the GSL
    libraries from package inputs.
(2) Put proper paths to the GSL libraries and libguilegslblas into the
    Scheme files.
(3) Compile Scheme files as per guile-build-system.

I've got (2) and (3) more or less working. The problem is: which build
system should I use and how do I synthesize GNU build system (makefile,
libguilegslblas.so, (1)) and Guile one?

You can find my draft (doesn't build and is not usable in general) patch
attached below. Any help appreciated!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnu: Add guile-gsl --]
[-- Type: text/x-patch, Size: 2213 bytes --]

From 5bd38a674fff008c189d1c39495d771354c945fb Mon Sep 17 00:00:00 2001
From: Artyom Bologov <mail@aartaka.me>
Date: Wed, 28 Feb 2024 02:54:31 +0400
Subject: [PATCH] gnu: Add guile-gsl.

* gnu/packages/guile-xyz.scm (guile-gsl): New variable.
---
 gnu/packages/guile-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index b34472d5bd..6b9492c4b7 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4474,6 +4474,40 @@ (define-public guile-ffi-cblas
 function: raw, typed, and functional.")
       (license license:lgpl3+))))
 
+(define-public guile-gsl
+  (let ((commit "8540bcb6afa9be37153852255608d26d5a4df9dd")
+        (revision "0"))
+    (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)
+      (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))))))))
+      (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.
+Only vector, matrix, and BLAS operations are covered for now.")
+      (license license:gpl3+))))
+
 (define-public guile-ffi-fftw
   (let ((commit "294ad9e7491dcb40026d2fec9be2af05263be1c0")
         (revision "2"))
-- 
2.41.0


[-- Attachment #3: Type: text/plain, Size: 28 bytes --]


Thanks,
--
Artyom Bologov.

             reply	other threads:[~2024-02-27 23:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 22:56 Artyom Bologov [this message]
2024-03-08 23:29 ` [bug#69443] [PATCH] gnu: guile-gsl: Fix build Artyom V. Poptsov
2024-04-04 11:27 ` bug#69443: [PATCH] gnu: Add guile-gsl Sharlatan Hellseher

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=877ciptsq4.fsf@aartaka.me \
    --to=mail@aartaka.me \
    --cc=69443@debbugs.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).