diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-14 08:11:30 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-14 08:11:30 +0000 |
commit | 2aba922d30143044728eae06f42e0bfb90d5b25a (patch) | |
tree | fe7684e3f355d2228c9d72c8bc93fef3d5087dbd /pkgs/stdenv/default.nix | |
parent | 686411910497acbf53588c6f2d6610ad9601247f (diff) | |
download | nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.tar nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.tar.gz nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.tar.bz2 nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.tar.lz nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.tar.xz nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.tar.zst nixpkgs-2aba922d30143044728eae06f42e0bfb90d5b25a.zip |
My first attempt at getting cross compilers in nixpkgs.
My idea is to provide special stdenv expressions that will contain in the path additional cross compilers. As most expressions for programs accept a stdenv parameter, we could substitute this parameter with the special stdenv, which will have a generic builder that attempts the usual "--target=..." and can additionally have an env variable like "cross" with the target architecture set. So, finally we could have additional expressions like this: bashRealArm = makeOverridable (import ../shells/bash) { inherit fetchurl bison; stdenv = stdenvCross "armv5tel-unknown-linux-gnueabi"; }; Meanwhile it does not work - I still cannot get the cross-gcc to build. I think it does not fill the previous expressions with a lot of noise, so I think it may be a good path to follow. I only touched some files of the current stdenv: gcc-4.3, kernel headers 2.6.28, glibc 2.9, ... I tried to use the gcc-cross-wrapper, that may be very outdated. Maybe I will update it, or update the gcc-wrapper expression to make it fit the cross tools, but meanwhile I even cannot build gcc, so I have not tested the wrapper. This new idea on cross compiling is not similar to that of the nixpkgs/branches/cross-compilation, which mostly added bare new expressions for anything to be cross compiled, if I understood it correctly. I cared not to break anything of the usual stdenv in all this work. svn path=/nixpkgs/branches/stdenv-updates/; revision=18343
Diffstat (limited to 'pkgs/stdenv/default.nix')
-rw-r--r-- | pkgs/stdenv/default.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index ed8f0e39f5f..19bbb371a31 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -10,7 +10,7 @@ # system, e.g., cygwin and mingw builds on i686-cygwin. Most people # can ignore it. -{system, stdenvType ? system, allPackages ? import ../..}: +{system, stdenvType ? system, allPackages ? import ../.., cross ? null}: assert system != "i686-cygwin" -> system == stdenvType; @@ -41,7 +41,7 @@ rec { # Linux standard environment. - stdenvLinux = (import ./linux {inherit system allPackages;}).stdenvLinux; + stdenvLinux = (import ./linux {inherit system allPackages cross;}).stdenvLinux; # MinGW/MSYS standard environment. |