From patchwork Mon Nov 19 13:57:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrea Frigido X-Patchwork-Id: 230 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BCE2A167ED; Mon, 19 Nov 2018 16:20:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 3657F167E8 for ; Mon, 19 Nov 2018 16:20:15 +0000 (GMT) Received: from localhost ([::1]:57519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOmHW-0000ey-Cp for patchwork@mira.cbaines.net; Mon, 19 Nov 2018 11:20:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOlWy-00047C-Jl for guix-patches@gnu.org; Mon, 19 Nov 2018 10:32:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOlWu-0006TF-6b for guix-patches@gnu.org; Mon, 19 Nov 2018 10:32:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:56793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOlWu-0006T4-38 for guix-patches@gnu.org; Mon, 19 Nov 2018 10:32:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gOlWt-0000S7-IJ for guix-patches@gnu.org; Mon, 19 Nov 2018 10:32:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33431] [PATCH] gnu: Add yarn Resent-From: Andrea Frigido Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Nov 2018 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33431 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33431@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15426414871696 (code B ref -1); Mon, 19 Nov 2018 15:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Nov 2018 15:31:27 +0000 Received: from localhost ([127.0.0.1]:32818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOlWJ-0000RI-9s for submit@debbugs.gnu.org; Mon, 19 Nov 2018 10:31:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOk3Q-0006Cx-MY for submit@debbugs.gnu.org; Mon, 19 Nov 2018 08:57:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOk3J-0005sb-9V for submit@debbugs.gnu.org; Mon, 19 Nov 2018 08:57:27 -0500 Received: from lists.gnu.org ([2001:4830:134:3::11]:59589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gOk3I-0005s9-FM for submit@debbugs.gnu.org; Mon, 19 Nov 2018 08:57:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOk3H-0002Cx-9k for guix-patches@gnu.org; Mon, 19 Nov 2018 08:57:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOk3B-0005lF-OE for guix-patches@gnu.org; Mon, 19 Nov 2018 08:57:23 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOk3A-0005jp-Ev for guix-patches@gnu.org; Mon, 19 Nov 2018 08:57:17 -0500 Received: by mail-wr1-f67.google.com with SMTP id e3-v6so32191082wrs.5 for ; Mon, 19 Nov 2018 05:57:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=2ZeLMlDwm3F5+Pq3rqzuMTmRQcTBn1n/fxjJnGATEjQ=; b=k8/TKmPbftb0PfRbVIlUwWVuLVCqLycZk5I5Yb8TETf30/cKTPgLGq00plC6gBHmJZ 5nShYlvP1aTPYM/4QBrpH5z5GOGCSlxBjnIHmLdIoJPT1g5i4IBX4WDWnh+6rgI8qi+u ks7NjELrKQrSuEYVa8v7xl1z7+eOfZYtF1HK235DKszJHTquACz9jbmX2u+d3VM72Dgg j4A3MonIGoblTMvAR2i/AzTwJoy7SYMdqBQT+2NjhB1oPhR5ViJGl84dDUuMzXulOHFN oQSkIvnvZ3YnJcedFpVHFkoNa+RWcGBILdpwJ1kt830etcVGsBYFYRE8Jm7ASvPar7q2 k24g== X-Gm-Message-State: AGRZ1gKkp2eRiQhDZRLKcl141ZOvBqS3+zt/UbrKvMfowrfrXr8BpQYh q/1IY5FrLxLeGFFHuQAImZFqa0WVF/DFvdFeGBcU+9MU X-Google-Smtp-Source: AJdET5ekMyp4IrZTJGNIwKKfZW1AW+0oQy6n/e6jgl7ffmavCmV0YVUT8XEBQxI1k58oMSRrk4c85Z3eEP/VUziDrQM= X-Received: by 2002:adf:9387:: with SMTP id 7-v6mr17801784wrp.269.1542635834192; Mon, 19 Nov 2018 05:57:14 -0800 (PST) MIME-Version: 1.0 From: Andrea Frigido Date: Mon, 19 Nov 2018 13:57:02 +0000 Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Mon, 19 Nov 2018 10:31:25 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-Mailman-Approved-At: Mon, 19 Nov 2018 11:20:07 -0500 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, This patch adds yarn as a Guix package. This is my first patch so I hope this is the correct way of doing it. Inspired by the nix package: https://github.com/NixOS/nixpkgs/blob/b37872d4268164614e3ecef6e1f730d48cf5a90f/pkgs/development/tools/yarn/default.nix#L23 Andrea Frigido --- gnu/packages/yarn.scm | 75 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 gnu/packages/yarn.scm + (home-page "https://yarnpkg.com"))) diff --git a/gnu/packages/yarn.scm b/gnu/packages/yarn.scm new file mode 100644 index 000000000..e48313f7f --- /dev/null +++ b/gnu/packages/yarn.scm @@ -0,0 +1,75 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Andrea Frigido +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages yarn) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (gnu packages node)) + +(define-public yarn + (package + (name "yarn") + (version "1.12.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/yarnpkg/yarn/releases/download/v" + version + "/yarn-v" + version + ".tar.gz")) + (sha256 + (base32 + "1wi47awrcy5kki9qmmia4h3rpsf5k7yvnpmwsbdlnb62krc4pk82")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref %outputs "out")) + (bin (string-append out "/bin")) + (libexec-yarn (string-append out "/libexec/yarn")) + (yarn-js (string-append libexec-yarn "/bin/yarn.js"))) + (mkdir-p bin) + (mkdir-p libexec-yarn) + (copy-recursively "./" libexec-yarn) + (symlink yarn-js (string-append bin "/yarn")) + (symlink yarn-js (string-append bin "/yarnpkg")))))))) + + (inputs `(("node" ,node))) + (synopsis "Fast, reliable, and secure dependency management") + (description + "Yarn is a fast, reliable, and secure dependency management. Fast: Yarn +caches every package it has downloaded, so it never needs to download the +same package again. It also does almost everything concurrently to maximize +resource utilization. This means even faster installs. Reliable: Using a +detailed but concise lockfile format and a deterministic algorithm for install +operations, Yarn is able to guarantee that any installation that works on one +system will work exactly the same on another system. +Secure: Yarn uses checksums to verify the integrity of every installed package +before its code is executed.") + (license license:bsd-2)