diff --git a/doc/language-support.xml b/doc/language-support.xml index f5e89df57fcc..117e1d93c152 100644 --- a/doc/language-support.xml +++ b/doc/language-support.xml @@ -233,6 +233,17 @@ twisted = buildPythonPackage { +
Ruby + For example, to package yajl-ruby package, use gem-nix: + + + $ nix-env -i gem-nix + $ gem-nix --no-user-install --nix-file=pkgs/development/interpreters/ruby/generated.nix yajl-ruby + $ nix-build -A rubyLibs.yajl-ruby + +
+ +
Java Ant-based Java packages are typically built from source as follows: diff --git a/pkgs/development/interpreters/ruby/rubygems.nix b/pkgs/development/interpreters/ruby/rubygems.nix index 13829c3f9f6a..3b66464ce223 100644 --- a/pkgs/development/interpreters/ruby/rubygems.nix +++ b/pkgs/development/interpreters/ruby/rubygems.nix @@ -29,13 +29,7 @@ rec { longDescription = '' Nix can create nix packages from gems. - To use it do the following: - 1. Install rubygems and rubyLibs.nix. - 2. Add $your_profile/${ruby.gemPath} to GEM_PATH. - 3. export RUBYLIB=$your_profile/lib RUBYOPT=rubygems. - 4. Run `gem nix --[no-]user-install gem1 gem2 ...` to generate Nix - expression from gem repository. - 5. Install rubyLibs.gem1 etc. + To use it by installing gem-nix package. ''; }; diff --git a/pkgs/tools/package-management/gem-nix/default.nix b/pkgs/tools/package-management/gem-nix/default.nix new file mode 100644 index 000000000000..de5f3a9e0444 --- /dev/null +++ b/pkgs/tools/package-management/gem-nix/default.nix @@ -0,0 +1,23 @@ +{ stdenv, rubygems, rubyLibs, ruby, makeWrapper }: + +stdenv.mkDerivation rec { + name = "gem-nix"; + + buildInputs = [ ruby rubygems rubyLibs.nix makeWrapper ]; + + phases = ["installPhase"]; + + installPhase = '' + mkdir -p $out/bin + echo 'exec ${rubygems}/bin/gem nix "$@"' >> $out/bin/gem-nix + chmod +x $out/bin/gem-nix + wrapProgram $out/bin/gem-nix \ + --set GEM_PATH $GEM_PATH + ''; + + meta = with stdenv.lib; { + description = "gem nix command in a nice wrapper"; + platforms = platforms.linux; + maintainers = [ maintainers.iElectric ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 22ac7822cfca..5e49547b9dc7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3087,6 +3087,8 @@ let fsharp = callPackage ../development/compilers/fsharp {}; + gem-nix = callPackage ../tools/package-management/gem-nix { }; + go_1_0 = callPackage ../development/compilers/go { }; go_1_1 =