Subject: bug#40860: closed (Re: [bug#40860] [PATCH] Yarnpkg)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 27 Apr 2020 18:29:01 +0000

Your bug report

#40860: [PATCH] yarnpkg

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
40860: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40860
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#40860] [PATCH] Yarnpkg
From: Björn Höfling <[email-masked]>
To: Kozo <[email-masked]>
Cc: [email-masked]
Date: Mon, 27 Apr 2020 20:28:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On Mon, 27 Apr 2020 08:10:28 -0600
Kozo <[email-masked]> wrote:

> Thank you for the feedback, Christopher and Jakub.
> 
> After going over what you said, this package is beyond my current
> experience. It would make sense to start getting all the dependencies
> in one at a time and return to this one later.
> 
> Please go ahead and close this request as I work on the building
> blocks.

Hi Kozo,

you can close issues by appending "-done" to the bug-number as I did.

node/npm is terribly hard because of its "dependency hell". 

Jelle Licht worked on an npm-importer. AFAIK it is not yet part of
Guix. Here is a reference on it I found:

https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00814.html

Björn

Subject: [PATCH] yarnpkg
From: Kozo <[email-masked]>
To: [email-masked]
Date: Sat, 25 Apr 2020 20:15:56 -0600
List-Id: <debbugs-submit.debbugs.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 <[email-masked]>
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

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