From patchwork Thu Jul 11 12:12:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 14569 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 500E7171FC; Thu, 11 Jul 2019 16:14:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 53A80171FA for ; Thu, 11 Jul 2019 16:14:25 +0100 (BST) Received: from localhost ([::1]:42600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlam8-0002v1-FD for patchwork@mira.cbaines.net; Thu, 11 Jul 2019 11:14:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47808) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlals-0002ut-23 for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlalq-00050F-2N for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlalo-0004x8-0U for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlall-0001Va-Vt for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36599] [PATCH] gnu: Add node-semver. Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Jul 2019 15:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36599@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15628580205756 (code B ref -1); Thu, 11 Jul 2019 15:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jul 2019 15:13:40 +0000 Received: from localhost ([127.0.0.1]:38396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlalN-0001Uk-Oe for submit@debbugs.gnu.org; Thu, 11 Jul 2019 11:13:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:46349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlXwe-0002n2-Hn for submit@debbugs.gnu.org; Thu, 11 Jul 2019 08:13:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48761) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlXwd-00067O-8a for guix-patches@gnu.org; Thu, 11 Jul 2019 08:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlXwa-00017D-0Q for guix-patches@gnu.org; Thu, 11 Jul 2019 08:13:03 -0400 Received: from latitanza.investici.org ([2001:888:2000:56::19]:61039) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hlXwZ-00010v-2l for guix-patches@gnu.org; Thu, 11 Jul 2019 08:12:59 -0400 Received: from mx1.investici.org (localhost [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id DF1C41204F7; Thu, 11 Jul 2019 12:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1562847168; bh=J1FKbwTpu6KoMaHGaGzv6s3cP2f7m1BeRoLfmsnmqTI=; h=From:To:Cc:Subject:Date:From; b=I1aw5TBWUWD2+bAgYLcLEUqx/Pd6YGouUjqAoqSjdL+5lfRbI7Kbok6ooXVCtfQTy 4sB3EUYl1Lh4SSIvRohbVaUJDIj0uey4gzZiV6U+PNv4HDOlYoJ7O+9yjApKXEnYbg E698HY87E+PUHRVRHr3HCls3olnkPjVxmmJQ1wxc= Received: from [82.94.249.234] (mx1.investici.org [82.94.249.234]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 949E71204C7; Thu, 11 Jul 2019 12:12:47 +0000 (UTC) From: Giacomo Leidi Date: Thu, 11 Jul 2019 14:12:21 +0200 Message-Id: <20190711121221.16123-1-goodoldpaul@autistici.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Thu, 11 Jul 2019 11:13:36 -0400 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: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Giacomo Leidi Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/node.scm (node-semver): New variable. --- gnu/packages/node.scm | 48 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index fc43fcb04c..2f3fe17334 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Mike Gerwitz ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Marius Bakke +;;; Copyright © 2019 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,10 +24,12 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages node) - #:use-module ((guix licenses) #:select (expat)) + #:use-module ((guix licenses) #:select (expat isc)) #:use-module (guix packages) #:use-module (guix derivations) #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system trivial) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages adns) @@ -184,3 +187,46 @@ devices.") (home-page "https://nodejs.org/") (license expat) (properties '((timeout . 3600))))) ; 1 h + +(define-public node-semver + (package + (name "node-semver") + (version "6.2.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/npm/node-semver.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0lqb0v7frrdr7yvxy8b2yg6rp1jilninzk76qnx5qnswxnr4gj5m")))) + (build-system trivial-build-system) + (propagated-inputs + `(("node" ,node))) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (semver-js "semver.js") + (entry-point (string-append "bin/" semver-js))) + (mkdir-p (string-append out "/bin")) + (setenv "PATH" (string-append (assoc-ref %build-inputs + "node") + "/bin:" (getenv "PATH"))) + (map (lambda (file) + (install-file (string-append source "/" file) out)) + (list semver-js "LICENSE" "package.json" "package-lock.json" "range.bnf")) + (install-file (string-append source "/" entry-point) + (string-append out "/bin")) + (patch-shebang (string-append out "/" entry-point)) + #t)))) + (home-page "https://github.com/npm/node-semver") + (synopsis "Parses semantic versions strings") + (description + "node-semver is a JavaScript implementation of the +@uref{https://semver.org/, SemVer.org} specification.") + (license isc)))