vm/windows: Allow to specify a different arch.
So far, we determined this based on stdenv.is64bit, but there are cases where you want to run/build a 32bit program on a 64 bit Windows. This is now possible, by passing windowsImage.arch = "i686" | "x86_64" to runInWindowsVM. Based an what was passed, the corresponding Cygwin packages and setup.exe are bootstrapped. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
c4d5757e29
commit
bd2d120c08
@ -3,7 +3,7 @@
|
|||||||
, samba, socat, vde2, cdrkit, pathsFromGraph
|
, samba, socat, vde2, cdrkit, pathsFromGraph
|
||||||
}:
|
}:
|
||||||
|
|
||||||
{ isoFile, productKey }:
|
{ isoFile, productKey, arch ? null }:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
@ -15,6 +15,9 @@ let
|
|||||||
|
|
||||||
mkCygwinImage = import ./cygwin-iso {
|
mkCygwinImage = import ./cygwin-iso {
|
||||||
inherit stdenv fetchurl runCommand python perl cdrkit pathsFromGraph;
|
inherit stdenv fetchurl runCommand python perl cdrkit pathsFromGraph;
|
||||||
|
arch = let
|
||||||
|
defaultArch = if stdenv.is64bit then "x86_64" else "i686";
|
||||||
|
in if arch == null then defaultArch else arch;
|
||||||
};
|
};
|
||||||
|
|
||||||
installer = import ./install {
|
installer = import ./install {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
{ stdenv, fetchurl, runCommand, python, perl, cdrkit, pathsFromGraph }:
|
{ stdenv, fetchurl, runCommand, python, perl, cdrkit, pathsFromGraph
|
||||||
|
, arch ? "x86_64"
|
||||||
|
}:
|
||||||
|
|
||||||
{ packages ? []
|
{ packages ? []
|
||||||
, mirror ? "http://ftp.gwdg.de/pub/linux/sources.redhat.com/cygwin"
|
, mirror ? "http://ftp.gwdg.de/pub/linux/sources.redhat.com/cygwin"
|
||||||
@ -6,7 +8,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cygPkgList = if stdenv.is64bit then fetchurl {
|
cygPkgList = if arch == "x86_64" then fetchurl {
|
||||||
url = "${mirror}/x86_64/setup.ini";
|
url = "${mirror}/x86_64/setup.ini";
|
||||||
sha256 = "0ljsxdkx9s916wp28kcvql3bjx80zzzidan6jicby7i9s3sm96n9";
|
sha256 = "0ljsxdkx9s916wp28kcvql3bjx80zzzidan6jicby7i9s3sm96n9";
|
||||||
} else fetchurl {
|
} else fetchurl {
|
||||||
@ -20,13 +22,9 @@ let
|
|||||||
libc = "msvcrt";
|
libc = "msvcrt";
|
||||||
platform = {};
|
platform = {};
|
||||||
openssl.system = "mingw64";
|
openssl.system = "mingw64";
|
||||||
} // (if stdenv.is64bit then {
|
inherit arch;
|
||||||
config = "x86_64-w64-mingw32";
|
config = "${arch}-w64-mingw32";
|
||||||
arch = "x86_64";
|
};
|
||||||
} else {
|
|
||||||
config = "i686-w64-mingw32";
|
|
||||||
arch = "i686";
|
|
||||||
});
|
|
||||||
}).windows.cygwinSetup.crossDrv;
|
}).windows.cygwinSetup.crossDrv;
|
||||||
|
|
||||||
makeCygwinClosure = { packages, packageList }: let
|
makeCygwinClosure = { packages, packageList }: let
|
||||||
|
Loading…
x
Reference in New Issue
Block a user