diff options
author | Shea Levy <shea@shealevy.com> | 2013-03-04 10:43:20 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2013-03-04 10:43:20 -0500 |
commit | ae2b08aeb360e67ba7b8f3dc7f483c69241494c5 (patch) | |
tree | 9a21da0757bf2322e25e5fc456a24e31bdeeab96 /pkgs/development | |
parent | cddc4c6f631fd00cbd4d87a8fa5cb26cb08d485f (diff) | |
download | nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.tar nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.tar.gz nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.tar.bz2 nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.tar.lz nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.tar.xz nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.tar.zst nixlib-ae2b08aeb360e67ba7b8f3dc7f483c69241494c5.zip |
Add some fixes for gem nix.
Ideally these would be picked up upstream. Pull request at https://gitorious.org/ruby-nix/ruby-nix/merge_requests/1
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch | 35 | ||||
-rw-r--r-- | pkgs/development/interpreters/ruby/patches.nix | 7 |
2 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch b/pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch new file mode 100644 index 000000000000..c67eaff2ac50 --- /dev/null +++ b/pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch @@ -0,0 +1,35 @@ +diff --git a/lib/nix/gem-nix-command.rb b/lib/nix/gem-nix-command.rb +index 8d3733e..ba942ff 100644 +--- a/lib/nix/gem-nix-command.rb ++++ b/lib/nix/gem-nix-command.rb +@@ -108,11 +108,12 @@ class Gem::Commands::NixCommand < Gem::Command + + # args to dep informations + args.each { |arg| +- if arg =~ /(.+)-?(.*)?/ then ++ if arg =~ /(.+)-([0-9][^-]+)/ then + gem_name = $1 +- version = $2.empty? ? Gem::Requirement.default : Gem::Version.new($2) ++ version = Gem::Version.new($2) + else +- raise Gem::CommandLineError, "couldn't parse arg. expected: name or name-version" ++ gem_name = arg ++ version = Gem::Requirement.default + end + + adddep(Gem::Dependency.new gem_name, version) +@@ -162,7 +163,13 @@ class Gem::Commands::NixCommand < Gem::Command + spec, source_uri = find_gem_with_source(dep) + full_name = spec.full_name + +- return if @gems_with_deps.key?(full_name) ++ if @gems_with_deps.key?(full_name) ++ unless @gems_with_deps[full_name].nil? ++ return @gems_with_deps[full_name][0] ++ else ++ return nil ++ end ++ end + @gems_with_deps[full_name] = nil # there maybe circular dependencies. thus mark this gem seen as early as possible + + # development deps can't be found. Some are old. Thus only add rutime dependencies diff --git a/pkgs/development/interpreters/ruby/patches.nix b/pkgs/development/interpreters/ruby/patches.nix index a2d2d753a4af..adfea12da952 100644 --- a/pkgs/development/interpreters/ruby/patches.nix +++ b/pkgs/development/interpreters/ruby/patches.nix @@ -20,6 +20,13 @@ in rails = { gemFlags = "--no-ri --no-rdoc"; }; ncurses = { propagatedBuildInputs = [ ncurses ]; }; + + nix = { + postInstall = '' + cd $out/${ruby.gemPath}/gems/nix* + patch -Np1 -i ${./fix-gem-nix-versions.patch} + ''; + }; ncursesw = { propagatedBuildInputs = [ ncurses ]; }; |