about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-09-15 09:56:06 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-09-15 09:56:06 +0000
commite6a787f44a39a49dae8a0d399c26fcb64501dd59 (patch)
treef11a70a339bc194570ac63743aaf9025d1334095 /pkgs/development
parent6babe5dea4135ee9cca45b2f0c3e8bd422a89c29 (diff)
Making lua and boost cross-build.
svn path=/nixpkgs/trunk/; revision=23807
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/interpreters/lua-5/default.nix9
-rw-r--r--pkgs/development/libraries/boost/default.nix19
2 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index 160f28270035b..19a5599347ff8 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -23,6 +23,15 @@ stdenv.mkDerivation {
   '';
   buildInputs = [ ncurses readline ];
 
+  crossAttrs = {
+    preBuild = ''
+      sed -i -e "s/ gcc/$crossConfig-gcc/" \
+        -e "s/ ar/$crossConfig-ar/" \
+        -e "s/ ranlib/$crossConfig-ranlib/" \
+        src/Makefile
+    '';
+  };
+
   meta = {
     homepage = "http://www.lua.org";
     description = "Lua is a powerful, fast, lightweight, embeddable scripting language.";
diff --git a/pkgs/development/libraries/boost/default.nix b/pkgs/development/libraries/boost/default.nix
index 026ca1e356d5b..c4b9f23bb2301 100644
--- a/pkgs/development/libraries/boost/default.nix
+++ b/pkgs/development/libraries/boost/default.nix
@@ -58,4 +58,23 @@ stdenv.mkDerivation {
   buildPhase = "./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
 
   installPhase = ":";
+
+  crossAttrs = rec {
+    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
+    # override them.
+    propagatedBuildInputs = buildInputs;
+    # We want to substitute the contents of configureFlags, removing thus the
+    # usual --build and --host added on cross building.
+    preConfigure = ''
+      export configureFlags="--prefix=$out --without-icu"
+    '';
+    buildPhase = ''
+      set -x
+      cat << EOF > user-config.jam
+      using gcc : cross : $crossConfig-g++ ;
+      EOF
+      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+    '';
+  };
 }