tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
xcbuild: fix toolchain on Linux
Matthew Bauer
9 years ago
437bdc5e
0b6bfa49
+35
-30
3 changed files
expand all
collapse all
unified
split
pkgs
development
tools
xcbuild
toolchain.nix
wrapper.nix
top-level
all-packages.nix
+33
-29
pkgs/development/tools/xcbuild/toolchain.nix
···
1
1
{stdenv, writeText, toolchainName, xcbuild
2
2
-
, cc, llvm, cctools, gcc, bootstrap_cmds, binutils
2
2
+
, llvm, cctools, gcc, bootstrap_cmds, binutils
3
3
, yacc, flex, m4, unifdef, gperf, indent, ctags, makeWrapper}:
4
4
5
5
let
···
13
13
stdenv.mkDerivation {
14
14
name = "nixpkgs.xctoolchain";
15
15
buildInputs = [ xcbuild makeWrapper ];
16
16
-
propagatedBuildInputs = [ cc cctools llvm gcc bootstrap_cmds binutils yacc flex m4 unifdef gperf indent ];
16
16
+
17
17
+
propagatedBuildInputs = [ llvm gcc yacc flex m4 unifdef gperf indent ]
18
18
+
++ stdenv.lib.optionals stdenv.isDarwin [ cctools bootstrap_cmds binutils ];
19
19
+
## cctools should build on Linux but it doesn't currentl
20
20
+
17
21
buildCommand = ''
18
22
mkdir -p $out
19
23
plutil -convert xml1 -o $out/ToolchainInfo.plist ${writeText "ToolchainInfo.plist" (builtins.toJSON ToolchainInfo)}
···
25
29
26
30
mkdir -p $out/usr/bin
27
31
cd $out/usr/bin
28
28
-
ln -s ${cc}/bin/cpp
29
29
-
ln -s ${cc}/bin/c++
30
30
-
ln -s ${cc}/bin/cc
32
32
+
ln -s ${stdenv.cc}/bin/cpp
33
33
+
ln -s ${stdenv.cc}/bin/c++
34
34
+
ln -s ${stdenv.cc}/bin/cc
31
35
ln -s c++ clang++
32
36
ln -s cc clang
33
37
34
34
-
ln -s ${cctools}/bin/ar
35
35
-
ln -s ${cctools}/bin/as
36
36
-
ln -s ${cctools}/bin/nm
37
37
-
ln -s ${cctools}/bin/nmedit
38
38
-
ln -s ${cctools}/bin/ld
39
39
-
ln -s ${cctools}/bin/libtool
40
40
-
ln -s ${cctools}/bin/strings
41
41
-
ln -s ${cctools}/bin/strip
42
42
-
ln -s ${cctools}/bin/install_name_tool
43
43
-
ln -s ${cctools}/bin/bitcode_strip
44
44
-
ln -s ${cctools}/bin/codesign_allocate
45
45
-
ln -s ${cctools}/bin/dsymutil
46
46
-
ln -s ${cctools}/bin/dyldinfo
47
47
-
ln -s ${cctools}/bin/otool
48
48
-
ln -s ${cctools}/bin/unwinddump
49
49
-
ln -s ${cctools}/bin/size
50
50
-
ln -s ${cctools}/bin/segedit
51
51
-
ln -s ${cctools}/bin/pagestuff
52
52
-
ln -s ${cctools}/bin/ranlib
53
53
-
ln -s ${cctools}/bin/redo_prebinding
54
54
-
55
38
ln -s ${llvm}/bin/llvm-cov
56
39
ln -s ${llvm}/bin/llvm-dsymutil
57
40
ln -s ${llvm}/bin/llvm-dwarfdump
···
74
57
ln -s ${unifdef}/bin/unifdef
75
58
ln -s ${unifdef}/bin/unifdefall
76
59
77
77
-
ln -s ${bootstrap_cmds}/bin/mig
78
78
-
79
60
ln -s ${gperf}/bin/gperf
80
61
ln -s ${gcc}/bin/gcov
81
62
ln -s ${gcc}/bin/mkdep
82
63
ln -s ${indent}/bin/indent
64
64
+
ln -s ${ctags}/bin/ctags
65
65
+
'' + stdenv.lib.optionalString stdenv.isDarwin ''
66
66
+
ln -s ${bootstrap_cmds}/bin/mig
83
67
ln -s ${binutils}/bin/lipo
84
84
-
ln -s ${ctags}/bin/ctags
68
68
+
69
69
+
ln -s ${cctools}/bin/ar
70
70
+
ln -s ${cctools}/bin/as
71
71
+
ln -s ${cctools}/bin/nm
72
72
+
ln -s ${cctools}/bin/nmedit
73
73
+
ln -s ${cctools}/bin/ld
74
74
+
ln -s ${cctools}/bin/libtool
75
75
+
ln -s ${cctools}/bin/strings
76
76
+
ln -s ${cctools}/bin/strip
77
77
+
ln -s ${cctools}/bin/install_name_tool
78
78
+
ln -s ${cctools}/bin/bitcode_strip
79
79
+
ln -s ${cctools}/bin/codesign_allocate
80
80
+
ln -s ${cctools}/bin/dsymutil
81
81
+
ln -s ${cctools}/bin/dyldinfo
82
82
+
ln -s ${cctools}/bin/otool
83
83
+
ln -s ${cctools}/bin/unwinddump
84
84
+
ln -s ${cctools}/bin/size
85
85
+
ln -s ${cctools}/bin/segedit
86
86
+
ln -s ${cctools}/bin/pagestuff
87
87
+
ln -s ${cctools}/bin/ranlib
88
88
+
ln -s ${cctools}/bin/redo_prebinding
85
89
'';
86
90
}
87
91
+1
-1
pkgs/development/tools/xcbuild/wrapper.nix
···
12
12
};
13
13
14
14
toolchain = callPackage ./toolchain.nix {
15
15
-
inherit cctools bootstrap_cmds toolchainName xcbuild binutils;
15
15
+
inherit cctools bootstrap_cmds toolchainName xcbuild binutils stdenv;
16
16
};
17
17
18
18
sdk = callPackage ./sdk.nix {
+1
pkgs/top-level/all-packages.nix
···
6435
6435
xcbuild = callPackage ../development/tools/xcbuild/wrapper.nix {
6436
6436
inherit (darwin.apple_sdk.frameworks) CoreServices CoreGraphics ImageIO;
6437
6437
inherit (darwin) cctools bootstrap_cmds binutils;
6438
6438
+
stdenv = clangStdenv;
6438
6439
};
6439
6440
6440
6441
xmlindent = callPackage ../development/web/xmlindent {};