Re: [Nix-dev] Announcing New Ruby Support

2015-02-11 Thread Cillian de Róiste
2015-02-11 0:50 GMT+01:00 Wout Mertens wout.mert...@gmail.com:
 rb_enc_raise seems to be a ruby 2.0 thing and you're using 1.9.3. Some mixup
 somewhere?
 https://bugs.ruby-lang.org/issues/5650 was when it was added to 2.0 3 years
 ago...

Thanks! That definitely helped. Our default ruby is 1.9 (which seems
to match Ubuntu and Debian), so I tried to build jekyll with ruby_2_2
but it failed with the following error:

building /nix/store/96pwrdy5jzdz8rgcnb5anfmyy65lg9iw-jekyll-0.20.0
installing
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* test-unit

The Gemfile contains the line: gem 'test-unit' if RUBY_PLATFORM =~
/cygwin/ || RUBY_VERSION.start_with?(2.2)
so I tried with ruby_2_1_3 instead. The build finished successfully,
but I didn't end up with a `jekyll` in ./result/bin:

$ ls ./result/bin
bayes.rb  cucumber  launchy  maruku
posix-spawn-benchmark  rdiscount  redcarpet  ri
convert_to_should_syntax  htmldiff  ldiffmarutex  rake
  rdoc   rg summarize.rb

Here's the build log: http://nixpaste.noip.me/NKlLS4G-

Any idea what I can try next?

Cheers,
Cillian


-- 
NixOS: The Purely Functional Linux Distribution
http://nixos.org
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Announcing New Ruby Support

2015-02-10 Thread Cillian de Róiste
Hi!

I thought I'd try to package jekyll, but I've run into some trouble...

2015-01-22 5:29 GMT+01:00 Charles Strahan charles.c.stra...@gmail.com:

 To use the new system, first create (or copy over) a Gemfile describing the
 required gems.


I grabbed the Gemfile from the github repo:
$ wget https://raw.githubusercontent.com/jekyll/jekyll/master/Gemfile

Next, create a Gemfile.lock by running `bundler package --no-install` in the
 containing directory (this also creates two folders - vendor and .bundle -
 which you'll want to delete before committing).


I had first installed pkgs.bundler, which got me version 1.7.9, which
doesn't have the --no-install option which seems to have been added in 1.8.
I then installed pkgs.bundler_HEAD which also reports the version to be
1.7.9 but does have the --no-install option. However, I got stuck on the
next step:

$ bundler package --no-install
There are no gemspecs at /home/goibhniu/ruby/jekyll.

I'm afraid I know very little about ruby or gems etc., so any help/pointers
would be appreciated.

Thanks!
Cillian


Now, you'll need to dump the lockfile as a Nix expression. To do so, use
 Bundix
 in the target directory:

   $(nix-build 'nixpkgs' -A bundix)/bin/bundix

 That will drop a gemset.nix file in your current directory, which
 describes the
 sources for all of the gems and their respective SHAs.

 Finally, you'll need to use bundlerEnv to build the gems. The following
 example
 is how we package the sup mail reader:

   { stdenv, lib, bundlerEnv, gpgme, ruby, ncurses, writeText, zlib, xapian
   , pkgconfig, which }:

   bundlerEnv {
 name = sup-0.20.0;

 inherit ruby;
 gemfile = ./Gemfile;
 lockfile = ./Gemfile.lock;
 gemset = ./gemset.nix;

 # This is implicit:
 #
 #   gemConfig = defaultGemConfig;
 #
 # You could just as well do the following:
 #
 #   gemConfig.ncursesw = spec: {
 # buildInputs = [ ncurses ];
 # buildFlags = [
 #   --with-cflags=-I${ncurses}/include
 #   --with-ldflags=-L${ncurses}/lib
 # ];
 #   };
 #
 # Where `spec` is the attributes of the corresponding gem,
 # in case you wanted to make something predicated on version,
 # for example.
 #
 # See default-gem-config.nix for more examples.

 meta = with lib; {
   description = A curses threads-with-tags style email client;
   homepage= http://supmua.org;
   license = with licenses; gpl2;
   maintainers = with maintainers; [ cstrahan lovek323 ];
   platforms   = platforms.unix;
 };
   }

 And that's all there is to it!

 Enjoy,

 -Charles


 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev




-- 
NixOS: The Purely Functional Linux Distribution
http://nixos.org
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Announcing New Ruby Support

2015-02-10 Thread Cillian de Róiste
2015-02-10 19:25 GMT+01:00 Cillian de Róiste cillian.deroi...@gmail.com:

 Hi!

 I thought I'd try to package jekyll, but I've run into some trouble...

 2015-01-22 5:29 GMT+01:00 Charles Strahan charles.c.stra...@gmail.com:

 To use the new system, first create (or copy over) a Gemfile describing the
 required gems.


 I grabbed the Gemfile from the github repo:
 $ wget https://raw.githubusercontent.com/jekyll/jekyll/master/Gemfile


 Next, create a Gemfile.lock by running `bundler package --no-install` in the
 containing directory (this also creates two folders - vendor and .bundle -
 which you'll want to delete before committing).


 I had first installed pkgs.bundler, which got me version 1.7.9, which doesn't 
 have the --no-install option which seems to have been added in 1.8. I then 
 installed pkgs.bundler_HEAD which also reports the version to be 1.7.9 but 
 does have the --no-install option. However, I got stuck on the next step:

 $ bundler package --no-install
 There are no gemspecs at /home/goibhniu/ruby/jekyll.

The second line has the word gemspec, I commented it out and was
able to get further

I ran `bundler package --no-install --path vendor/bundle` which
successfully created lockfile.

 Now, you'll need to dump the lockfile as a Nix expression. To do so, use 
 Bundix
 in the target directory:

   $(nix-build 'nixpkgs' -A bundix)/bin/bundix

To avoid rebuilding the world I checked out 317d78d and tried to
install bundix from there. I had to patch the hash for bundix and
bundler [1], but then I was able to install bundix and create the
gemset.nix \o/


 That will drop a gemset.nix file in your current directory, which describes 
 the
 sources for all of the gems and their respective SHAs.

 Finally, you'll need to use bundlerEnv to build the gems. The following 
 example
 is how we package the sup mail reader:


I copied the example nix expression, changed the name and added it to
all-packages.nix to build it. All went quite well until I got the
following error:

...
Installing liquid 3.0.1

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/nix/store/wdjnbdyrvsfbg245qyp3r7qwhlhxzd1c-ruby-1.9.3-p547/bin/ruby
-r ./siteconf20150210-115-km0s7e.rb extconf.rb
creating Makefile

make  clean
building clean-static
building clean

make
building lexer.o
compiling lexer.c
lexer.c: In function 'lex_one':
lexer.c:143:5: error: implicit declaration of function
'rb_enc_raise' [-Werror=implicit-function-declaration]
 rb_enc_raise(utf8_encoding, cLiquidSyntaxError, Unexpected
character %c, c);

IIUC it fails to find some ruby header file. Any tips on how to proceed?

Cheers,
Cillian


Patches [1]:

diff --git a/pkgs/development/interpreters/ruby/bundix/gemset.nix
b/pkgs/development/interpreters/ruby/bundix/gemset.nix
index a2c633f..a3e732c 100644
--- a/pkgs/development/interpreters/ruby/bundix/gemset.nix
+++ b/pkgs/development/interpreters/ruby/bundix/gemset.nix
@@ -6,7 +6,7 @@
   url = https://github.com/cstrahan/bundix.git;;
   rev = 5df25b11b5b86e636754d54c2a8859c7c6ec78c7;
   fetchSubmodules = false;
-  sha256 = 0334jsavpzkikcs7wrx7a3r0ilvr5vsnqd34lhc58b8cgvgll47p;
+  sha256 = 1iqx12y777v8gszggj25x0xcf6lzllx58lmv53x6zy3jmvfh4siv;
 };
 dependencies = [
   thor
diff --git a/pkgs/development/interpreters/ruby/bundler-head.nix
b/pkgs/development/interpreters/ruby/bundler-head.nix
index 2e8cfc8..43a5961 100644
--- a/pkgs/development/interpreters/ruby/bundler-head.nix
+++ b/pkgs/development/interpreters/ruby/bundler-head.nix
@@ -5,7 +5,7 @@ buildRubyGem {
   src = fetchgit {
 url = https://github.com/bundler/bundler.git;;
 rev = a2343c9eabf5403d8ffcbca4dea33d18a60fc157;
-sha256 = 1l4r55n1wzr817l225l6pm97li1mxg9icd8s51cpfihh91nkdz68;
+sha256 = 1fywz0m3bb0fmcikhqbw9iaw67k29srwi8dllq6ni1cbm1xfyj46;
 leaveDotGit = true;
   };
   dontPatchShebangs = true;


-- 
NixOS: The Purely Functional Linux Distribution
http://nixos.org
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Announcing New Ruby Support

2015-02-10 Thread Wout Mertens
rb_enc_raise seems to be a ruby 2.0 thing and you're using 1.9.3. Some
mixup somewhere?
https://bugs.ruby-lang.org/issues/5650 was when it was added to 2.0 3 years
ago...


On Tue Feb 10 2015 at 11:05:56 PM Cillian de Róiste 
cillian.deroi...@gmail.com wrote:

 2015-02-10 19:25 GMT+01:00 Cillian de Róiste cillian.deroi...@gmail.com:
 
  Hi!
 
  I thought I'd try to package jekyll, but I've run into some trouble...
 
  2015-01-22 5:29 GMT+01:00 Charles Strahan charles.c.stra...@gmail.com:
 
  To use the new system, first create (or copy over) a Gemfile describing
 the
  required gems.
 
 
  I grabbed the Gemfile from the github repo:
  $ wget https://raw.githubusercontent.com/jekyll/jekyll/master/Gemfile
 
 
  Next, create a Gemfile.lock by running `bundler package --no-install`
 in the
  containing directory (this also creates two folders - vendor and
 .bundle -
  which you'll want to delete before committing).
 
 
  I had first installed pkgs.bundler, which got me version 1.7.9, which
 doesn't have the --no-install option which seems to have been added in 1.8.
 I then installed pkgs.bundler_HEAD which also reports the version to be
 1.7.9 but does have the --no-install option. However, I got stuck on the
 next step:
 
  $ bundler package --no-install
  There are no gemspecs at /home/goibhniu/ruby/jekyll.

 The second line has the word gemspec, I commented it out and was
 able to get further

 I ran `bundler package --no-install --path vendor/bundle` which
 successfully created lockfile.

  Now, you'll need to dump the lockfile as a Nix expression. To do so,
 use Bundix
  in the target directory:
 
$(nix-build 'nixpkgs' -A bundix)/bin/bundix

 To avoid rebuilding the world I checked out 317d78d and tried to
 install bundix from there. I had to patch the hash for bundix and
 bundler [1], but then I was able to install bundix and create the
 gemset.nix \o/

 
  That will drop a gemset.nix file in your current directory, which
 describes the
  sources for all of the gems and their respective SHAs.
 
  Finally, you'll need to use bundlerEnv to build the gems. The following
 example
  is how we package the sup mail reader:


 I copied the example nix expression, changed the name and added it to
 all-packages.nix to build it. All went quite well until I got the
 following error:

 ...
 Installing liquid 3.0.1

 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

 /nix/store/wdjnbdyrvsfbg245qyp3r7qwhlhxzd
 1c-ruby-1.9.3-p547/bin/ruby
 -r ./siteconf20150210-115-km0s7e.rb extconf.rb
 creating Makefile

 make  clean
 building clean-static
 building clean

 make
 building lexer.o
 compiling lexer.c
 lexer.c: In function 'lex_one':
 lexer.c:143:5: error: implicit declaration of function
 'rb_enc_raise' [-Werror=implicit-function-declaration]
  rb_enc_raise(utf8_encoding, cLiquidSyntaxError, Unexpected
 character %c, c);

 IIUC it fails to find some ruby header file. Any tips on how to proceed?

 Cheers,
 Cillian


 Patches [1]:

 diff --git a/pkgs/development/interpreters/ruby/bundix/gemset.nix
 b/pkgs/development/interpreters/ruby/bundix/gemset.nix
 index a2c633f..a3e732c 100644
 --- a/pkgs/development/interpreters/ruby/bundix/gemset.nix
 +++ b/pkgs/development/interpreters/ruby/bundix/gemset.nix
 @@ -6,7 +6,7 @@
url = https://github.com/cstrahan/bundix.git;;
rev = 5df25b11b5b86e636754d54c2a8859c7c6ec78c7;
fetchSubmodules = false;
 -  sha256 = 0334jsavpzkikcs7wrx7a3r0ilvr5vsnqd34lhc58b8cgvgll47p;
 +  sha256 = 1iqx12y777v8gszggj25x0xcf6lzllx58lmv53x6zy3jmvfh4siv;
  };
  dependencies = [
thor
 diff --git a/pkgs/development/interpreters/ruby/bundler-head.nix
 b/pkgs/development/interpreters/ruby/bundler-head.nix
 index 2e8cfc8..43a5961 100644
 --- a/pkgs/development/interpreters/ruby/bundler-head.nix
 +++ b/pkgs/development/interpreters/ruby/bundler-head.nix
 @@ -5,7 +5,7 @@ buildRubyGem {
src = fetchgit {
  url = https://github.com/bundler/bundler.git;;
  rev = a2343c9eabf5403d8ffcbca4dea33d18a60fc157;
 -sha256 = 1l4r55n1wzr817l225l6pm97li1mxg9icd8s51cpfihh91nkdz68;
 +sha256 = 1fywz0m3bb0fmcikhqbw9iaw67k29srwi8dllq6ni1cbm1xfyj46;
  leaveDotGit = true;
};
dontPatchShebangs = true;


 --
 NixOS: The Purely Functional Linux Distribution
 http://nixos.org
 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Announcing New Ruby Support

2015-01-26 Thread Domen Kožar
I've opened https://github.com/NixOS/nixpkgs/issues/5985 to address
documentation regarding this change.

PS: we should also migrate redmine to the new infrastructure:
https://github.com/NixOS/nixpkgs/issues/5984

On Thu, Jan 22, 2015 at 9:03 AM, Matthias Beyer m...@beyermatthias.de
wrote:

 Hi,

 On 21-01-2015 23:29:55, Charles Strahan wrote:
 Hello all,
 I'm pleased to announce that the Pleasant Ruby PR has landed on
 master.

 this is awesome news!

 The new
 feature - bundlerEnv - allows one to package Ruby applications with
 Bundler.
 To use the new system, first create (or copy over) a Gemfile
 describing
 the
 required gems.
 Next, create a Gemfile.lock by running `bundler package --no-install`
 in
 the
 containing directory (this also creates two folders - vendor and
 .bundle -
 which you'll want to delete before committing).
 Now, you'll need to dump the lockfile as a Nix expression. To do so,
 use
 Bundix
 in the target directory:
 A  $(nix-build 'nixpkgs' -A bundix)/bin/bundix
 That will drop a gemset.nix file in your current directory, which
 describes the
 sources for all of the gems and their respective SHAs.
 Finally, you'll need to use bundlerEnv to build the gems. The
 following
 example
 is how we package the sup mail reader:
 [...]

 Is there a way to even automat these steps?

 Ideally (for me as user) would be to be able to

 nix-env -iA pkgs.rubyGems.insert arbitrary gem

 and nix figures out everything, including dependencies and so on.

 I don't know whether this is possible or not, but I guess it would be
 really cool and also beneficial in manner of packaging/maintaining
 effort.

 Anyways, nice to hear that Ruby support gets better!

 --
 Mit freundlichen Grüßen,
 Kind regards,
 Matthias Beyer

 Proudly sent with mutt.
 Happily signed with gnupg.

 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Announcing New Ruby Support

2015-01-26 Thread Charles Strahan
 Ideally (for me as user) would be to be able to

 nix-env -iA pkgs.rubyGems.insert arbitrary gem

I have some ideas, but I first need to get some patches into Bundler and
Rubygems.org.

 I've opened https://github.com/NixOS/nixpkgs/issues/5985 to address
documentation regarding this change.

 PS: we should also migrate redmine to the new infrastructure:
https://github.com/NixOS/nixpkgs/issues/5984

I'll add those to my list. Can't give a time estimate at the moment, I'm
afraid.

On Mon, Jan 26, 2015 at 5:03 AM, Domen Kožar do...@dev.si wrote:

 I've opened https://github.com/NixOS/nixpkgs/issues/5985 to address
 documentation regarding this change.

 PS: we should also migrate redmine to the new infrastructure:
 https://github.com/NixOS/nixpkgs/issues/5984

 On Thu, Jan 22, 2015 at 9:03 AM, Matthias Beyer m...@beyermatthias.de
 wrote:

 Hi,

 On 21-01-2015 23:29:55, Charles Strahan wrote:
 Hello all,
 I'm pleased to announce that the Pleasant Ruby PR has landed on
 master.

 this is awesome news!

 The new
 feature - bundlerEnv - allows one to package Ruby applications with
 Bundler.
 To use the new system, first create (or copy over) a Gemfile
 describing
 the
 required gems.
 Next, create a Gemfile.lock by running `bundler package
 --no-install` in
 the
 containing directory (this also creates two folders - vendor and
 .bundle -
 which you'll want to delete before committing).
 Now, you'll need to dump the lockfile as a Nix expression. To do so,
 use
 Bundix
 in the target directory:
 A  $(nix-build 'nixpkgs' -A bundix)/bin/bundix
 That will drop a gemset.nix file in your current directory, which
 describes the
 sources for all of the gems and their respective SHAs.
 Finally, you'll need to use bundlerEnv to build the gems. The
 following
 example
 is how we package the sup mail reader:
 [...]

 Is there a way to even automat these steps?

 Ideally (for me as user) would be to be able to

 nix-env -iA pkgs.rubyGems.insert arbitrary gem

 and nix figures out everything, including dependencies and so on.

 I don't know whether this is possible or not, but I guess it would be
 really cool and also beneficial in manner of packaging/maintaining
 effort.

 Anyways, nice to hear that Ruby support gets better!

 --
 Mit freundlichen Grüßen,
 Kind regards,
 Matthias Beyer

 Proudly sent with mutt.
 Happily signed with gnupg.

 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Announcing New Ruby Support

2015-01-22 Thread Matthias Beyer
Hi,

On 21-01-2015 23:29:55, Charles Strahan wrote:
Hello all,
I'm pleased to announce that the Pleasant Ruby PR has landed on master.

this is awesome news!

The new
feature - bundlerEnv - allows one to package Ruby applications with
Bundler.
To use the new system, first create (or copy over) a Gemfile describing
the
required gems.
Next, create a Gemfile.lock by running `bundler package --no-install` in
the
containing directory (this also creates two folders - vendor and .bundle -
which you'll want to delete before committing).
Now, you'll need to dump the lockfile as a Nix expression. To do so, use
Bundix
in the target directory:
A  $(nix-build 'nixpkgs' -A bundix)/bin/bundix
That will drop a gemset.nix file in your current directory, which
describes the
sources for all of the gems and their respective SHAs.
Finally, you'll need to use bundlerEnv to build the gems. The following
example
is how we package the sup mail reader:
[...]

Is there a way to even automat these steps?

Ideally (for me as user) would be to be able to

nix-env -iA pkgs.rubyGems.insert arbitrary gem

and nix figures out everything, including dependencies and so on.

I don't know whether this is possible or not, but I guess it would be
really cool and also beneficial in manner of packaging/maintaining
effort.

Anyways, nice to hear that Ruby support gets better!

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.


pgpn6PNp2mmEx.pgp
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Announcing New Ruby Support

2015-01-21 Thread Charles Strahan
Hello all,

I'm pleased to announce that the Pleasant Ruby PR has landed on master. The
new
feature - bundlerEnv - allows one to package Ruby applications with Bundler.

To use the new system, first create (or copy over) a Gemfile describing the
required gems.

Next, create a Gemfile.lock by running `bundler package --no-install` in the
containing directory (this also creates two folders - vendor and .bundle -
which you'll want to delete before committing).

Now, you'll need to dump the lockfile as a Nix expression. To do so, use
Bundix
in the target directory:

  $(nix-build 'nixpkgs' -A bundix)/bin/bundix

That will drop a gemset.nix file in your current directory, which describes
the
sources for all of the gems and their respective SHAs.

Finally, you'll need to use bundlerEnv to build the gems. The following
example
is how we package the sup mail reader:

  { stdenv, lib, bundlerEnv, gpgme, ruby, ncurses, writeText, zlib, xapian
  , pkgconfig, which }:

  bundlerEnv {
name = sup-0.20.0;

inherit ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;

# This is implicit:
#
#   gemConfig = defaultGemConfig;
#
# You could just as well do the following:
#
#   gemConfig.ncursesw = spec: {
# buildInputs = [ ncurses ];
# buildFlags = [
#   --with-cflags=-I${ncurses}/include
#   --with-ldflags=-L${ncurses}/lib
# ];
#   };
#
# Where `spec` is the attributes of the corresponding gem,
# in case you wanted to make something predicated on version,
# for example.
#
# See default-gem-config.nix for more examples.

meta = with lib; {
  description = A curses threads-with-tags style email client;
  homepage= http://supmua.org;
  license = with licenses; gpl2;
  maintainers = with maintainers; [ cstrahan lovek323 ];
  platforms   = platforms.unix;
};
  }

And that's all there is to it!

Enjoy,

-Charles
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev