all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Sockwell via Guix-patches via <guix-patches@gnu.org>
To: 57491@debbugs.gnu.org
Subject: [bug#57491] [PATCH] patch series: Update Raku ecosystem
Date: Tue, 30 Aug 2022 16:49:57 +0000	[thread overview]
Message-ID: <209b7ee5a4550c6de4495ef66584f718@codesections.com> (raw)
In-Reply-To: <b7d3322144715c3f38fe1f99d543ec64@codesections.com>

The third patch in this series updates NQP, the sub-language that
the Raku compiler depends on.

Best,
Daniel

From 924cc46a38b103906d534e9554fca9499315e12c Mon Sep 17 00:00:00 2001
Message-Id: <924cc46a38b103906d534e9554fca9499315e12c.1661878022.git.daniel@codesections.com>
From: Daniel Sockwell <daniel@codesections.com>
Date: Tue, 30 Aug 2022 12:46:51 -0400
Subject: [PATCH] nqp 2019.03->2022.07

---
 .../nqp.do-not-pull-files-via-git.patch       | 26 +++++++
 gnu/packages/perl6.scm                        | 73 +++++++++----------
 2 files changed, 61 insertions(+), 38 deletions(-)
 create mode 100644 gnu/packages/patches/nqp.do-not-pull-files-via-git.patch

diff --git a/gnu/packages/patches/nqp.do-not-pull-files-via-git.patch b/gnu/packages/patches/nqp.do-not-pull-files-via-git.patch
new file mode 100644
index 0000000000..b99919286f
--- /dev/null
+++ b/gnu/packages/patches/nqp.do-not-pull-files-via-git.patch
@@ -0,0 +1,26 @@
+# Don't fetch nqp-configure from git (Guix supplies it as an input)
+diff --git a/Configure.pl b/Configure.patched.pl
+index ded227d..1fd59c8 100755
+--- a/Configure.pl
++++ b/Configure.patched.pl
+@@ -11,20 +11,6 @@ use File::Spec;
+ use File::Path;
+ use FindBin;
+ 
+-BEGIN {
+-    # Download / Update submodules
+-    my $set_config = !qx{git config nqp.initialized};
+-    if ( !-e '3rdparty/nqp-configure/LICENSE' ) {
+-        my $code = system($^X, 'tools/build/update-submodules.pl', Cwd::cwd(), @ARGV);
+-        exit 1 if $code >> 8 != 0;
+-        $set_config = 1;
+-    }
+-    if ($set_config) {
+-        system("git config submodule.recurse true");
+-        system("git config nqp.initialized 1");
+-    }
+-}
+-
+ use lib ( "$FindBin::Bin/tools/lib",
+     "$FindBin::Bin/3rdparty/nqp-configure/lib", );
+ use NQP::Config qw<system_or_die>;
diff --git a/gnu/packages/perl6.scm b/gnu/packages/perl6.scm
index 086fc9d2e2..5f43cd59aa 100644
--- a/gnu/packages/perl6.scm
+++ b/gnu/packages/perl6.scm
@@ -26,6 +26,7 @@ (define-module (gnu packages perl6)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system rakudo)
+  #:use-module (gnu packages)
   #:use-module (gnu packages bdw-gc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
@@ -126,19 +127,20 @@ (define-public nqp-configure
 (define-public nqp
   (package
     (name "nqp")
-    (version "2019.03")
+    (version "2022.07")
     (source
-      (origin
-        (method url-fetch)
-        (uri (string-append "https://rakudo.perl6.org/downloads/nqp/nqp-"
-                            version ".tar.gz"))
-        (sha256
-         (base32
-          "183zhll13fx416s3hkg4bkvib77kyr857h0nydgrl643fpacxp83"))
-        (modules '((guix build utils)))
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/Raku/nqp/releases/download/2022.07/nqp-"
+             version ".tar.gz"))
+
+       (sha256 (base32 "0s124fl2kjahbhr52n92pw9gv1flr099kmlg04358ak7dl81q22q"))
+       (patches (search-patches "nqp.do-not-pull-files-via-git.patch"))
+       (modules '((guix build utils)))
         (snippet
          '(begin
-            (delete-file-recursively "3rdparty") #t))))
+            (delete-file-recursively "3rdparty")))))
     (build-system perl-build-system)
     (arguments
      '(#:phases
@@ -149,42 +151,37 @@ (define-public nqp
                             "tools/build/gen-js-cross-runner.pl"
                             "tools/build/gen-js-runner.pl"
                             "tools/build/install-js-runner.pl"
-                            "tools/build/install-moar-runner.pl"
-                            "tools/build/gen-moar-runner.pl"
                             "t/nqp/111-spawnprocasync.t"
                             "t/nqp/113-run-command.t")
-               (("/bin/sh") (which "sh")))
-             #t))
-         (add-after 'unpack 'patch-source-date
-           (lambda _
-             (substitute* "tools/build/gen-version.pl"
-               (("gmtime") "gmtime(0)"))
-             #t))
-         (add-after 'unpack 'remove-failing-test
-           ;; One subtest fails for unknown reasons
-           (lambda _
-             (delete-file "t/nqp/019-file-ops.t")
-             #t))
+               (("/bin/sh") (which "sh")))))
          (replace 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out  (assoc-ref outputs "out"))
-                   (moar (assoc-ref inputs "moarvm")))
+             (let ((out        (assoc-ref outputs "out"))
+                   (moar       (assoc-ref inputs "moarvm"))
+                   (nqp-config (assoc-ref inputs "nqp-configure")))
+               (setenv "PERL5LIB" (string-append
+                                   nqp-config "/lib:" (or (getenv "PERL5LIB")
+                                                          "")))
+               ; MoarVM has some M_AST files that NQP expects to share
+               (copy-recursively (string-append moar "/share/nqp/lib")
+                                 (string-append out  "/share/nqp/lib"))
                (invoke "perl" "Configure.pl"
                        "--backends=moar"
                        "--with-moar" (string-append moar "/bin/moar")
                        "--prefix" out)))))))
-    (inputs
-     (list moarvm))
-    (home-page "https://github.com/perl6/nqp")
-    (synopsis "Not Quite Perl")
-    (description "This is \"Not Quite Perl\" -- a lightweight Perl 6-like
-environment for virtual machines.  The key feature of NQP is that it's designed
-to be a very small environment (as compared with, say, perl6 or Rakudo) and is
-focused on being a high-level way to create compilers and libraries for virtual
-machines like MoarVM, the JVM, and others.
-
-Unlike a full-fledged implementation of Perl 6, NQP strives to have as small a
-runtime footprint as it can, while still providing a Perl 6 object model and
+
+    (inputs (list moarvm))
+    (native-inputs (list nqp-configure))
+    (home-page "https://github.com/Raku/nqp")
+    (synopsis "Small programming language built for writing compilers and VMs")
+    (description "NQP is \"Not Quite Perl\", a lightweight Raku-like programming
+language that's designed to provide a high-level way to create compilers and
+libraries for virtual machines.  NQP is used to implement the Rakudo compiler
+and to integrate Rakudo with various virtual machines, including MoarVM and the
+Java Virtual Machine.
+
+Unlike a full-fledged implementation of Raku, NQP strives to have as small a
+runtime footprint as it can while still providing Raku's object model and
 regular expression engine for the virtual machine.")
     (license license:artistic2.0)))
 
-- 
2.37.2




  parent reply	other threads:[~2022-08-30 17:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 16:31 [bug#57491] [PATCH] patch series: Update Raku ecosystem Daniel Sockwell via Guix-patches via
2022-08-30 16:45 ` Daniel Sockwell via Guix-patches via
2022-08-30 16:49 ` Daniel Sockwell via Guix-patches via [this message]
2022-08-30 16:59 ` Daniel Sockwell via Guix-patches via
2022-09-07 16:26 ` Daniel Sockwell via Guix-patches via
2022-09-07 21:56 ` Maxime Devos
2022-09-08  2:18   ` Daniel Sockwell via Guix-patches via
2022-09-08  9:15     ` Maxime Devos

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=209b7ee5a4550c6de4495ef66584f718@codesections.com \
    --to=guix-patches@gnu.org \
    --cc=57491@debbugs.gnu.org \
    --cc=daniel@codesections.com \
    /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 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.