From patchwork Wed May 14 10:33:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Khodabakhsh X-Patchwork-Id: 42592 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B3BDB27BC4B; Wed, 14 May 2025 11:34:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 60E2A27BC4A for ; Wed, 14 May 2025 11:34:27 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uF9RA-0004nk-EI; Wed, 14 May 2025 06:34:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uF9R4-0004nU-S2 for guix-patches@gnu.org; Wed, 14 May 2025 06:34:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uF9R4-0004Ts-C2 for guix-patches@gnu.org; Wed, 14 May 2025 06:34:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:Mime-Version:From:To:In-Reply-To:References:Subject; bh=PagbFKlaHGN2sf1cd92J74uwZ84lr81xR2FZlfn91CE=; b=kal5r9G599qml0SoeixGtB5XvuMy9i4+Z7cVhzQMy1Yr6ryzeHhPcx98lTog0GePHlaF1JFAazDvbQO6dzCRxmfOLlqcvQzPcPkFWEoGht+QguNy2+OH362BAxFX/DMSzydPrxTZ97TxDT0K8lae/0VCPwLOUTbuK3CF4sQnC5TBWLZNJWvIoFsHs+N0aiZacD4RLalLmHRzqybfc3RjnI8TBClstdASftfANPeNFkUI71umMIfHSYqvd0ARZqTvaS8tyZ6MjYF6LQmM2r2lsHD3uKafwXOyPaqYaY79/mMFEUMoIPjncBOqSbd34QML05DGoLCtDY3xL9U3V1A4Jw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uF9R4-0001ix-5l for guix-patches@gnu.org; Wed, 14 May 2025 06:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78183] [PATCH 1/1] gnu: node-esbuild: Replace esbuild-node with node-esbuild References: In-Reply-To: Resent-From: "Dan Khodabakhsh" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 May 2025 10:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78183 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "78183" <78183@debbugs.gnu.org> Received: via spool by 78183-submit@debbugs.gnu.org id=B78183.17472188256510 (code B ref 78183); Wed, 14 May 2025 10:34:02 +0000 Received: (at 78183) by debbugs.gnu.org; 14 May 2025 10:33:45 +0000 Received: from localhost ([127.0.0.1]:40045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uF9Qm-0001gr-PG for submit@debbugs.gnu.org; Wed, 14 May 2025 06:33:45 -0400 Received: from out162-62-58-216.mail.qq.com ([162.62.58.216]:35727) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uF9Qg-0001fd-4K for 78183@debbugs.gnu.org; Wed, 14 May 2025 06:33:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niel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zdBWRaPmfzxF1FRMjWGpOGKWcmYWt+Xvig2D4xyCXJY9fgQAS3TCof7roRz1+nPuUIJEpA CfyGx8yDWr/x2wPkJvgp29rlhgiSgYltzNXq7zgXIvfjUXZNGnr0qupsngiC5QcPaMV++iMTfC+3k kskfiarTIwmmfc0i24YtX64TqvFZREsvvdtd4NEuAydDVSwI//kvRJkDy2CELgCjvwmsPuCF3FrL3 l9dOckSXuqcFqu8T5ZIiZujSJqleQ= From: "Dan Khodabakhsh" Mime-Version: 1.0 Date: Wed, 14 May 2025 10:33:26 +0000 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x X-QQ-mid: xmsezc29-1t1747218806tpdkjdwxo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Had some additional minor fixes to the patch: This change replaces the esbuild-node package with one named node-esbuild: - node-esbuild conforms to the name of node packages. - Uses (guix build-system node) instead of (guix build-system go) which is more  appropriate because this is a node package. - Uses esbuild as an input to use its binary so that it isn't rebuilt. - Does not include the go-lang source by default. - Does not include the lib/node_modules/esbuild/bin/esbuild shim javascript  file, but instead uses the actual binary. The shim file is supposed to be  replaced as part of the node module build process. Here is the structure of node-esbuild: ├── bin │   └── esbuild -> ../lib/node_modules/esbuild/bin/esbuild ├── etc │   └── ld.so.cache ├── lib │   └── node_modules │       └── esbuild │           ├── bin │           │   └── esbuild <- Actual binary │           ├── lib │           │   ├── main.d.ts │           │   └── main.js │           ├── LICENSE.md │           ├── package.json │           └── README.md └── share     └── doc         └── node-esbuild-0.24.0             └── LICENSE.md Structure of esbuild-node ├── bin │   └── esbuild <- Actual binary ├── etc │   └── ld.so.cache ├── lib │   └── node_modules │       └── esbuild │           ├── bin │           │   └── esbuild <- Javascript file which tries to run /bin/esbuild │           ├── install.js │           ├── lib │           │   ├── main.d.ts │           │   └── main.js │           ├── package.json │           └── README.md ├── share │   └── doc │       └── esbuild-node-0.14.0 │           └── LICENSE.md └── src     └── github.com         └── evanw             └── esbuild                 └── cmd                     └── esbuild                         ├── main.go                         ├── main_other.go                         ├── main_wasm.go                         ├── service.go                         ├── stdio_protocol.go                         └── version.go Structure of the NPM package: ├── bin │   └── esbuild <- Actual binary ├── install.js ├── lib │   ├── main.d.ts │   └── main.js ├── LICENSE.md ├── package.json └── README.md Change-Id: I344cffe77f7065813284ccc434a3508650ba941d Signed-off-by: Daniel Khodabakhsh ---  gnu/packages/cran.scm |  3 +-  gnu/packages/web.scm  | 88 ++++++++++++++++++-------------------------  2 files changed, 39 insertions(+), 52 deletions(-) base-commit: a6b40f7a2f2db3107319d1a5e099b269a462a723 --  2.49.0 diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index 194133777e..d980035fa3 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -40,6 +40,7 @@  ;;; Copyright © 2024 Marco Baggio  ;;; Copyright © 2024, 2025 Spencer King  ;;; Copyright © 2024 Tor-björn Claesson +;;; Copyright © 2025 Daniel Khodabakhsh  ;;;  ;;; This file is part of GNU Guix.  ;;; @@ -6368,7 +6369,7 @@ (define-public r-waiter                         "inst/assets/garcon/garcon.min.js"))))))        (propagated-inputs (list r-htmltools r-r6 r-shiny))        (native-inputs -       (list esbuild-node node-lts r-knitr +       (list node-esbuild node-lts r-knitr               (origin                 (method git-fetch)                 (uri (git-reference diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index b3f998aca9..fbc15c2e35 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -70,6 +70,7 @@  ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>  ;;; Copyright © 2024, 2025 Artyom V. Poptsov  ;;; Copyright © 2025 Raven Hallsby +;;; Copyright © 2025 Daniel Khodabakhsh  ;;;  ;;; This file is part of GNU Guix.  ;;; @@ -104,6 +105,7 @@ (define-module (gnu packages web)    #:use-module (guix build-system gnu)    #:use-module (guix build-system go)    #:use-module (guix build-system meson) +  #:use-module (guix build-system node)    #:use-module (guix build-system perl)    #:use-module (guix build-system pyproject)    #:use-module (guix build-system python) @@ -2187,57 +2189,41 @@ (define-public websockify  directions.")      (license license:lgpl3)))   -;; This is a variant of esbuild that builds and installs the nodejs API. -;; Eventually, this should probably be merged with the esbuild package. -(define-public esbuild-node -  (package -    (inherit esbuild) -    (name "esbuild-node") -    (version "0.14.0") -    (source -     (origin -       (method git-fetch) -       (uri (git-reference -             (url "https://github.com/evanw/esbuild") -             (commit (string-append "v" version)))) -       (file-name (git-file-name name version)) -       (sha256 -        (base32 "09r1xy0kk6c9cpz6q0mxr4why373pwxbm439z2ihq3k1d5kk7x4w")) -       (modules '((guix build utils))) -       (snippet -        ;; Remove prebuilt binaries -        '(delete-file-recursively "lib/npm/exit0")))) -    (arguments -     (list -      #:import-path "github.com/evanw/esbuild/cmd/esbuild" -      #:unpack-path "github.com/evanw/esbuild" -      #:phases -      #~(modify-phases %standard-phases -          (add-after 'build 'build-platform -            (lambda* (#:key unpack-path #:allow-other-keys) -              (with-directory-excursion (string-append "src/" unpack-path) -                ;; Must be writable. -                (for-each make-file-writable (find-files "." ".")) -                (invoke "node" "scripts/esbuild.js" -                        (string-append #$output "/bin/esbuild")) -                (let ((modules (string-append #$output "/lib/node_modules/esbuild"))) -                  (mkdir-p modules) -                  (copy-recursively "npm/esbuild" modules))))) -          (replace 'check -            (lambda* (#:key tests? unpack-path #:allow-other-keys) -              (when tests? -                ;; The "Go Race Detector" is only supported on 64-bit -                ;; platforms, this variable disables it. -                ;; TODO: Causes too many rebuilds, rewrite to limit to x86_64, -                ;; aarch64 and ppc64le. -                #$(if (target-riscv64?) -                      `(setenv "ESBUILD_RACE" "") -                      #~(unless #$(target-64bit?) -                          (setenv "ESBUILD_RACE" ""))) -                (with-directory-excursion (string-append "src/" unpack-path) -                  (invoke "make" "test-go")))))))) -    (native-inputs -     (list go-github-com-kylelemons-godebug node-lts)))) +(define-public node-esbuild +  (package +    (name "node-esbuild") +    (version (package-version esbuild)) +    (source +      (origin +        (inherit (package-source esbuild)) +        (file-name (git-file-name name version)) +        (snippet #f) +        (modules '()))) +    (build-system node-build-system) +    (inputs (list esbuild)) +    (arguments (list +      #:tests? #f +      #:phases #~(modify-phases %standard-phases +        (add-after 'unpack 'chdir (lambda _ +          (chdir "npm/esbuild"))) +        (replace 'build (lambda* (#:key inputs #:allow-other-keys) +          (let +            ((esbuild-bin +              (string-append (assoc-ref inputs "esbuild") "/bin/esbuild"))) +            (invoke +              "node" +              "../../scripts/esbuild.js" +              esbuild-bin +              "--neutral") +            (modify-json +              (delete-fields '("optionalDependencies" "scripts"))) +            (delete-file "install.js") +            (delete-file "package-lock.json") +            (copy-file esbuild-bin "bin/esbuild"))))))) +    (home-page (package-home-page esbuild)) +    (synopsis "Node module of ESBuild") +    (description (package-description esbuild)) +    (license (package-license esbuild))))    (define-public wwwoffle    (package