Package: guix-patches;
Reported by: "d" <d <at> niel.khodabakh.sh>
Date: Thu, 1 May 2025 10:57:01 UTC
Severity: normal
Tags: patch
To reply to this bug, email your comments to 78183 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#78183
; Package guix-patches
.
(Thu, 01 May 2025 10:57:02 GMT) Full text and rfc822 format available."d" <d <at> niel.khodabakh.sh>
:guix-patches <at> gnu.org
.
(Thu, 01 May 2025 10:57:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: "d" <d <at> niel.khodabakh.sh> To: "guix-patches" <guix-patches <at> gnu.org> Subject: [PATCH] gnu: node-esbuild: Replace esbuild-node with node-esbuild Date: Thu, 1 May 2025 07:17:07 +0000
[Message part 1 (text/plain, inline)]
This change replaces the esbuild-node package built with (guix build-system go) with one built via (guix build-system node), making it more compatible with how other Node packages are built and imported. It also uses the actual build scripts from the package itself instead of hacking around it within (guix build-system go). I had difficulty adding node-esbuild in (gnu packages node-xyz) where I originally tried to add it. Kept running into what I suspect is a cyclic dependency issue, where it would complain with 'error: esbuild: unbound variable' when I had the call to (package-source esbuild), but if I ommit that part, there's no issue with esbuild being an (input). The reason I'm making this change is so that I have a node-esbuild Node package that I can use in another package I'm trying to add.
[0001-Replace-esbuild-node-with-node-esbuild.patch (application/octet-stream, attachment)]
guix-patches <at> gnu.org
:bug#78183
; Package guix-patches
.
(Mon, 05 May 2025 07:19:04 GMT) Full text and rfc822 format available.Message #8 received at 78183 <at> debbugs.gnu.org (full text, mbox):
From: "dan" <dan <at> khodabakh.sh> To: "78183" <78183 <at> debbugs.gnu.org> Subject: [PATCH 1/1] gnu: node-esbuild: Replace esbuild-node with node-esbuild. Date: Mon, 5 May 2025 03:35:15 +0000
[Message part 1 (text/plain, inline)]
There were a few other reasons this patch was created, it was a while ago so I had to dig those up, but here they are: - 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 I've added this information to the attached patch now. Cheers, - Daniel Khodabakhsh
[0001-Replace-esbuild-node-with-node-esbuild.patch (application/octet-stream, attachment)]
guix-patches <at> gnu.org
:bug#78183
; Package guix-patches
.
(Mon, 12 May 2025 09:29:02 GMT) Full text and rfc822 format available.Message #11 received at 78183 <at> debbugs.gnu.org (full text, mbox):
From: "Dan Khodabakhsh" <d <at> niel.khodabakh.sh> To: "78183" <78183 <at> debbugs.gnu.org> Subject: [PATCH 1/1] gnu: node-esbuild: Replace esbuild-node with node-esbuild. Date: Mon, 12 May 2025 09:28:02 +0000
[Message part 1 (text/plain, inline)]
Updated the change a bit, removed unneeded (arguments #modules ...): 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 <d <at> niel.khodabakh.sh> --- gnu/packages/cran.scm | 3 +- gnu/packages/web.scm | 88 ++++++++++++++++++------------------------- 2 files changed, 39 insertions(+), 52 deletions(-) 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 <guix <at> mawumag.com> ;;; Copyright © 2024, 2025 Spencer King <spencer.king <at> geneoscopy.com> ;;; Copyright © 2024 Tor-björn Claesson <tclaesson <at> gmail.com> +;;; Copyright © 2025 Daniel Khodabakhsh <d <at> niel.khodabakh.sh> ;;; ;;; 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..fa7b46c08e 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -70,6 +70,7 @@ ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com> ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom <at> gmail.com> ;;; Copyright © 2025 Raven Hallsby <karl <at> hallsby.com> +;;; Copyright © 2025 Daniel Khodabakhsh <d <at> niel.khodabakh.sh> ;;; ;;; 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 `( + #: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 base-commit: a6b40f7a2f2db3107319d1a5e099b269a462a723 -- 2.49.0
[0001-Replace-esbuild-node-with-node-esbuild.patch (application/octet-stream, attachment)]
guix-patches <at> gnu.org
:bug#78183
; Package guix-patches
.
(Wed, 14 May 2025 10:34:02 GMT) Full text and rfc822 format available.Message #14 received at 78183 <at> debbugs.gnu.org (full text, mbox):
From: "Dan Khodabakhsh" <d <at> niel.khodabakh.sh> To: "78183" <78183 <at> debbugs.gnu.org> Subject: [PATCH 1/1] gnu: node-esbuild: Replace esbuild-node with node-esbuild Date: Wed, 14 May 2025 10:33:26 +0000
[Message part 1 (text/plain, inline)]
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 <d <at> niel.khodabakh.sh> --- gnu/packages/cran.scm | 3 +- gnu/packages/web.scm | 88 ++++++++++++++++++------------------------- 2 files changed, 39 insertions(+), 52 deletions(-) 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 <guix <at> mawumag.com> ;;; Copyright © 2024, 2025 Spencer King <spencer.king <at> geneoscopy.com> ;;; Copyright © 2024 Tor-björn Claesson <tclaesson <at> gmail.com> +;;; Copyright © 2025 Daniel Khodabakhsh <d <at> niel.khodabakh.sh> ;;; ;;; 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 <at> qq.com> ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom <at> gmail.com> ;;; Copyright © 2025 Raven Hallsby <karl <at> hallsby.com> +;;; Copyright © 2025 Daniel Khodabakhsh <d <at> niel.khodabakh.sh> ;;; ;;; 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 base-commit: a6b40f7a2f2db3107319d1a5e099b269a462a723 -- 2.49.0
[0001-Replace-esbuild-node-with-node-esbuild.patch (application/octet-stream, attachment)]
guix-patches <at> gnu.org
:bug#78183
; Package guix-patches
.
(Sat, 17 May 2025 06:42:02 GMT) Full text and rfc822 format available.Message #17 received at 78183 <at> debbugs.gnu.org (full text, mbox):
From: "Dan Khodabakhsh" <d <at> niel.khodabakh.sh> To: "78183" <78183 <at> debbugs.gnu.org> Subject: [PATCH 1/1] gnu: node-esbuild: Replace esbuild-node with node-esbuild Date: Sat, 17 May 2025 06:41:03 +0000
[Message part 1 (text/plain, inline)]
One more change, removed the unnecessary deletion of the package-lock.json file, this is done automatically as part of the existing phases. Here is the updated patch: From 616f2714d90d2dce310130c19cfcb506299cc21b Mon Sep 17 00:00:00 2001 Message-ID: <616f2714d90d2dce310130c19cfcb506299cc21b.1747463653.git.d <at> niel.khodabakh.sh> From: Daniel Khodabakhsh <d <at> niel.khodabakh.sh> Date: Wed, 30 Apr 2025 23:45:45 -0700 Subject: gnu: node-esbuild: Replace esbuild-node with node-esbuild. 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 <d <at> niel.khodabakh.sh> --- gnu/packages/cran.scm | 3 +- gnu/packages/web.scm | 87 ++++++++++++++++++------------------------- 2 files changed, 38 insertions(+), 52 deletions(-) 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 <guix <at> mawumag.com> ;;; Copyright © 2024, 2025 Spencer King <spencer.king <at> geneoscopy.com> ;;; Copyright © 2024 Tor-björn Claesson <tclaesson <at> gmail.com> +;;; Copyright © 2025 Daniel Khodabakhsh <d <at> niel.khodabakh.sh> ;;; ;;; 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..4eef020c18 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -70,6 +70,7 @@ ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com> ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom <at> gmail.com> ;;; Copyright © 2025 Raven Hallsby <karl <at> hallsby.com> +;;; Copyright © 2025 Daniel Khodabakhsh <d <at> niel.khodabakh.sh> ;;; ;;; 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,40 @@ (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") + (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 base-commit: a6b40f7a2f2db3107319d1a5e099b269a462a723 -- 2.49.0
[0001-Replace-esbuild-node-with-node-esbuild.patch (application/octet-stream, attachment)]
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.