summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorArseniy Seroka <jagajaga@users.noreply.github.com>2016-02-10 16:04:31 +0300
committerArseniy Seroka <jagajaga@users.noreply.github.com>2016-02-10 16:04:31 +0300
commit3b1d18ff487b965d06aa39fe269aed5937247ef4 (patch)
treeb35f2a462bf28c38000f94b47f2da7c6dae18129 /pkgs/development/interpreters
parent652ff6902c733eddde84f0b6798c31a8beaa95d6 (diff)
parent112476ec9649d51dd2fd014d759c9bce7626cd49 (diff)
downloadnixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.tar
nixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.tar.gz
nixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.tar.bz2
nixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.tar.lz
nixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.tar.xz
nixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.tar.zst
nixlib-3b1d18ff487b965d06aa39fe269aed5937247ef4.zip
Merge pull request #12919 from zimbatm/new-bundix2
bundix: 1.0.4 -> 2.0.4
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/ruby/bundix/default.nix54
1 files changed, 39 insertions, 15 deletions
diff --git a/pkgs/development/interpreters/ruby/bundix/default.nix b/pkgs/development/interpreters/ruby/bundix/default.nix
index b5a49043c60b..88679f74753d 100644
--- a/pkgs/development/interpreters/ruby/bundix/default.nix
+++ b/pkgs/development/interpreters/ruby/bundix/default.nix
@@ -1,20 +1,44 @@
-{ ruby, fetchgit, buildRubyGem, bundler }:
+{ buildRubyGem, lib, bundler, ruby, nix, nix-prefetch-scripts }:
 
-let
-  thor = buildRubyGem {
-    gemName = "thor";
-    version = "0.19.1";
-    type = "gem";
-    sha256 = "08p5gx18yrbnwc6xc0mxvsfaxzgy2y9i78xq7ds0qmdm67q39y4z";
-  };
+buildRubyGem rec {
+  inherit ruby;
 
-in buildRubyGem {
+  name = "${gemName}-${version}";
   gemName = "bundix";
-  version = "1.0.4";
-  gemPath = [ thor bundler ];
-  src = fetchgit {
-    url = "https://github.com/cstrahan/bundix.git";
-    rev = "6dcf1f71c61584f5c9b919ee9df7b0c554862076";
-    sha256 = "1w17bvc9srcgr4ry81ispcj35g9kxihbyknmqp8rnd4h5090b7b2";
+  version = "2.0.4";
+
+  sha256 = "0i7fdxi6w29yxnblpckczazb79m5x03hja8sfnabndg4yjc868qs";
+
+  buildInputs = [bundler];
+
+  postInstall = ''
+    gem_root=$GEM_HOME/gems/${gemName}-${version}
+    sed \
+      -e 's|NIX_INSTANTIATE =.*|NIX_INSTANTIATE = "${nix}/bin/nix-instantiate"|' \
+      -i $gem_root/lib/bundix.rb
+    sed \
+      -e 's|NIX_HASH =.*|NIX_HASH = "${nix}/bin/nix-hash"|' \
+      -i $gem_root/lib/bundix.rb
+    sed \
+      -e 's|NIX_PREFETCH_URL =.*|NIX_PREFETCH_URL = "${nix}/bin/nix-prefetch-url"|' \
+      -i $gem_root/lib/bundix.rb
+    sed \
+      -e 's|NIX_PREFETCH_GIT =.*|NIX_PREFETCH_GIT = "${nix-prefetch-scripts}/bin/nix-prefetch-git"|' \
+      -i $gem_root/lib/bundix.rb
+  '';
+
+  meta = {
+    inherit version;
+    description = "Creates Nix packages from Gemfiles";
+    longDescription = ''
+      This is a tool that converts Gemfile.lock files to nix expressions.
+
+      The output is then usable by the bundlerEnv derivation to list all the
+      dependencies of a ruby package.
+    '';
+    homepage = "https://github.com/manveru/bundix";
+    license = "MIT";
+    maintainers = with lib.maintainers; [ manveru zimbatm ];
+    platforms = lib.platforms.all;
   };
 }