unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#43133] Update Chez to 9.5.4, Add a static output for lz4
@ 2020-08-31 12:07 Brendan Tildesley
  2020-08-31 16:57 ` Martin Becze
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Brendan Tildesley @ 2020-08-31 12:07 UTC (permalink / raw)
  To: 43133

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

I haven't tested it but it seems to work. I wanted to build some of the 
dependent packages against it but i noticed chez-irregex, chez-sockets, 
chez-scmutils are all broken anyway. chez-fmt builds at least.

[-- Attachment #2: 0001-gnu-lz4-Install-static-build-to-static-output.patch --]
[-- Type: text/x-patch, Size: 2535 bytes --]

From c81a0521d44f6dc6fa70b745b4062db2fc89a5b6 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 31 Aug 2020 16:39:02 +1000
Subject: [PATCH 1/3] gnu: lz4: Install static build to "static" output.

* gnu/packages/compression.scm (lz4): Mimic the zlib package by moving
the static build output to a separate "static" output. This allows
programs like chez-scheme to link to the static version.
---
 gnu/packages/compression.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 97f254ff6e..63f398e89d 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -28,6 +28,7 @@
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2020 Lars-Dominik Braun <lars@6xq.net>
+;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -797,6 +798,7 @@ decompression of some loosely related file formats used by Microsoft.")
          "0lpaypmk70ag2ks3kf2dl4ac3ba40n5kc1ainkp9wfjawz76mh61"))
        (file-name (git-file-name name version))))
     (build-system gnu-build-system)
+    (outputs '("out" "static"))
     (native-inputs
      `(;; For tests.
        ("python" ,python)
@@ -814,11 +816,14 @@ decompression of some loosely related file formats used by Microsoft.")
                         (("^test: (.*) test-install" _ targets)
                          (string-append "test: " targets)))
                       #t))
-                  (add-after 'install 'delete-static-library
+                  (add-after 'install 'move-static-library
                     (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((out (assoc-ref outputs "out")))
-                        (delete-file (string-append out "/lib/liblz4.a"))
-                        #t))))))
+                      (let ((out (assoc-ref outputs "out"))
+                            (static (assoc-ref outputs "static")))
+                        (with-directory-excursion (string-append out "/lib")
+                          (install-file "liblz4.a" (string-append static "/lib"))
+                          (delete-file "liblz4.a")
+                          #t)))))))
     (home-page "https://www.lz4.org")
     (synopsis "Compression algorithm focused on speed")
     (description "LZ4 is a lossless compression algorithm, providing
-- 
2.28.0


[-- Attachment #3: 0002-gnu-chez-scheme-Update-to-9.5.4.patch --]
[-- Type: text/x-patch, Size: 4784 bytes --]

From 4e7d52173cee354e5ac0dfedd6f22b95e96ffe86 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 31 Aug 2020 17:26:17 +1000
Subject: [PATCH 2/3] gnu: chez-scheme: Update to 9.5.4.

* gnu/packages/chez.scm
(nanopass): Update to 1.9.1.
(stex): Update to 1.2.2.
(chez-scheme): Update to 9.5.4.
[inputs]: Add newly required lz4 and lz4:static.
[arguments]:
 - Remove unused zlib symbol.
 - Since we are using ZLIB=, it looks like the substitution of libz.a path in
 .c/Mf-... files is no longer needed.
 - add lz4-static symbol and use new LZ4= and ZLIB= configure options to
   point to their static binaries.
---
 gnu/packages/chez.scm | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index da0b17e799..742ab96a82 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
+;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -42,29 +43,29 @@
   #:use-module (srfi srfi-1))
 
 (define nanopass
-  (let ((version "1.9"))
+  (let ((version "1.9.1"))
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nanopass/nanopass-framework-scheme")
             (commit (string-append "v" version))))
-      (sha256 (base32 "0lrngdna6w7v9vlp1a873hgwrwsz2p0pgkccswa4smzvdyhgfsri"))
+      (sha256 (base32 "1synadgaycca39jfx525975ss9y0lkl516sdrc62wrrllamm8n21"))
       (file-name (git-file-name "nanopass" version)))))
 
 (define stex
-  (let ((version "1.2.1"))
+  (let ((version "1.2.2"))
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/dybvig/stex")
             (commit (string-append "v" version))))
-      (sha256 (base32 "1jiawhhqnsj42hzmlbq5xby3iarhf8vhiqs0kg1a0zg5jsn6cf8n"))
+      (sha256 (base32 "1q5i8pf4cdfjsj6r2k1rih7ljbfggyxdng2p2fvsgarzihpsin2i"))
       (file-name (git-file-name "stex" version)))))
 
 (define-public chez-scheme
   (package
     (name "chez-scheme")
-    (version "9.5.2")
+    (version "9.5.4")
     (source
      (origin
        (method git-fetch)
@@ -72,13 +73,15 @@
              (url "https://github.com/cisco/ChezScheme")
              (commit (string-append "v" version))))
        (sha256
-        (base32 "1hagrqdp649n2g0wq2a9gfnz7mjcjakkw7ziplbj3db412bb7kx5"))
+        (base32 "0prgn2z9l888j93ydxaf04ph424g0fi3a8w7f8m0b2r7fr1v7388"))
        (file-name (git-file-name name version))))
     (build-system gnu-build-system)
     (inputs
      `(("ncurses" ,ncurses)
        ("libuuid" ,util-linux "lib")
        ("libx11" ,libx11)
+       ("lz4" ,lz4)
+       ("lz4:static" ,lz4 "static")
        ("xorg-rgb" ,xorg-rgb)
        ("nanopass" ,nanopass)
        ("zlib" ,zlib)
@@ -118,7 +121,7 @@
              (let ((out (assoc-ref outputs "out"))
                    (nanopass (assoc-ref inputs "nanopass"))
                    (stex (assoc-ref inputs "stex"))
-                   (zlib (assoc-ref inputs "zlib"))
+                   (lz4-static (assoc-ref inputs "lz4:static"))
                    (zlib-static (assoc-ref inputs "zlib:static"))
                    (unpack (assoc-ref %standard-phases 'unpack))
                    (patch-source-shebangs
@@ -137,13 +140,6 @@
                ;; and manually patch the needed modules for compilation.
                (substitute* "configure"
                  (("! -f '") "-d '")) ; working around CURL.
-               (substitute* (find-files "./c" "Mf-[a-zA-Z0-9.]+")
-                 (("\\$\\{Kernel\\}: \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a")
-                  "${Kernel}: ${kernelobj}")
-                 (("ld ([-a-zA-Z0-9_${} ]+) \\.\\./zlib/libz\\.a" all args)
-                  (string-append "ld " args " " zlib-static "/lib/libz.a"))
-                 (("\\(cd \\.\\./zlib; ([-a-zA-Z0-9=./ ]+))")
-                  (which "true")))
                (substitute* (find-files "mats" "Mf-.*")
                  (("^[[:space:]]+(cc ) *") "\tgcc "))
                (substitute*
@@ -165,6 +161,8 @@
                (substitute* "stex/Makefile"
                  (("PREFIX=/usr") (string-append "PREFIX=" out)))
                (invoke "./configure" "--threads"
+                       (string-append "ZLIB=" zlib-static "/lib/libz.a")
+                       (string-append "LZ4=" lz4-static "/lib/liblz4.a")
                        (string-append "--installprefix=" out)))))
          ;; Installation of the documentation requires a running "chez".
          (add-after 'install 'install-doc
-- 
2.28.0


[-- Attachment #4: 0003-gnu-chez-scheme-Patch-more-hard-coded-paths.patch --]
[-- Type: text/x-patch, Size: 1331 bytes --]

From 939a1f8185f7e77ff1b809e6cc8de6fbf43b9768 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 31 Aug 2020 21:51:34 +1000
Subject: [PATCH 3/3] gnu: chez-scheme: Patch more hard-coded paths.

* gnu/packages/chez.scm (chez-scheme): Patch out some /bin/rm and
/bin/echo references.
---
 gnu/packages/chez.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 742ab96a82..756c3378bd 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -151,11 +151,14 @@
                                     "|stex\\.stex"
                                     "|newrelease"
                                     "|workarea"
+                                    "|unix\\.ms"
+                                    "|^6\\.ms"
                                     ;;"|[a-zA-Z0-9.]+\\.ms" ; guile can't read
                                     ")"))
                  (("/bin/rm") (which "rm"))
                  (("/bin/ln") (which "ln"))
-                 (("/bin/cp") (which "cp")))
+                 (("/bin/cp") (which "cp"))
+                 (("/bin/echo") (which "echo")))
                (substitute* "makefiles/installsh"
                  (("/bin/true") (which "true")))
                (substitute* "stex/Makefile"
-- 
2.28.0


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

* [bug#43133] Update Chez to 9.5.4, Add a static output for lz4
  2020-08-31 12:07 [bug#43133] Update Chez to 9.5.4, Add a static output for lz4 Brendan Tildesley
@ 2020-08-31 16:57 ` Martin Becze
  2020-11-03 10:55 ` Ludovic Courtès
  2020-12-18 15:09 ` bug#43133: " Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Becze @ 2020-08-31 16:57 UTC (permalink / raw)
  To: Brendan Tildesley, 43133

The broken dependent packages are related to issue #42947 
https://issues.guix.gnu.org/42947https://issues.guix.gnu.org/42947

On 8/31/20 7:07 AM, Brendan Tildesley wrote:
> I haven't tested it but it seems to work. I wanted to build some of the 
> dependent packages against it but i noticed chez-irregex, chez-sockets, 
> chez-scmutils are all broken anyway. chez-fmt builds at least.




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

* [bug#43133] Update Chez to 9.5.4, Add a static output for lz4
  2020-08-31 12:07 [bug#43133] Update Chez to 9.5.4, Add a static output for lz4 Brendan Tildesley
  2020-08-31 16:57 ` Martin Becze
@ 2020-11-03 10:55 ` Ludovic Courtès
  2020-12-18 15:09 ` bug#43133: " Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2020-11-03 10:55 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 43133

Hi Brendan,

Apologies for the long delay; I guess quite a few patches that arrived
during the summer fell through the cracks.  :-/

Brendan Tildesley <mail@brendan.scot> skribis:

> I haven't tested it but it seems to work. I wanted to build some of
> the dependent packages against it but i noticed chez-irregex,
> chez-sockets, chez-scmutils are all broken anyway. chez-fmt builds at
> least.

That should be fixed now as Martin pointed out:

  https://issues.guix.gnu.org/42947

>>From c81a0521d44f6dc6fa70b745b4062db2fc89a5b6 Mon Sep 17 00:00:00 2001
> From: Brendan Tildesley <mail@brendan.scot>
> Date: Mon, 31 Aug 2020 16:39:02 +1000
> Subject: [PATCH 1/3] gnu: lz4: Install static build to "static" output.
>
> * gnu/packages/compression.scm (lz4): Mimic the zlib package by moving
> the static build output to a separate "static" output. This allows
> programs like chez-scheme to link to the static version.

The patch LGTM.  In theory it should go to ‘staging’, I have to check
what the status is.

>>From 4e7d52173cee354e5ac0dfedd6f22b95e96ffe86 Mon Sep 17 00:00:00 2001
> From: Brendan Tildesley <mail@brendan.scot>
> Date: Mon, 31 Aug 2020 17:26:17 +1000
> Subject: [PATCH 2/3] gnu: chez-scheme: Update to 9.5.4.
>
> * gnu/packages/chez.scm
> (nanopass): Update to 1.9.1.
> (stex): Update to 1.2.2.
> (chez-scheme): Update to 9.5.4.
> [inputs]: Add newly required lz4 and lz4:static.
> [arguments]:
>  - Remove unused zlib symbol.
>  - Since we are using ZLIB=, it looks like the substitution of libz.a path in
>  .c/Mf-... files is no longer needed.
>  - add lz4-static symbol and use new LZ4= and ZLIB= configure options to
>    point to their static binaries.

[...]

>                 (substitute* "stex/Makefile"
>                   (("PREFIX=/usr") (string-append "PREFIX=" out)))
>                 (invoke "./configure" "--threads"
> +                       (string-append "ZLIB=" zlib-static "/lib/libz.a")
> +                       (string-append "LZ4=" lz4-static "/lib/liblz4.a")

Why should Chez static-link against those?  In general we should avoid
that as that prevents security update propagation through grafts.  Can
we remove these two lines?

>>From 939a1f8185f7e77ff1b809e6cc8de6fbf43b9768 Mon Sep 17 00:00:00 2001
> From: Brendan Tildesley <mail@brendan.scot>
> Date: Mon, 31 Aug 2020 21:51:34 +1000
> Subject: [PATCH 3/3] gnu: chez-scheme: Patch more hard-coded paths.
>
> * gnu/packages/chez.scm (chez-scheme): Patch out some /bin/rm and
> /bin/echo references.

LGTM.

Thank you!

Ludo’.




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

* bug#43133: Update Chez to 9.5.4, Add a static output for lz4
  2020-08-31 12:07 [bug#43133] Update Chez to 9.5.4, Add a static output for lz4 Brendan Tildesley
  2020-08-31 16:57 ` Martin Becze
  2020-11-03 10:55 ` Ludovic Courtès
@ 2020-12-18 15:09 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2020-12-18 15:09 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 43133-done

Hi Brendan,

Brendan Tildesley <mail@brendan.scot> skribis:

>>From 4e7d52173cee354e5ac0dfedd6f22b95e96ffe86 Mon Sep 17 00:00:00 2001
> From: Brendan Tildesley <mail@brendan.scot>
> Date: Mon, 31 Aug 2020 17:26:17 +1000
> Subject: [PATCH 2/3] gnu: chez-scheme: Update to 9.5.4.
>
> * gnu/packages/chez.scm
> (nanopass): Update to 1.9.1.
> (stex): Update to 1.2.2.
> (chez-scheme): Update to 9.5.4.
> [inputs]: Add newly required lz4 and lz4:static.
> [arguments]:
>  - Remove unused zlib symbol.
>  - Since we are using ZLIB=, it looks like the substitution of libz.a path in
>  .c/Mf-... files is no longer needed.
>  - add lz4-static symbol and use new LZ4= and ZLIB= configure options to
>    point to their static binaries.

[...]

>>From 939a1f8185f7e77ff1b809e6cc8de6fbf43b9768 Mon Sep 17 00:00:00 2001
> From: Brendan Tildesley <mail@brendan.scot>
> Date: Mon, 31 Aug 2020 21:51:34 +1000
> Subject: [PATCH 3/3] gnu: chez-scheme: Patch more hard-coded paths.
>
> * gnu/packages/chez.scm (chez-scheme): Patch out some /bin/rm and
> /bin/echo references.

I went ahead and applied these two patches.

Some of the chez-* packages currently fail due to some TeX Live issue
unfortunately, but at least ‘chez-fmt’ and ‘chez-scmutils’ build fine
with these changes.

It would still be interesting to link dynamically (instead of
statically) against libz and liblz4 as a followup.

Thanks,
Ludo’.




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

end of thread, other threads:[~2020-12-18 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 12:07 [bug#43133] Update Chez to 9.5.4, Add a static output for lz4 Brendan Tildesley
2020-08-31 16:57 ` Martin Becze
2020-11-03 10:55 ` Ludovic Courtès
2020-12-18 15:09 ` bug#43133: " Ludovic Courtès

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).