unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] ruby-rake-compiler
@ 2015-07-04 13:08 Pjotr Prins
  2015-07-04 13:55 ` Thompson, David
  0 siblings, 1 reply; 4+ messages in thread
From: Pjotr Prins @ 2015-07-04 13:08 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

Attached a Ruby module in preparation of Nokogiri support.

(I am pretty close as described in
https://github.com/pjotrp/guix-notes/blob/master/RUBYGEMS-Nokogiri.org).

Cucumber support comes later (it depends on Nokogiri itself).

David: there are quite a few modules now that build gems through 'rake
gem'.  Would it be an idea to try that by default when there is no
gemspec file?

Pj.

[-- Attachment #2: 0001-gnu-Add-Ruby-rake-compiler.patch --]
[-- Type: text/x-diff, Size: 2056 bytes --]

From e54bb659ccc3a91072214b00e5bdb6b9fbe448e5 Mon Sep 17 00:00:00 2001
From: pjotrp <pjotr.public01@thebird.nl>
Date: Sat, 4 Jul 2015 15:00:09 +0200
Subject: [PATCH]     gnu: Add Ruby rake-compiler.

    * gnu/packages/ruby.scm (ruby-rake-compiler): New variable.
---
 gnu/packages/ruby.scm |   36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index af87cf5..8c86a14 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -177,6 +177,42 @@ announcement.")
     (home-page "http://www.zenspider.com/projects/hoe.html")
     (license license:expat)))
 
+(define-public ruby-rake-compiler
+  (package
+    (name "ruby-rake-compiler")
+    (version "0.9.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/rake-compiler/rake-compiler/archive/v"
+                                  version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "07lk1vl0jqcaqwjjhmg0qshqwcxdyr5kscc9xxm13m03835xgpf3"))
+    (snippet
+     '(begin
+	;; Remove cucumber test file (dependencies do not resolve right now)
+	(delete-file "tasks/cucumber.rake")))))
+    (build-system ruby-build-system)
+    (arguments
+     '(
+       #:tests? #f
+       #:phases (alist-replace
+                 'build
+                 (lambda _ (zero? (system* "rake" "gem")))
+                 %standard-phases))
+
+     )
+    (native-inputs
+     `(("ruby-rspec" ,ruby-rspec)))
+    (synopsis "Building and packaging helper for Ruby extensions")
+    (description "A productivity tool for Ruby developers. Its goal is
+to make the busy developer's life easier by simplifying the building
+and packaging of Ruby extensions by simplifying code and reducing
+duplication.")
+    (home-page "https://github.com/rake-compiler/rake-compiler")
+    (license license:x11)))
+
 (define-public ruby-i18n
   (package
     (name "ruby-i18n")
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ruby-rake-compiler
  2015-07-04 13:08 [PATCH] ruby-rake-compiler Pjotr Prins
@ 2015-07-04 13:55 ` Thompson, David
  2015-07-04 14:28   ` Pjotr Prins
  0 siblings, 1 reply; 4+ messages in thread
From: Thompson, David @ 2015-07-04 13:55 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: guix-devel

Hey Pjotr,

On Sat, Jul 4, 2015 at 9:08 AM, Pjotr Prins <pjotr.public12@thebird.nl> wrote:
> Attached a Ruby module in preparation of Nokogiri support.

I've applied this patch with a number of changes:

* Removed the use of 'snippet'.  That is for making changes that
aren't specific to building for Guix, like removing a piece of
non-free source.  The cucumber task file is now deleted in a phase
that runs before the 'build' phase.

* Used the 'modify-phases' syntax instead of 'alist-replace' and friends.

* Removed the rspec native input.  It can be added back in when we can
actually run the test suite.

* Cleaned up synopsis/description to use more neutral language.

* Fixed license.  It's actually the Expat license, which is verrrrry
similar to the X11 license.

> (I am pretty close as described in
> https://github.com/pjotrp/guix-notes/blob/master/RUBYGEMS-Nokogiri.org).
>
> Cucumber support comes later (it depends on Nokogiri itself).

Sounds like we'll have to do a similar dance that I did with rspec:
Disable test suites for all dependencies of cucumber. :(

> David: there are quite a few modules now that build gems through 'rake
> gem'.  Would it be an idea to try that by default when there is no
> gemspec file?

Yes, I think that would be a good change.  Want to write a patch that
does that and updates all of the relevant package recipes?

Thanks!  It will be nice to have Nokogiri!

- Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ruby-rake-compiler
  2015-07-04 13:55 ` Thompson, David
@ 2015-07-04 14:28   ` Pjotr Prins
  2015-07-04 14:45     ` Thompson, David
  0 siblings, 1 reply; 4+ messages in thread
From: Pjotr Prins @ 2015-07-04 14:28 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

On Sat, Jul 04, 2015 at 09:55:57AM -0400, Thompson, David wrote:
> * Removed the rspec native input.  It can be added back in when we can
> actually run the test suite.

Without rspec it won't build. Alternatively remove tasks/rspec.rake

> * Fixed license.  It's actually the Expat license, which is verrrrry
> similar to the X11 license.

OK. Not too clear on the difference...

> > David: there are quite a few modules now that build gems through 'rake
> > gem'.  Would it be an idea to try that by default when there is no
> > gemspec file?
> 
> Yes, I think that would be a good change.  Want to write a patch that
> does that and updates all of the relevant package recipes?

I'll give it a shot soon.

Pj.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ruby-rake-compiler
  2015-07-04 14:28   ` Pjotr Prins
@ 2015-07-04 14:45     ` Thompson, David
  0 siblings, 0 replies; 4+ messages in thread
From: Thompson, David @ 2015-07-04 14:45 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: guix-devel

On Sat, Jul 4, 2015 at 10:28 AM, Pjotr Prins <pjotr.public12@thebird.nl> wrote:
> On Sat, Jul 04, 2015 at 09:55:57AM -0400, Thompson, David wrote:
>> * Removed the rspec native input.  It can be added back in when we can
>> actually run the test suite.
>
> Without rspec it won't build. Alternatively remove tasks/rspec.rake

I was able to build it successfully without it.  Is this a runtime
error?  I tried this as a quick smoke test and there were no errors:

    guix environment --ad-hoc ruby ruby-rake-compiler
--exec="rake-compiler --help"

Am I missing something?  Send me a patch if you find an issue.

>> * Fixed license.  It's actually the Expat license, which is verrrrry
>> similar to the X11 license.
>
> OK. Not too clear on the difference...

There's an extra clause in the X11 license that is not in the Expat
license.  Wikipedia has a blurb about it:
https://en.wikipedia.org/wiki/MIT_License#Various_versions

>> > David: there are quite a few modules now that build gems through 'rake
>> > gem'.  Would it be an idea to try that by default when there is no
>> > gemspec file?
>>
>> Yes, I think that would be a good change.  Want to write a patch that
>> does that and updates all of the relevant package recipes?
>
> I'll give it a shot soon.

Cool.  Should be an easy patch to the build phase. :)

- Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-04 14:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-04 13:08 [PATCH] ruby-rake-compiler Pjotr Prins
2015-07-04 13:55 ` Thompson, David
2015-07-04 14:28   ` Pjotr Prins
2015-07-04 14:45     ` Thompson, David

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).