mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 15:44:20 +00:00
57b01b1bcf
We compute it on the fly, careful to avoid any mass rebuilds for now.
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{ stdenv, fetchurl, runCommand, python, perl, xorriso, pathsFromGraph
|
|
, arch ? "x86_64"
|
|
}:
|
|
|
|
{ packages ? []
|
|
, mirror ? "http://ftp.gwdg.de/pub/linux/sources.redhat.com/cygwin"
|
|
, extraContents ? []
|
|
}:
|
|
|
|
let
|
|
cygPkgList = if arch == "x86_64" then fetchurl {
|
|
url = "${mirror}/x86_64/setup.ini";
|
|
sha256 = "0arrxvxbl85l82iy648snx5cl952w791p45p0dfg1xpiaf96cbkj";
|
|
} else fetchurl {
|
|
url = "${mirror}/x86/setup.ini";
|
|
sha256 = "1fayx34868vd5h2nah7chiw65sl3i9qzrwvs7lrlv2h8k412vb69";
|
|
};
|
|
|
|
cygwinCross = (import ../../../../.. {
|
|
inherit (stdenv) system;
|
|
crossSystem = {
|
|
libc = "msvcrt";
|
|
platform = {};
|
|
inherit arch;
|
|
config = "${arch}-w64-mingw32";
|
|
};
|
|
}).windows.cygwinSetup;
|
|
|
|
makeCygwinClosure = { packages, packageList }: let
|
|
expr = import (runCommand "cygwin.nix" { buildInputs = [ python ]; } ''
|
|
python ${./mkclosure.py} "${packages}" ${toString packageList} > "$out"
|
|
'');
|
|
gen = { url, hash }: {
|
|
source = fetchurl {
|
|
url = "${mirror}/${url}";
|
|
sha512 = hash;
|
|
};
|
|
target = url;
|
|
};
|
|
in map gen expr;
|
|
|
|
in import ../../../../../nixos/lib/make-iso9660-image.nix {
|
|
inherit stdenv perl xorriso pathsFromGraph;
|
|
syslinux = null;
|
|
contents = [
|
|
{ source = "${cygwinCross}/bin/setup.exe";
|
|
target = "setup.exe";
|
|
}
|
|
{ source = cygPkgList;
|
|
target = "setup.ini";
|
|
}
|
|
] ++ makeCygwinClosure {
|
|
packages = cygPkgList;
|
|
packageList = packages;
|
|
} ++ extraContents;
|
|
}
|