guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NPM importer


From: swedebugia
Subject: Re: NPM importer
Date: Sat, 24 Nov 2018 14:42:26 +0100

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 develop 
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 and create 2 patches when I have somewhere to share it:

modified gnu/packages/node.scm

@@ -22,6 +22,10 @@

;;; You should have received a copy of the GNU General Public License

;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.




+;; The node-build-system allows two ways to install node:

+;; Locally and globally. Default is "local".

+;; See https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/

+

(define-module (gnu packages node)

#:use-module ((guix licenses) #:prefix license:)

#:use-module (guix packages)

@@ -38,6 +42,7 @@

#:use-module (gnu packages icu4c)

#:use-module (gnu packages libevent)

#:use-module (gnu packages linux)

+ #:use-module (gnu packages lisp)

#:use-module (gnu packages perl)

#:use-module (gnu packages pkg-config)

#:use-module (gnu packages python)

@@ -547,3 +552,45 @@ commonjs, browser, AMD, electron, etc.")

(home-page

"https://github.com/kumavis/browser-stdout";)

(license license:expat)))

+

+(define-public node-underscore

+ (package

+ (name "node-underscore")

+ (version "1.9.1")

+ (source

+ (origin

+ (method git-fetch)

+ (uri (git-reference

+ (url "https://github.com/jashkenas/underscore";)

+ (commit "ae037f7c41323807ae6f1533c45512e6d31a1574")))

+ (file-name (string-append name "-" version))

+ (sha256

+ (base32

+        "1f75wrln5kv5ihkbb9zwhyjqd9imwil801abhv36w09dkkabpjy5"))))
+ (build-system node-build-system)

+ (native-inputs `(("uglify-js" ,uglify-js)))

+ (arguments

+ `(#:tests? #f

+ ;; FIXME: These test dependencies are missing:

+ ;; "karma": "^0.13.13",

+ ;; "karma-qunit": "~2.0.1",

+ ;; "karma-sauce-launcher": "^1.2.0",

+ ;; "nyc": "^2.1.3",

+ ;; "qunit-cli": "~0.2.0",

+ ;; "qunit": "^2.6.0",

+ #:phases ;No configure script

+ (modify-phases %standard-phases

+ (delete 'configure)

+ (add-before 'build 'patch-files

+ (lambda* (#:key inputs #:allow-other-keys)

+ ;; Fix wrong path to uglify-js

+ (substitute* "package.json"

+ (("uglifyjs") "uglify-js")))))))

+ (synopsis

+ "JavaScript's functional programming helper library.")

+ (description

+ "Underscore.js is a utility-belt library for JavaScript that provides +support for the usual functional suspects (each, map, reduce, filter...) +providing over 100 functions.")

+ (home-page "http://underscorejs.org";)

+ (license license:expat)))

modified guix/build/node-build-system.scm

@@ -1,6 +1,7 @@

;;; GNU Guix --- Functional package management for GNU

;;; Copyright © 2015 David Thompson <address@hidden>

;;; Copyright © 2016 Jelle Licht <address@hidden>

+;;; Copyright © 2018 swedebugia <address@hidden>

;;;

;;; This file is part of GNU Guix.

;;;

@@ -109,8 +110,12 @@ is an npm global install."

(mkdir-p tgt-dir)

(copy-recursively "." (string-append tgt-dir "/node_modules/" modulename)) ;; Remove references to dependencies

- (delete-file-recursively

- (string-append tgt-dir "/node_modules/" modulename "/node_modules")) + ;; FIXME: clarify why this is done.

+ (let ((tgt-node-modules (string-append tgt-dir "/node_modules/" modulename "/node_modules"))) + ;; Check if tgt-node-modules exist and remove them if #t

+ (when (file-is-directory? tgt-node-modules)

+ (delete-file-recursively

+ tgt-node-modules)))

(when global?

(cond

         ((string? bin-conf)

--
Cheers Swedebugia



reply via email to

[Prev in Thread] Current Thread [Next in Thread]