2014-09-30 06:03:55 +01:00
|
|
|
{ stdenv, curl, adc_user, adc_pass }:
|
|
|
|
|
2014-10-02 02:57:27 +01:00
|
|
|
{ # Path to fetch.
|
|
|
|
path
|
2014-09-30 06:03:55 +01:00
|
|
|
|
|
|
|
# Hash of the downloaded file
|
|
|
|
, sha256
|
|
|
|
|
|
|
|
, # Additional curl options needed for the download to succeed.
|
|
|
|
curlOpts ? ""
|
|
|
|
|
2014-10-02 02:57:27 +01:00
|
|
|
, # Name of the file. If empty, use the basename of `path'.
|
2014-09-30 06:03:55 +01:00
|
|
|
name ? ""
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2014-10-02 02:57:27 +01:00
|
|
|
url = "https://developer.apple.com/downloads/download.action?path=${path}";
|
|
|
|
|
|
|
|
name = if name != "" then name else baseNameOf path;
|
2014-09-30 06:03:55 +01:00
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
# Password-guarded files from ADC are certainly unfree, as far as we're concerned!
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
|
|
|
};
|
|
|
|
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHash = sha256;
|
|
|
|
outputHashMode = "flat";
|
|
|
|
|
2014-10-02 02:57:27 +01:00
|
|
|
inherit curlOpts adc_user adc_pass;
|
2014-09-30 06:03:55 +01:00
|
|
|
|
|
|
|
preferLocalBuild = true;
|
2014-10-02 02:57:27 +01:00
|
|
|
}
|