all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 04/15] gnu: Add chez-sockets.
@ 2016-10-16 15:31 Federico Beffa
  2016-10-17 13:37 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Federico Beffa @ 2016-10-16 15:31 UTC (permalink / raw)
  To: Guix-devel

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



[-- Attachment #2: 0004-gnu-Add-chez-sockets.patch --]
[-- Type: text/x-patch, Size: 4305 bytes --]

From d09667ff264149467b2b69e8a4ef67a1ce9b123c Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Sun, 16 Oct 2016 16:03:07 +0200
Subject: [PATCH 04/15] gnu: Add chez-sockets.

* gnu/packages/chez.scm (chez-sockets): New variable.
---
 gnu/packages/chez.scm | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index d9f6f71..6579b81 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -271,3 +271,79 @@ and 32-bit PowerPC architectures.")
 programming in Scheme, and more particularly, it is implemented in
 Chez Scheme.")
     (license expat)))
+
+(define-public chez-sockets
+  (package
+    (name "chez-sockets")
+    (version "0.0-1.bce9688")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/arcfide/chez-sockets.git")
+             (commit "bce96881c06bd69a6757a6bff139744153924140")))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("chez-scheme" ,chez-scheme)
+       ("chez-web" ,chez-web)
+       ("texlive" ,texlive)))
+    (arguments
+     `(#:tests? #f          ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (chez-web (assoc-ref inputs "chez-web"))
+                    (chez (assoc-ref inputs "chez-scheme"))
+                    (chez-h (dirname (car (find-files chez "scheme\\.h")))))
+               (substitute* "Makefile"
+                 (("(SCHEMEH=).*$" all var)
+                  (string-append var chez-h)))
+               #t)))
+         (add-before 'build 'tangle
+           (lambda _
+             ;; just using "make" tries to build the .c files before
+             ;; they are created.
+             (and (zero? (system* "make" "sockets"))
+                  (zero? (system* "make")))))
+         (replace 'build
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (chez-site (string-append out "/lib/csv"
+                                              ,(package-version chez-scheme)
+                                              "-site/arcfide")))
+               ;; make sure Chez Scheme can find the shared libraries.
+               (substitute* "sockets.ss"
+                 (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\""
+                   all cmd so)
+                  (string-append cmd " \"" chez-site "/" so "\""))
+                 (("sockets-stub\\.[sd][oy].*" all)
+                  (string-append chez-site "/" all)))
+               ;; to compile chez-sockets, the .so files must be
+               ;; installed (because of the absolute path we
+               ;; inserted above).
+               (for-each (lambda (f d) (install-file f d))
+                         '("socket-ffi-values.so" "sockets-stub.so")
+                         (list chez-site chez-site))
+               (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q")))))
+         (replace 'install
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib/chez-sockets"))
+                    (doc (string-append out "/share/doc/" ,name "-" ,version))
+                    (chez-site (string-append out "/lib/csv"
+                                              ,(package-version chez-scheme)
+                                              "-site/arcfide")))
+               (for-each (lambda (f d) (install-file f d))
+                         '("sockets.pdf" "sockets.so")
+                         (list doc chez-site))
+               #t))))))
+    (home-page "https://github.com/arcfide/chez-sockets")
+    (synopsis "Extensible sockets library for Chez Scheme")
+    (description "Chez-sockets is an extensible sockets library for
+Chez Scheme.")
+    (license expat)))
-- 
2.7.4


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

* Re: [PATCH 04/15] gnu: Add chez-sockets.
  2016-10-16 15:31 [PATCH 04/15] gnu: Add chez-sockets Federico Beffa
@ 2016-10-17 13:37 ` Ludovic Courtès
  2016-10-17 16:08   ` Federico Beffa
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2016-10-17 13:37 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> From d09667ff264149467b2b69e8a4ef67a1ce9b123c Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Sun, 16 Oct 2016 16:03:07 +0200
> Subject: [PATCH 04/15] gnu: Add chez-sockets.
>
> * gnu/packages/chez.scm (chez-sockets): New variable.

[...]

> +(define-public chez-sockets
> +  (package
> +    (name "chez-sockets")
> +    (version "0.0-1.bce9688")

Please factorize the commit number (info "(guix) Version Numbers").

> +    (native-inputs
> +     `(("chez-scheme" ,chez-scheme)
> +       ("chez-web" ,chez-web)
> +       ("texlive" ,texlive)))

Can documentation be made available in an on-line format like HTML or
Info?

This would be consistent with what most other packages provide and would
avoid the TeX Live dependency.

The rest LGTM, thanks!

Ludo’.

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

* Re: [PATCH 04/15] gnu: Add chez-sockets.
  2016-10-17 13:37 ` Ludovic Courtès
@ 2016-10-17 16:08   ` Federico Beffa
  0 siblings, 0 replies; 3+ messages in thread
From: Federico Beffa @ 2016-10-17 16:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On Mon, Oct 17, 2016 at 3:37 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>> From d09667ff264149467b2b69e8a4ef67a1ce9b123c Mon Sep 17 00:00:00 2001
>> From: Federico Beffa <beffa@fbengineering.ch>
>> Date: Sun, 16 Oct 2016 16:03:07 +0200
>> Subject: [PATCH 04/15] gnu: Add chez-sockets.
>>
>> * gnu/packages/chez.scm (chez-sockets): New variable.
>
> [...]
>
>> +(define-public chez-sockets
>> +  (package
>> +    (name "chez-sockets")
>> +    (version "0.0-1.bce9688")
>
> Please factorize the commit number (info "(guix) Version Numbers").

OK

>
>> +    (native-inputs
>> +     `(("chez-scheme" ,chez-scheme)
>> +       ("chez-web" ,chez-web)
>> +       ("texlive" ,texlive)))
>
> Can documentation be made available in an on-line format like HTML or
> Info?

No, this library is written in a WEB system based on Chez Scheme and LaTeX.

>
> This would be consistent with what most other packages provide and would
> avoid the TeX Live dependency.
>
> The rest LGTM, thanks!
>
> Ludo’.

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

end of thread, other threads:[~2016-10-17 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-16 15:31 [PATCH 04/15] gnu: Add chez-sockets Federico Beffa
2016-10-17 13:37 ` Ludovic Courtès
2016-10-17 16:08   ` Federico Beffa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.