aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2018-02-05 11:48:09 +0100
committerChristopher Baines <mail@cbaines.net>2018-08-05 17:15:44 +0100
commit70c889db2d8caf84ba15d728e4d788d73464e176 (patch)
treee4e6a227e9b4746a9b9a5432a960c20b2e56f30e
parenta12a65617ecf68d1705c3ac6883ff9774b2e9d4e (diff)
downloadguix-70c889db2d8caf84ba15d728e4d788d73464e176.tar
guix-70c889db2d8caf84ba15d728e4d788d73464e176.tar.gz
gnu: Add ruby-duktape.
-rw-r--r--gnu/packages/ruby.scm48
1 files changed, 48 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index c44f5905fa..5f587d9966 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -37,6 +37,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 libidn)
#:use-module (gnu packages linux)
@@ -2934,6 +2935,53 @@ URIs using the normal URI.parse method.")
(home-page "https://github.com/dball/data_uri")
(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)))
+
(define-public ruby-git
(package
(name "ruby-git")