summary refs log tree commit diff
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-05 23:22:36 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-05 23:22:36 +0000
commit997723ec9bca2979d41c1e00ac334a8d7e8e6a3b (patch)
treee17c9304826fa9d35376a87c638597fa702e7521
parent3b54414f3143edf5d18c10b2efaa8c79856d3af5 (diff)
downloadnixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.tar
nixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.tar.gz
nixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.tar.bz2
nixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.tar.lz
nixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.tar.xz
nixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.tar.zst
nixlib-997723ec9bca2979d41c1e00ac334a8d7e8e6a3b.zip
Trying to make nixUnstable cross-build.
It fails because it builds bin2c for the host system, instead of the build system.
I will wait for a fix upstream.

svn path=/nixpkgs/trunk/; revision=20445
-rw-r--r--pkgs/development/libraries/openssl/default.nix20
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix3
-rw-r--r--pkgs/top-level/release.nix18
3 files changed, 33 insertions, 8 deletions
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index e9d75b78ebf2..4d0e0cd8afbd 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -1,5 +1,11 @@
 { stdenv, fetchurl, perl }:
 
+let
+  opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ]
+    (throw "openssl needs its platform name cross building" null)
+    stdenv.cross;
+in
+
 stdenv.mkDerivation rec {
   name = "openssl-0.9.8l";
   
@@ -10,12 +16,24 @@ stdenv.mkDerivation rec {
 
   patches = [ ./darwin-arch.patch ];
   
-  buildInputs = [ perl ];
+  buildNativeInputs = [ perl ];
 
   configureScript = "./config";
   
   configureFlags = "shared";
 
+  crossAttrs = {
+    configurePhase = ''
+      export cross=$crossSystem-
+      ./Configure --prefix=$out ${opensslCrossSystem} shared
+    '';
+    buildPhase = ''
+      make CC=$crossConfig-gcc \
+        AR="$crossConfig-ar r" \
+        RANLIB=$crossConfig-ranlib
+    '';
+  };
+
   meta = {
     homepage = http://www.openssl.org/;
     description = "A cryptographic library that implements the SSL and TLS protocols";
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index f3c8ab1b34cf..8687a4af884b 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "844e5878d55a68ae2aac657718a1960dcfc943f6738ebdfb2bc93e8c462d0ad7";
   };
 
-  buildInputs = [perl curl openssl];
+  buildNativeInputs = [perl];
+  buildInputs = [curl openssl];
 
   configureFlags = ''
     --with-store-dir=${storeDir} --localstatedir=${stateDir}
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 1df7507906ee..851294de9571 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -704,12 +704,13 @@ in {
 /* Test some cross builds to the Sheevaplug */
 let
   crossSystem = {
-      config = "armv5tel-unknown-linux-gnueabi";  
-      bigEndian = false;
-      arch = "arm";
-      float = "soft";
-      withTLS = true;
-      platform = pkgs.platforms.sheevaplug;
+    config = "armv5tel-unknown-linux-gnueabi";  
+    bigEndian = false;
+    arch = "arm";
+    float = "soft";
+    withTLS = true;
+    platform = pkgs.platforms.sheevaplug;
+    openssl.system = "linux-generic32";
   };
   nativePlatforms = linux;
 in {
@@ -722,6 +723,7 @@ in {
     xorg = {
       #xorgserver = nativePlatforms;
     };
+    nixUnstable = linux;
     linuxPackages_2_6_32.kernel = linux;
     linuxPackages_2_6_33.kernel = linux;
     gdbCross = nativePlatforms;
@@ -745,6 +747,7 @@ let
       kernelAutoModules = false;
       kernelTarget = "vmlinux.bin";
     };
+    openssl.system = "linux-generic32";
   };
   nativePlatforms = linux;
 in {
@@ -757,6 +760,7 @@ in {
     xorg = {
       #xorgserver = nativePlatforms;
     };
+    nixUnstable = linux;
     linuxPackages_2_6_32.kernel = linux;
     linuxPackages_2_6_33.kernel = linux;
     gdbCross = nativePlatforms;
@@ -781,6 +785,7 @@ let
         kernelTarget = "zImage";
         uboot = null;
     };
+    openssl.system = "linux64-sparcv9";
   };
   nativePlatforms = linux;
 in {
@@ -793,6 +798,7 @@ in {
     xorg = {
       #xorgserver = nativePlatforms;
     };
+    nixUnstable = linux;
     linuxPackages_2_6_32.kernel = linux;
     linuxPackages_2_6_33.kernel = linux;
     gdbCross = nativePlatforms;