(address . guix-patches@gnu.org)
Hello,
This is my first submission. Please let me know how I can improve for
future packages.
I followed the steps in the manual and submitted a Software Heritage
request to pull the source code.
Thank you,
Kozo
From cf6cecd960225bab04cc33041e42d4e0cf4a075c Mon Sep 17 00:00:00 2001
From: Kozodev <gitlabcanada@runbox.com>
Date: Sat, 25 Apr 2020 20:09:34 -0600
Subject: [PATCH] yarnpkg
---
yarn.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 yarn.scm
Toggle diff (55 lines)
diff --git a/yarn.scm b/yarn.scm
new file mode 100644
index 0000000..4a1a57b
--- /dev/null
+++ b/yarn.scm
@@ -0,0 +1,47 @@
+(define-module (yarn)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix build-system trivial)
+ #:use-module (guix licenses)
+ #:use-module (gnu packages node)
+ #:use-module (ice-9 pretty-print))
+
+(define yarn-version "1.22.4")
+
+(define-public yarn
+ (package
+ (name "yarn")
+ (version yarn-version)
+ (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
+ "0n7vhwjz3lyjnavcaw08cqa8gfampqsy5mm3f555cbqb26m1clxw"))))
+ (build-system trivial-build-system)
+ (outputs '("out"))
+ (inputs `(("node" ,node)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder (begin
+ (use-modules (guix build utils))
+ (let* ((out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin"))
+ (lib (string-append out "/lib"))
+ (node-modules (string-append lib "/node_modules"))
+ (yarn (string-append node-modules "/yarn"))
+ (input-dir (string-append
+ (assoc-ref %build-inputs "source") "/yarn-v" ,version)))
+ (mkdir-p yarn)
+ (mkdir-p bin)
+ (copy-recursively (string-append input-dir "/") yarn)
+ (symlink (string-append yarn "/bin/yarn") (string-append bin "/yarn"))
+ (symlink (string-append yarn "/bin/yarnpkg") (string-append bin "/yarnpkg"))
+ (delete-file (string-append yarn "/bin/yarn.cmd"))
+ (delete-file (string-append yarn "/bin/yarnpkg.cmd"))))))
+ (home-page "https://yarnpkg.com/")
+ (synopsis "Dependency management tool for JavaScript")
+ (description "Fast, reliable, and secure dependency management tool
+for JavaScript. Acts as a drop-in replacement for NodeJS's npm.")
+ (license bsd-2)))
--
2.26.2