From 5bdf1c9103794b7db85b4208026db51292e42ebc Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Wed, 9 Oct 2024 17:46:34 +0200 Subject: nongnu: Add yarn. * nongnu/packages/node.scm: New file. Signed-off-by: Hilton Chain Modified-by: Hilton Chain --- nongnu/packages/node.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 nongnu/packages/node.scm (limited to 'nongnu/packages/node.scm') diff --git a/nongnu/packages/node.scm b/nongnu/packages/node.scm new file mode 100644 index 0000000..876e65b --- /dev/null +++ b/nongnu/packages/node.scm @@ -0,0 +1,60 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2024 Giacomo Leidi + +(define-module (nongnu packages node) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages node) + #:use-module (guix build-system copy) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module ((guix licenses) :prefix license:)) + +(define-public yarn + (package + (name "yarn") + (version "1.22.22") + (source (origin + (method url-fetch/tarbomb) + (uri (string-append "https://github.com/yarnpkg/yarn/releases/download/v" + version + "/yarn-v" + version + ".tar.gz")) + + (sha256 + (base32 + "181nvynhhrbga3c209v8cd9psk6lqjkc1s9wyzy125lx35j889l8")))) + (build-system copy-build-system) + (inputs (list coreutils bash-minimal node-lts sed)) + (arguments + (list #:install-plan + #~`((,(string-append "yarn-v" #$version "/bin") "bin") + (,(string-append "yarn-v" #$version "/lib") "lib") + (,(string-append "yarn-v" #$version "/package.json") + "lib/package.json")) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'delete-powershell-entrypoints + (lambda _ + (delete-file (string-append #$output "/bin/yarn.cmd")) + (delete-file (string-append #$output "/bin/yarnpkg.cmd")))) + (add-after 'delete-powershell-entrypoints 'wrap-entrypoints + (lambda _ + (for-each + (lambda (entrypoint) + (wrap-program (string-append #$output "/bin/" entrypoint) + `("PATH" = (,(string-append + #$output "/bin:" + #$(this-package-input "bash-minimal") "/bin:" + #$(this-package-input "coreutils") "/bin:" + #$(this-package-input "sed") "/bin:" + #$(this-package-input "node") "/bin"))))) + '("yarn" "yarnpkg"))))))) + (home-page "https://yarnpkg.com/") + (synopsis "Dependency management tool for JavaScript") + (description + "Yarn is a dependency management tool for JavaScript. It acts as a +drop-in replacement for @code{node}'s @command{npm}.") + (license license:bsd-2))) -- cgit v1.2.3