lol

ruby: Enable cross-compilation

authored by

Ben Gamari and committed by
Will Dietz
41026550 2d772d52

+19 -5
+19 -5
pkgs/development/interpreters/ruby/default.nix
··· 1 - { stdenv, lib, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub 2 , zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison 3 , autoconf, darwin ? null 4 , buildEnv, bundler, bundix, Foundation ··· 22 # Contains the ruby version heuristics 23 rubyVersion = import ./ruby-version.nix { inherit lib; }; 24 25 generic = { version, sha256 }: let 26 ver = version; 27 tag = ver.gitTag; ··· 30 isRuby25 = ver.majMin == "2.5"; 31 baseruby = self.override { useRailsExpress = false; }; 32 self = lib.makeOverridable ( 33 - { stdenv, lib, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub 34 , useRailsExpress ? true 35 , zlib, zlibSupport ? true 36 , openssl, opensslSupport ? true ··· 67 # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. 68 NROFF = "${groff}/bin/nroff"; 69 70 - nativeBuildInputs = ops useRailsExpress [ autoreconfHook bison ]; 71 buildInputs = 72 (op fiddleSupport libffi) 73 ++ (ops cursesSupport [ ncurses readline ]) ··· 129 "--with-out-ext=tk" 130 # on yosemite, "generating encdb.h" will hang for a very long time without this flag 131 "--with-setjmp-type=setjmp" 132 - ]; 133 134 installFlags = stdenv.lib.optionalString docSupport "install-doc"; 135 # Bundler tries to create this directory 136 postInstall = '' 137 # Update rubygems 138 pushd rubygems 139 - $out/bin/ruby setup.rb 140 popd 141 142 # Remove unnecessary groff reference from runtime closure, since it's big
··· 1 + { stdenv, buildPackages, lib 2 + , fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub 3 , zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison 4 , autoconf, darwin ? null 5 , buildEnv, bundler, bundix, Foundation ··· 23 # Contains the ruby version heuristics 24 rubyVersion = import ./ruby-version.nix { inherit lib; }; 25 26 + # Needed during postInstall 27 + buildRuby = 28 + if stdenv.hostPlatform == stdenv.buildPlatform 29 + then "$out/bin/ruby" 30 + else "${buildPackages.ruby}/bin/ruby"; 31 + 32 generic = { version, sha256 }: let 33 ver = version; 34 tag = ver.gitTag; ··· 37 isRuby25 = ver.majMin == "2.5"; 38 baseruby = self.override { useRailsExpress = false; }; 39 self = lib.makeOverridable ( 40 + { stdenv, buildPackages, lib 41 + , fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub 42 , useRailsExpress ? true 43 , zlib, zlibSupport ? true 44 , openssl, opensslSupport ? true ··· 75 # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. 76 NROFF = "${groff}/bin/nroff"; 77 78 + nativeBuildInputs = 79 + ops useRailsExpress [ autoreconfHook bison ] 80 + ++ ops (stdenv.buildPlatform != stdenv.hostPlatform) [ 81 + buildPackages.ruby 82 + ]; 83 buildInputs = 84 (op fiddleSupport libffi) 85 ++ (ops cursesSupport [ ncurses readline ]) ··· 141 "--with-out-ext=tk" 142 # on yosemite, "generating encdb.h" will hang for a very long time without this flag 143 "--with-setjmp-type=setjmp" 144 + ] 145 + ++ op (stdenv.hostPlatform != stdenv.buildPlatform) 146 + "--with-baseruby=${buildRuby}"; 147 148 installFlags = stdenv.lib.optionalString docSupport "install-doc"; 149 # Bundler tries to create this directory 150 postInstall = '' 151 # Update rubygems 152 pushd rubygems 153 + ${buildRuby} setup.rb 154 popd 155 156 # Remove unnecessary groff reference from runtime closure, since it's big