summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby/fixes.nix
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2014-10-28 04:16:14 +0000
committerCharles Strahan <charles.c.strahan@gmail.com>2014-10-28 04:16:14 +0000
commite4a2a7e73e43dc84f9b5f58880efc08b132b9f29 (patch)
treec6fe8170a8254d0dd14f5fd4f82d33aee2e4b083 /pkgs/development/interpreters/ruby/fixes.nix
parent857f017a0d28a48fce37d8a71a3633b9f48e0950 (diff)
downloadnixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.tar
nixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.tar.gz
nixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.tar.bz2
nixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.tar.lz
nixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.tar.xz
nixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.tar.zst
nixpkgs-e4a2a7e73e43dc84f9b5f58880efc08b132b9f29.zip
simplification / refactoring
Diffstat (limited to 'pkgs/development/interpreters/ruby/fixes.nix')
-rw-r--r--pkgs/development/interpreters/ruby/fixes.nix88
1 files changed, 36 insertions, 52 deletions
diff --git a/pkgs/development/interpreters/ruby/fixes.nix b/pkgs/development/interpreters/ruby/fixes.nix
index eebda22263a..6457e713387 100644
--- a/pkgs/development/interpreters/ruby/fixes.nix
+++ b/pkgs/development/interpreters/ruby/fixes.nix
@@ -17,67 +17,51 @@
 # This seperates "what to build" (the exact gem versions) from "how to build"
 # (to make gems behave if necessary).
 
-{ lib, gemset, buildRubyGem, writeScript, ruby, libxml2, libxslt, python, stdenv
-, which, postgresql, v8_3_16_14, clang }:
+{ lib, fetchurl, writeScript, ruby, libxml2, libxslt, python, stdenv, which
+, postgresql, v8_3_16_14, clang }:
 
 let
-  const = x: y: x;
   v8 = v8_3_16_14;
 
-  gems = lib.mapAttrs (name: attrs:
-    if (lib.isDerivation attrs) then attrs
-    else (instantiate name attrs)
-  ) gemset;
+in
 
-  instantiate = (name: attrs:
-    let
-      gemPath = map (name: gems."${name}") (attrs.dependencies or []);
-      fixedAttrs = attrs // (fixes."${name}" or const {}) attrs;
-    in
-      buildRubyGem (fixedAttrs // { name = "${name}-${attrs.version}"; inherit gemPath; })
-  );
-
-  fixes = {
-    bundler = attrs: {
-      dontPatchShebangs = 1;
-    };
+{
+  bundler = attrs: {
+    dontPatchShebangs = 1;
+  };
 
-    libv8 = attrs: {
-      buildFlags = [ "--with-system-v8" ];
-      buildInputs = [ which v8 python ];
-    };
+  libv8 = attrs: {
+    buildFlags = [ "--with-system-v8" ];
+    buildInputs = [ which v8 python ];
+  };
 
-    nokogiri = attrs: {
-      buildFlags = [
-        "--with-xml2-dir=${libxml2}"
-        "--with-xml2-include=${libxml2}/include/libxml2"
-        "--with-xslt-dir=${libxslt}"
-        "--use-system-libraries"
-      ];
-    };
+  nokogiri = attrs: {
+    buildFlags = [
+      "--with-xml2-dir=${libxml2}"
+      "--with-xml2-include=${libxml2}/include/libxml2"
+      "--with-xslt-dir=${libxslt}"
+      "--use-system-libraries"
+    ];
+  };
 
-    therubyracer = attrs: {
-      dontBuild = false;
+  therubyracer = attrs: {
+    dontBuild = false;
 
-      preInstall = ''
-        addToSearchPath RUBYLIB "${gems.libv8}/gems/libv8-3.16.14.3/lib"
-        addToSearchPath RUBYLIB "${gems.libv8}/gems/libv8-3.16.14.3/ext"
-        ln -s ${clang}/bin/clang $TMPDIR/gcc
-        ln -s ${clang}/bin/clang++ $TMPDIR/g++
-        export PATH=$TMPDIR:$PATH
-      '';
+    preInstall = ''
+      ln -s ${clang}/bin/clang $TMPDIR/gcc
+      ln -s ${clang}/bin/clang++ $TMPDIR/g++
+      export PATH=$TMPDIR:$PATH
+    '';
 
-      postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
-        cat >> $out/nix-support/setup-hook <<EOF
-          export DYLD_INSERT_LIBRARIES="$DYLD_INSERT_LIBRARIES''${!DYLD_INSERT_LIBRARIES:+:}${v8}/lib/libv8.dylib"
-        EOF
-      '';
+    postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+      cat >> $out/nix-support/setup-hook <<EOF
+        export DYLD_INSERT_LIBRARIES="$DYLD_INSERT_LIBRARIES''${!DYLD_INSERT_LIBRARIES:+:}${v8}/lib/libv8.dylib"
+      EOF
+    '';
 
-      buildFlags = [
-        "--with-v8-dir=${v8}" "--with-v8-include=${v8}/include"
-        "--with-v8-lib=${v8}/lib"
-      ];
-    };
+    buildFlags = [
+      "--with-v8-dir=${v8}" "--with-v8-include=${v8}/include"
+      "--with-v8-lib=${v8}/lib"
+    ];
   };
-
-in gems
+}