1{
2 lib,
3 git,
4 clang,
5 fetchFromGitHub,
6 requireFile,
7 openssl,
8 xz,
9 gnutar,
10 automake,
11 autoconf,
12 libtool,
13 clangStdenv,
14}:
15
16clangStdenv.mkDerivation rec {
17 pname = "ios-cross-compile";
18 version = "9.2";
19 sdk = "iPhoneOS9.2.sdk";
20 cctools_port = fetchFromGitHub {
21 owner = "tpoechtrager";
22 repo = "cctools-port";
23 rev = "7d405492b09fa27546caaa989b8493829365deab";
24 sha256 = "0nj1q5bqdx5jm68dispybxc7wnkb6p8p2igpnap9q6qyv2r9p07w";
25 };
26 ldid = fetchFromGitHub {
27 owner = "tpoechtrager";
28 repo = "ldid";
29 rev = "3064ed628108da4b9a52cfbe5d4c1a5817811400";
30 sha256 = "1a6zaz8fgbi239l5zqx9xi3hsrv3jmfh8dkiy5gmnjs6v4gcf6sf";
31 };
32 src = requireFile rec {
33 name = "iPhoneOS9.2.sdk.tar.xz";
34 sha256 = "1l2h3cic9psrq3nmfv9aaxkdk8y2pvr0iq6apj87mb3ms9a4cqrq";
35 message = ''
36 You need to do the following steps to get a prepared
37 ios tarball.
38
39 1) Download an XCode dmg, specifically XCode_7.2.dmg
40 2) Install darling-dmg, available via: nix-env -i darling-dmg
41 3) Follow this shell history:
42
43 $ cd ~/
44 $ mkdir xcode
45 $ darling-dmg Xcode_7.2dmg xcode
46 $ cd xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
47 $ mktemp -d
48 /tmp/gar/tmp.4ZZ8kqyfqp/
49 $ mkdir /tmp/gar/tmp.4ZZ8kqyfqp/iPhoneOS9.2.sdk
50 $ cp -r iPhoneOS.sdk/* /tmp/gar/tmp.4ZZ8kqyfqp/iPhoneOS9.2.sdk
51 $ cp -r ../../../../Toolchains/XcodeDefault.xctoolchain/usr/include/c++/* \
52 /tmp/gar/tmp.4ZZ8kqyfqp/iPhoneOS9.2.sdk/usr/include/c++
53 $ tar -cf - * | xz -9 -c - > iPhoneOS9.2.sdk.tar.xz
54 $ cd ~/
55 $ fusermount -u xcode
56
57 Then do:
58
59 nix-prefetch-url file:///path/to/${name}
60
61 and run this installation again.
62 '';
63 };
64 nativeBuildInputs = [
65 autoconf
66 automake
67 ];
68 buildInputs = [
69 git
70 xz
71 gnutar
72 openssl
73 libtool
74 clang
75 ];
76 alt_wrapper = ./alt_wrapper.c;
77 builder = ./9.2_builder.sh;
78 meta = {
79 description = "Provides an iOS cross compiler from 7.1 up to iOS-${version} and ldid";
80 platforms = lib.platforms.linux;
81 hydraPlatforms = [ ];
82 maintainers = with lib.maintainers; [ fxfactorial ];
83 license = lib.licenses.gpl2;
84 };
85}