* [bug#40860] [PATCH] yarnpkg
@ 2020-04-26 2:15 Kozo
2020-04-26 17:42 ` Christopher Baines
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Kozo @ 2020-04-26 2:15 UTC (permalink / raw)
To: 40860
[-- Attachment #1: Type: text/plain, Size: 215 bytes --]
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
[-- Attachment #2: 0001-yarnpkg.patch --]
[-- Type: text/x-patch, Size: 2299 bytes --]
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
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#40860] [PATCH] yarnpkg
2020-04-26 2:15 [bug#40860] [PATCH] yarnpkg Kozo
@ 2020-04-26 17:42 ` Christopher Baines
2020-04-26 18:16 ` Jakub Kądziołka
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Christopher Baines @ 2020-04-26 17:42 UTC (permalink / raw)
To: Kozo; +Cc: 40860
[-- Attachment #1: Type: text/plain, Size: 1979 bytes --]
Kozo <Gitlabcanada@runbox.com> writes:
> 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.
Hi Kozo,
Yarn would indeed be something that would be nice to have a package for.
While I guess that this might work, I think there are issues with the
source here and the lack of dependencies that make this unsuitable for
Guix.
> +(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"))))
The key thing here is source. For many reasons, the packages in Guix
represent software being built from some source material.
What's being downloaded here might look like source material, but I
doubt the ~153,409 line lib/cli.js file is really the preferred form for
editing the Yarn source code.
> + (build-system trivial-build-system)
> + (outputs '("out"))
> + (inputs `(("node" ,node)))
Another sign that something is up is the mismatch between the inputs
here, and the dependencies in the upstream metadata [1]. Assuming the
package works, I'm guessing that there's a lot more than the source of
Yarn within the "source" of this package.
1: https://github.com/yarnpkg/yarn/blob/master/package.json
I'm hopeful that package Yarn will become possible sometime soon, but in
my mind the path forward is to get an importer working for npm, package
the many dependencies, then attempt to package yarn.
Unfortunately I don't think there's a bug that tracks this overall issue
well, although I did find a similar bug about yarn [2]
2: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33431
Does that make sense?
Thanks,
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#40860] [PATCH] yarnpkg
2020-04-26 2:15 [bug#40860] [PATCH] yarnpkg Kozo
2020-04-26 17:42 ` Christopher Baines
@ 2020-04-26 18:16 ` Jakub Kądziołka
2020-04-27 14:10 ` [bug#40860] [PATCH] Yarnpkg Kozo
2020-05-04 19:28 ` [bug#40860] (no subject) Kozo via web
3 siblings, 0 replies; 7+ messages in thread
From: Jakub Kądziołka @ 2020-04-26 18:16 UTC (permalink / raw)
To: Kozo; +Cc: 40860
[-- Attachment #1: Type: text/plain, Size: 2373 bytes --]
On Sat, Apr 25, 2020 at 08:15:56PM -0600, Kozo wrote:
> Subject: [PATCH] yarnpkg
>
> ---
> yarn.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 47 insertions(+)
> create mode 100644 yarn.scm
Please write commit logs in the ChangeLog format [0]. You can check the
commit history for examples.
> (define-module (yarn)
Please put the file in gnu/packages/. Also, add it to the list in
gnu/local.mk.
> #: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))
I can't see where (ice-9 pretty-print) is being used.
> (define yarn-version "1.22.4")
What is the purpose of this single-use variable?
> (define-public yarn
> (package
> (name "yarn")
> (version yarn-version)
> (source (origin
> (method url-fetch/tarbomb)
The file has only a single directory, so why use /tarbomb?
> (uri (string-append "https://github.com/yarnpkg/yarn/releases/download/v"
> version "/yarn-v" version ".tar.gz"))
When looking through this download, it seems that the lib/cli.js file is
a preprocessed mess. Ideally, we would build the package from source.
> (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"))
The indentation is quite confusing here, I'd suggest running
./etc/format-code.el on your file.
> (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.")
I think there are a lot of buzzwords in this description: "fast,
reliable and secure" is not an objective property. Is there something
more neutral that could be said about the package?
Thanks,
Jakub Kądziołka
[0]: https://www.gnu.org/prep/standards/html_node/Change-Logs.html#Change-Logs
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#40860] [PATCH] Yarnpkg
2020-04-26 2:15 [bug#40860] [PATCH] yarnpkg Kozo
2020-04-26 17:42 ` Christopher Baines
2020-04-26 18:16 ` Jakub Kądziołka
@ 2020-04-27 14:10 ` Kozo
2020-04-27 18:28 ` bug#40860: " Björn Höfling
2020-05-04 19:28 ` [bug#40860] (no subject) Kozo via web
3 siblings, 1 reply; 7+ messages in thread
From: Kozo @ 2020-04-27 14:10 UTC (permalink / raw)
To: 40860
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.
Thanks,
Kozo
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#40860] (no subject)
2020-04-26 2:15 [bug#40860] [PATCH] yarnpkg Kozo
` (2 preceding siblings ...)
2020-04-27 14:10 ` [bug#40860] [PATCH] Yarnpkg Kozo
@ 2020-05-04 19:28 ` Kozo via web
2020-05-05 7:08 ` Björn Höfling
3 siblings, 1 reply; 7+ messages in thread
From: Kozo via web @ 2020-05-04 19:28 UTC (permalink / raw)
To: 40860
Greetings,
Thank you for your feedback. This package is too complex for my current experience level.
The current plan of action will be to start getting all the dependencies added in and then come back to this overall package.
Please close this request and we'll re-visit it in the future.
Thank you,
Kozo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-05-05 7:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-26 2:15 [bug#40860] [PATCH] yarnpkg Kozo
2020-04-26 17:42 ` Christopher Baines
2020-04-26 18:16 ` Jakub Kądziołka
2020-04-27 14:10 ` [bug#40860] [PATCH] Yarnpkg Kozo
2020-04-27 18:28 ` bug#40860: " Björn Höfling
2020-05-04 19:28 ` [bug#40860] (no subject) Kozo via web
2020-05-05 7:08 ` Björn Höfling
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).