Merge pull request #42599 from obsidiansystems/xcodever-in-system
xcode: add xcodePlatform to system
This commit is contained in:
commit
e4d9ce9061
@ -46,7 +46,6 @@ rec {
|
|||||||
# Misc boolean options
|
# Misc boolean options
|
||||||
useAndroidPrebuilt = false;
|
useAndroidPrebuilt = false;
|
||||||
useiOSPrebuilt = false;
|
useiOSPrebuilt = false;
|
||||||
isiPhoneSimulator = false;
|
|
||||||
} // mapAttrs (n: v: v final.parsed) inspect.predicates
|
} // mapAttrs (n: v: v final.parsed) inspect.predicates
|
||||||
// args;
|
// args;
|
||||||
in assert final.useAndroidPrebuilt -> final.isAndroid;
|
in assert final.useAndroidPrebuilt -> final.isAndroid;
|
||||||
|
@ -101,6 +101,7 @@ rec {
|
|||||||
# config = "aarch64-apple-darwin14";
|
# config = "aarch64-apple-darwin14";
|
||||||
sdkVer = "10.2";
|
sdkVer = "10.2";
|
||||||
xcodeVer = "8.2";
|
xcodeVer = "8.2";
|
||||||
|
xcodePlatform = "iPhoneOS";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
platform = {};
|
platform = {};
|
||||||
};
|
};
|
||||||
@ -110,6 +111,7 @@ rec {
|
|||||||
# config = "arm-apple-darwin10";
|
# config = "arm-apple-darwin10";
|
||||||
sdkVer = "10.2";
|
sdkVer = "10.2";
|
||||||
xcodeVer = "8.2";
|
xcodeVer = "8.2";
|
||||||
|
xcodePlatform = "iPhoneOS";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
platform = {};
|
platform = {};
|
||||||
};
|
};
|
||||||
@ -119,8 +121,8 @@ rec {
|
|||||||
# config = "x86_64-apple-darwin14";
|
# config = "x86_64-apple-darwin14";
|
||||||
sdkVer = "10.2";
|
sdkVer = "10.2";
|
||||||
xcodeVer = "8.2";
|
xcodeVer = "8.2";
|
||||||
|
xcodePlatform = "iPhoneSimulator";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
isiPhoneSimulator = true;
|
|
||||||
platform = {};
|
platform = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,8 +131,8 @@ rec {
|
|||||||
# config = "i386-apple-darwin11";
|
# config = "i386-apple-darwin11";
|
||||||
sdkVer = "10.2";
|
sdkVer = "10.2";
|
||||||
xcodeVer = "8.2";
|
xcodeVer = "8.2";
|
||||||
|
xcodePlatform = "iPhoneSimulator";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
isiPhoneSimulator = true;
|
|
||||||
platform = {};
|
platform = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ rec {
|
|||||||
sdk = rec {
|
sdk = rec {
|
||||||
name = "ios-sdk";
|
name = "ios-sdk";
|
||||||
type = "derivation";
|
type = "derivation";
|
||||||
outPath = xcode + "/Contents/Developer/Platforms/iPhone${sdkType}.platform/Developer/SDKs/iPhone${sdkType}${version}.sdk";
|
outPath = xcode + "/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${version}.sdk";
|
||||||
|
|
||||||
sdkType = if targetPlatform.isiPhoneSimulator then "Simulator" else "OS";
|
platform = targetPlatform.xcodePlatform;
|
||||||
version = targetPlatform.sdkVer;
|
version = targetPlatform.sdkVer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -48,7 +48,10 @@ rec {
|
|||||||
mv cc-cflags.tmp $out/nix-support/cc-cflags
|
mv cc-cflags.tmp $out/nix-support/cc-cflags
|
||||||
echo "-target ${targetPlatform.config} -arch ${iosPlatformArch targetPlatform}" >> $out/nix-support/cc-cflags
|
echo "-target ${targetPlatform.config} -arch ${iosPlatformArch targetPlatform}" >> $out/nix-support/cc-cflags
|
||||||
echo "-isystem ${sdk}/usr/include -isystem ${sdk}/usr/include/c++/4.2.1/ -stdlib=libstdc++" >> $out/nix-support/cc-cflags
|
echo "-isystem ${sdk}/usr/include -isystem ${sdk}/usr/include/c++/4.2.1/ -stdlib=libstdc++" >> $out/nix-support/cc-cflags
|
||||||
echo "${if targetPlatform.isiPhoneSimulator then "-mios-simulator-version-min" else "-miphoneos-version-min"}=${minSdkVersion}" >> $out/nix-support/cc-cflags
|
'' + stdenv.lib.optionalString (sdk.platform == "iPhoneSimulator") ''
|
||||||
|
echo "-mios-simulator-version-min=${minSdkVersion}" >> $out/nix-support/cc-cflags
|
||||||
|
'' + stdenv.lib.optionalString (sdk.platform == "iPhoneOS") ''
|
||||||
|
echo "-miphoneos-version-min=${minSdkVersion}" >> $out/nix-support/cc-cflags
|
||||||
'';
|
'';
|
||||||
}) // {
|
}) // {
|
||||||
inherit sdk;
|
inherit sdk;
|
||||||
@ -60,7 +63,7 @@ rec {
|
|||||||
};
|
};
|
||||||
} ''
|
} ''
|
||||||
if ! [ -d ${sdk} ]; then
|
if ! [ -d ${sdk} ]; then
|
||||||
echo "You must have version ${sdk.version} of the iPhone${sdk.sdkType} sdk installed at ${sdk}" >&2
|
echo "You must have version ${sdk.version} of the ${sdk.platform} sdk installed at ${sdk}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
ln -s ${sdk}/usr $out
|
ln -s ${sdk}/usr $out
|
@ -44,7 +44,7 @@ in
|
|||||||
|
|
||||||
insert_dylib = callPackage ../os-specific/darwin/insert_dylib { };
|
insert_dylib = callPackage ../os-specific/darwin/insert_dylib { };
|
||||||
|
|
||||||
iosSdkPkgs = darwin.callPackage ../os-specific/darwin/ios-sdk-pkgs {
|
iosSdkPkgs = darwin.callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix {
|
||||||
buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk;
|
buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk;
|
||||||
targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs;
|
targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs;
|
||||||
xcode = darwin.xcode;
|
xcode = darwin.xcode;
|
||||||
|
Loading…
Reference in New Issue
Block a user