From 850c4ad42d1217ed89712cd5d29ff0c9aba15689 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 5 Feb 2018 11:48:09 +0100 Subject: gnu: Add ruby-duktape. --- gnu/packages/ruby.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 5e84c10c8d..4e75afbe69 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -36,6 +36,7 @@ #:use-module (gnu packages readline) #:use-module (gnu packages autotools) #:use-module (gnu packages java) + #:use-module (gnu packages javascript) #:use-module (gnu packages libffi) #:use-module (gnu packages maths) #:use-module (gnu packages networking) @@ -6240,3 +6241,50 @@ CoffeeScript is released.") "ExecJS lets you run JavaScript code from Ruby.") (home-page "https://github.com/rails/execjs") (license license:expat))) + +(define-public ruby-duktape + (package + (name "ruby-duktape") + (version "1.3.0.4") + (source + (origin + (method url-fetch) + ;; fetch from github as the gem does not contain testing code + (uri (string-append "https://github.com/judofyr/duktape.rb/archive/v" + version ".tar.gz")) + (sha256 + (base32 + "1xgs7ll9xwm5p451mh70cm5646wijc2jdvjdb81a17wwvccf7djw")))) + (build-system ruby-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + ;; Duktape comes with the duktape .c and .h files. Replace these with + ;; those from the duktape Guix package. + (add-after 'unpack 'replace-bundled-duktape + (lambda* (#:key inputs outputs #:allow-other-keys) + (for-each (lambda (file) + (delete-file (string-append "ext/duktape/" file)) + (copy-file + (string-append + (assoc-ref inputs "duktape") "/src/" file) + (string-append "ext/duktape/" file))) + (list "duktape.c" "duktape.h")))) + (add-before 'check 'remove-dependency + (lambda _ + ;; Gem is not needed for testing. + (substitute* "Gemfile" + (("^ gem 'aws-sdk', '~> 2.2.0'") "")) + #t))))) + (native-inputs + `(("bundler" ,bundler) + ("ruby-rake-compiler" ,ruby-rake-compiler) + ("ruby-sdoc" ,ruby-sdoc) + ("duktape" ,duktape))) + (synopsis "Bindings to the Duktape JavaScript interpreter") + (description + "Bindings to the Duktape JavaScript interpreter") + (home-page + "https://github.com/judofyr/duktape.rb") + (license license:expat))) -- cgit v1.2.3