From: Efraim Flashner <efraim@flashner.co.il>
To: Timothy Sample <samplet@ngyro.com>
Cc: Jelle Licht <jlicht@fsfe.org>, 47282@debbugs.gnu.org
Subject: [bug#47282] [PATCH v2 13/13] gnu: Add node-lts.
Date: Tue, 30 Mar 2021 10:04:08 +0300 [thread overview]
Message-ID: <YGLNaOXpQrJL3v8M@3900XT> (raw)
In-Reply-To: <20210330052743.575-13-samplet@ngyro.com>
[-- Attachment #1: Type: text/plain, Size: 8701 bytes --]
On Tue, Mar 30, 2021 at 01:27:43AM -0400, Timothy Sample wrote:
> From: Jelle Licht <jlicht@fsfe.org>
>
> * gnu/packages/node.scm (node-lts): New variable.
> * guix/build-system/node.scm (default-node): Use it.
> ---
> gnu/packages/node.scm | 135 +++++++++++++++++++++++++++++++++++++
> guix/build-system/node.scm | 2 +-
> 2 files changed, 136 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
> index 45e5f8feca..249241f110 100644
> --- a/gnu/packages/node.scm
> +++ b/gnu/packages/node.scm
> @@ -580,6 +580,141 @@ parser definition into a C output.")
> source files.")
> (license license:expat)))
>
> +(define-public node-lts
> + (package
> + (inherit node)
> + (version "14.16.0")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append "https://nodejs.org/dist/v" version
> + "/node-v" version ".tar.xz"))
> + (sha256
> + (base32
> + "19nz2mhmn6ikahxqyna1dn25pb5v3z9vsz9zb2flb6zp2yk4hxjf"))
> + (modules '((guix build utils)))
> + (snippet
> + `(begin
> + ;; Remove bundled software, where possible
> + (for-each delete-file-recursively
> + '("deps/cares"
> + "deps/icu-small"
> + "deps/nghttp2"
> + "deps/openssl"
> + "deps/zlib"))
> + (substitute* "Makefile"
> + ;; Remove references to bundled software.
> + (("deps/uv/uv.gyp") "")
> + (("deps/zlib/zlib.gyp") ""))
> + #t))))
> + (arguments
> + (substitute-keyword-arguments (package-arguments node)
> + ((#:configure-flags configure-flags)
> + ''("--shared-cares"
> + "--shared-libuv"
> + "--shared-nghttp2"
> + "--shared-openssl"
> + "--shared-zlib"
> + "--shared-brotli"
> + "--with-intl=system-icu"))
> + ((#:phases phases)
> + `(modify-phases ,phases
> + (replace 'configure
> + ;; Node's configure script is actually a python script, so we can't
> + ;; run it with bash.
> + (lambda* (#:key outputs (configure-flags '()) inputs
> + #:allow-other-keys)
> + (let* ((prefix (assoc-ref outputs "out"))
> + (flags (cons (string-append "--prefix=" prefix)
> + configure-flags)))
> + (format #t "build directory: ~s~%" (getcwd))
> + (format #t "configure flags: ~s~%" flags)
> + ;; Node's configure script expects the CC environment variable to
> + ;; be set.
> + (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
again cc-for-target
> + (apply invoke
> + (string-append (assoc-ref inputs "python")
> + "/bin/python3")
> + "configure" flags))))
> + (replace 'patch-files
> + (lambda* (#:key inputs #:allow-other-keys)
> + ;; Fix hardcoded /bin/sh references.
> + (substitute* '("lib/child_process.js"
> + "lib/internal/v8_prof_polyfill.js"
> + "test/parallel/test-child-process-spawnsync-shell.js"
> + "test/parallel/test-fs-write-sigxfsz.js"
> + "test/parallel/test-stdio-closed.js"
> + "test/sequential/test-child-process-emfile.js")
> + (("'/bin/sh'")
> + (string-append "'" (which "sh") "'")))
> +
> + ;; Fix hardcoded /usr/bin/env references.
> + (substitute* '("test/parallel/test-child-process-default-options.js"
> + "test/parallel/test-child-process-env.js"
> + "test/parallel/test-child-process-exec-env.js")
> + (("'/usr/bin/env'")
> + (string-append "'" (which "env") "'")))
> +
> + ;; FIXME: These tests fail in the build container, but they don't
> + ;; seem to be indicative of real problems in practice.
> + (for-each delete-file
> + '("test/parallel/test-cluster-master-error.js"
> + "test/parallel/test-cluster-master-kill.js"))
> +
> + ;; These require a DNS resolver.
> + (for-each delete-file
> + '("test/parallel/test-dns.js"
> + "test/parallel/test-dns-lookupService-promises.js"))
> +
> + ;; FIXME: This test fails randomly:
> + ;; https://github.com/nodejs/node/issues/31213
> + (delete-file "test/parallel/test-net-listen-after-destroying-stdin.js")
> +
> + ;; FIXME: These tests fail on armhf-linux:
> + ;; https://github.com/nodejs/node/issues/31970
> + ,@(if (string-prefix? "arm" (%current-system))
This could probably be changed to ,@(when (target-arm32?)
> + '((for-each delete-file
> + '("test/parallel/test-zlib.js"
> + "test/parallel/test-zlib-brotli.js"
> + "test/parallel/test-zlib-brotli-flush.js"
> + "test/parallel/test-zlib-brotli-from-brotli.js"
> + "test/parallel/test-zlib-brotli-from-string.js"
> + "test/parallel/test-zlib-convenience-methods.js"
> + "test/parallel/test-zlib-random-byte-pipes.js"
> + "test/parallel/test-zlib-write-after-flush.js")))
> + '())
> +
> + ;; These tests have an expiry date: they depend on the validity of
> + ;; TLS certificates that are bundled with the source. We want this
> + ;; package to be reproducible forever, so remove those.
> + ;; TODO: Regenerate certs instead.
> + (for-each delete-file
> + '("test/parallel/test-tls-passphrase.js"
> + "test/parallel/test-tls-server-verify.js"))
> +
> + ;; Replace pre-generated llhttp sources
> + (let ((llhttp (assoc-ref inputs "llhttp")))
> + (copy-file (string-append llhttp "/src/llhttp.c")
> + "deps/llhttp/src/llhttp.c")
> + (copy-file (string-append llhttp "/src/api.c")
> + "deps/llhttp/src/api.c")
> + (copy-file (string-append llhttp "/src/http.c")
> + "deps/llhttp/src/http.c")
> + (copy-file (string-append llhttp "/include/llhttp.h")
> + "deps/llhttp/include/llhttp.h"))
> + #t))))))
> + (inputs
> + `(("c-ares" ,c-ares)
> + ("icu4c" ,icu4c-67)
> + ("libuv" ,libuv-for-node)
> + ("llhttp" ,llhttp-bootstrap)
> + ("google-brotli" ,google-brotli)
> + ("nghttp2" ,nghttp2 "lib")
> + ("openssl" ,openssl)
> + ("zlib" ,zlib)))
> + (native-inputs
> + (alist-replace "python" (list python-3)
> + (package-native-inputs node)))))
> +
> (define-public libnode
> (package/inherit node
> (name "libnode")
> diff --git a/guix/build-system/node.scm b/guix/build-system/node.scm
> index 4991ed53a5..98f63f87ef 100644
> --- a/guix/build-system/node.scm
> +++ b/guix/build-system/node.scm
> @@ -39,7 +39,7 @@
> "Return the default Node package."
> ;; Lazily resolve the binding to avoid a circular dependency.
> (let ((node (resolve-interface '(gnu packages node))))
> - (module-ref node 'node)))
> + (module-ref node 'node-lts)))
>
> (define* (lower name
> #:key source inputs native-inputs outputs system target
> --
> 2.31.0
>
>
>
>
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-03-30 7:05 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-20 14:57 [bug#47282] [PATCH 00/13] node going forward Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 01/13] build-system: Rewrite node build system Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 02/13] gnu: Add libuv-node Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 03/13] gnu: node: Use license prefix Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 04/13] gnu: node: Add node-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 05/13] gnu: node: Add node-semver-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 06/13] gnu: node: Add node-ms-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 07/13] gnu: node: Add node-binary-search-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 08/13] gnu: node: Add node-debug-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 09/13] gnu: node: Add node-llparse-builder-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 10/13] gnu: node: Add node-llparse-frontend-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 11/13] gnu: node: Add node-llparse-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 12/13] gnu: node: Add llhttp-bootstrap Jelle Licht
2021-03-20 14:59 ` [bug#47282] [PATCH 13/13] gnu: node: Add node-lts Jelle Licht
2021-03-23 9:05 ` [bug#47282] [PATCH 00/13] node going forward Lars-Dominik Braun
2021-03-25 15:51 ` Léo Le Bouter via Guix-patches via
2021-03-25 16:14 ` Lars-Dominik Braun
2021-03-30 5:24 ` Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 01/13] build-system: Rewrite node build system Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 02/13] gnu: Add libuv-for-node Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 03/13] gnu: node: Use license prefix Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 04/13] gnu: Add node-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 05/13] gnu: Add node-semver-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 06/13] gnu: Add node-ms-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 07/13] gnu: Add node-binary-search-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 08/13] gnu: Add node-debug-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 09/13] gnu: Add node-llparse-builder-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 10/13] gnu: Add node-llparse-frontend-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 11/13] gnu: Add node-llparse-bootstrap Timothy Sample
2021-03-30 5:27 ` [bug#47282] [PATCH v2 12/13] gnu: Add llhttp-bootstrap Timothy Sample
2021-03-30 6:59 ` Efraim Flashner
2021-04-02 13:17 ` Jelle Licht
2021-03-30 5:27 ` [bug#47282] [PATCH v2 13/13] gnu: Add node-lts Timothy Sample
2021-03-30 7:04 ` Efraim Flashner [this message]
2021-04-02 13:20 ` Jelle Licht
2021-04-02 16:18 ` bug#47282: [PATCH 00/13] node going forward Jelle Licht
2021-04-03 1:19 ` [bug#47282] " Timothy Sample
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=YGLNaOXpQrJL3v8M@3900XT \
--to=efraim@flashner.co.il \
--cc=47282@debbugs.gnu.org \
--cc=jlicht@fsfe.org \
--cc=samplet@ngyro.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 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).