On Wed, Oct 07, 2020 at 02:31:24AM +0000, Ryan Prior via Guix-patches via wrote: > * gnu/packages/web.scm (esbuild): New variable. > --- > gnu/packages/web.scm | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm > index b798e0abca..1e2f2e7e10 100644 > --- a/gnu/packages/web.scm > +++ b/gnu/packages/web.scm > @@ -1345,6 +1345,34 @@ used to validate and fix HTML data.") > (home-page "http://tidy.sourceforge.net/") > (license (license:x11-style "file:///include/tidy.h")))) > > +(define-public esbuild > + (package > + (name "esbuild") > + (version "0.7.11") > + (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 > + "08lx1i0s1q3my6x4csz746rc3c2fl4p0hyrwx4rpx80gwwjj1i11")))) > + (build-system go-build-system) > + (arguments > + '(#:import-path "github.com/evanw/esbuild/cmd/esbuild" > + #:unpack-path "github.com/evanw/esbuild")) > + (inputs > + `(("go-golang-org-x-sys" ,go-golang-org-x-sys))) > + (home-page "https://github.com/evanw/esbuild") > + (synopsis "Bundler and minifier tool for JavaScript and TypeScript") > + (description > + "The esbuild tool provides a unified bundler, transpiler and > +minifier. It packages up JavaScript and TypeScript code, along with JSON > +and other data, for distribution on the web.") > + (license license:expat))) > + > (define-public tinyproxy > (package > (name "tinyproxy") > -- > 2.17.1 > First pass, I don't see a vendor directory that needs to be deleted, and it does seem to only really depend on go-golang-org-x-sys, which is nice. There is an npm directory which is where the compiled binaries are placed, there are a couple in the checked out repo. diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 1e2f2e7e10..f55f1a02d9 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1358,7 +1358,13 @@ used to validate and fix HTML data.") (file-name (git-file-name name version)) (sha256 (base32 - "08lx1i0s1q3my6x4csz746rc3c2fl4p0hyrwx4rpx80gwwjj1i11")))) + "08lx1i0s1q3my6x4csz746rc3c2fl4p0hyrwx4rpx80gwwjj1i11")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove pre-compiled binaries + (delete-file-recursively "npm") + #t)))) (build-system go-build-system) (arguments '(#:import-path "github.com/evanw/esbuild/cmd/esbuild" `esbuild --help` still works after removing the npm directory. Is it worth trying to run some of the test suite? I see there are a couple of 'make check' type targets in the Makefile at the root of the repository and currently there are none run during the build. -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted