From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia Subject: Re: NPM importer Date: Sat, 24 Nov 2018 14:42:26 +0100 Message-ID: References: <70F182DB-C157-4763-A4C6-89985545661C@lepiller.eu> <0e5afb2d-c182-6be4-ba2d-6a6f7dd45ac9@riseup.net> <1150DF84-4952-4401-A8D0-3E05A4D0EB74@lepiller.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQY6t-00052Y-7O for guix-devel@gnu.org; Sat, 24 Nov 2018 08:36:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQY6q-00084r-0a for guix-devel@gnu.org; Sat, 24 Nov 2018 08:36:35 -0500 Received: from mx1.riseup.net ([198.252.153.129]:45799) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQY6p-00082k-Lm for guix-devel@gnu.org; Sat, 24 Nov 2018 08:36:31 -0500 In-Reply-To: <1150DF84-4952-4401-A8D0-3E05A4D0EB74@lepiller.eu> Content-Language: en-US List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Julien Lepiller , guix-devel@gnu.org Hi On 2018-11-20 08:50, Julien Lepiller wrote: snip > I'll push what I have to a wip-branch latter today. The reason why I de= velop out-of-tree is because I can always rebase my patches. I don't see it in guix yet. Could you push it? I corrected a bug in node-build-system and added node-underscore. See mangled changes below (mangled by hard-wrap). I will create commit=20 and create 2 patches when I have somewhere to share it: modified gnu/packages/node.scm=20 =20 @@ -22,6 +22,10 @@=20 =20 ;;; You should have received a copy of the GNU General Public License=20 =20 ;;; along with GNU Guix. If not, see .=20 =20 =20 =20 +;; The node-build-system allows two ways to install node:=20 =20 +;; Locally and globally. Default is "local".=20 =20 +;; See=20 https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/=20 =20 +=20 =20 (define-module (gnu packages node)=20 =20 #:use-module ((guix licenses) #:prefix license:)=20 =20 #:use-module (guix packages)=20 =20 @@ -38,6 +42,7 @@=20 =20 #:use-module (gnu packages icu4c)=20 =20 #:use-module (gnu packages libevent)=20 =20 #:use-module (gnu packages linux)=20 =20 + #:use-module (gnu packages lisp)=20 =20 #:use-module (gnu packages perl)=20 =20 #:use-module (gnu packages pkg-config)=20 =20 #:use-module (gnu packages python)=20 =20 @@ -547,3 +552,45 @@ commonjs, browser, AMD, electron, etc.")=20 =20 (home-page=20 =20 "https://github.com/kumavis/browser-stdout")=20 =20 (license license:expat)))=20 =20 +=20 =20 +(define-public node-underscore=20 =20 + (package=20 =20 + (name "node-underscore")=20 =20 + (version "1.9.1")=20 =20 + (source=20 =20 + (origin=20 =20 + (method git-fetch)=20 =20 + (uri (git-reference=20 =20 + (url "https://github.com/jashkenas/underscore")=20 =20 + (commit "ae037f7c41323807ae6f1533c45512e6d31a1574")))=20 =20 + (file-name (string-append name "-" version))=20 =20 + (sha256=20 =20 + (base32=20 =20 + "1f75wrln5kv5ihkbb9zwhyjqd9imwil801abhv36w09dkkabpjy5")))) + (build-system node-build-system)=20 =20 + (native-inputs `(("uglify-js" ,uglify-js)))=20 =20 + (arguments=20 =20 + `(#:tests? #f=20 =20 + ;; FIXME: These test dependencies are missing:=20 =20 + ;; "karma": "^0.13.13",=20 =20 + ;; "karma-qunit": "~2.0.1",=20 =20 + ;; "karma-sauce-launcher": "^1.2.0",=20 =20 + ;; "nyc": "^2.1.3",=20 =20 + ;; "qunit-cli": "~0.2.0",=20 =20 + ;; "qunit": "^2.6.0",=20 =20 + #:phases ;No configure script=20 =20 + (modify-phases %standard-phases=20 =20 + (delete 'configure)=20 =20 + (add-before 'build 'patch-files=20 =20 + (lambda* (#:key inputs #:allow-other-keys)=20 =20 + ;; Fix wrong path to uglify-js=20 =20 + (substitute* "package.json"=20 =20 + (("uglifyjs") "uglify-js")))))))=20 =20 + (synopsis=20 =20 + "JavaScript's functional programming helper library.")=20 =20 + (description=20 =20 + "Underscore.js is a utility-belt library for JavaScript that=20 provides=20 +support for the usual functional suspects (each, map, reduce,=20 filter...)=20 +providing over 100 functions.")=20 =20 + (home-page "http://underscorejs.org")=20 =20 + (license license:expat)))=20 =20 modified guix/build/node-build-system.scm=20 =20 @@ -1,6 +1,7 @@=20 =20 ;;; GNU Guix --- Functional package management for GNU=20 =20 ;;; Copyright =C2=A9 2015 David Thompson =20 =20 ;;; Copyright =C2=A9 2016 Jelle Licht =20 =20 +;;; Copyright =C2=A9 2018 swedebugia =20 =20 ;;;=20 =20 ;;; This file is part of GNU Guix.=20 =20 ;;;=20 =20 @@ -109,8 +110,12 @@ is an npm global install."=20 =20 (mkdir-p tgt-dir)=20 =20 (copy-recursively "." (string-append tgt-dir "/node_modules/"=20 modulename))=20 ;; Remove references to dependencies=20 =20 - (delete-file-recursively=20 =20 - (string-append tgt-dir "/node_modules/" modulename=20 "/node_modules"))=20 + ;; FIXME: clarify why this is done.=20 =20 + (let ((tgt-node-modules (string-append tgt-dir "/node_modules/"=20 modulename "/node_modules")))=20 + ;; Check if tgt-node-modules exist and remove them if #t=20 =20 + (when (file-is-directory? tgt-node-modules)=20 =20 + (delete-file-recursively=20 =20 + tgt-node-modules)))=20 =20 (when global?=20 =20 (cond=20 =20 ((string? bin-conf) --=20 Cheers Swedebugia