cctools: Remove a bunch of stuff no longer needed for Linux
This commit is contained in:
parent
5f1ec8e6d9
commit
266adab32d
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchFromGitHub, makeWrapper, autoconf, automake, libtool_2, autoreconfHook
|
{ stdenv, fetchFromGitHub, makeWrapper, autoconf, automake, libtool_2, autoreconfHook
|
||||||
, llvm, libcxx, libcxxabi, clang, libuuid
|
, libcxx, libcxxabi, libuuid
|
||||||
, libobjc ? null, maloader ? null, xctoolchain ? null
|
, libobjc ? null, maloader ? null
|
||||||
, hostPlatform, targetPlatform
|
, hostPlatform, targetPlatform
|
||||||
, enableDumpNormalizedLibArgs ? false
|
, enableDumpNormalizedLibArgs ? false
|
||||||
}:
|
}:
|
||||||
@ -22,7 +22,7 @@ let
|
|||||||
in
|
in
|
||||||
|
|
||||||
# Non-Darwin alternatives
|
# Non-Darwin alternatives
|
||||||
assert (!hostPlatform.isDarwin) -> (maloader != null && xctoolchain != null);
|
assert (!hostPlatform.isDarwin) -> maloader != null;
|
||||||
|
|
||||||
assert enableDumpNormalizedLibArgs -> (!useOld);
|
assert enableDumpNormalizedLibArgs -> (!useOld);
|
||||||
|
|
||||||
@ -57,8 +57,6 @@ let
|
|||||||
autoreconfHook
|
autoreconfHook
|
||||||
];
|
];
|
||||||
buildInputs = [ libuuid ] ++
|
buildInputs = [ libuuid ] ++
|
||||||
# Only need llvm and clang if the stdenv isn't already clang-based (TODO: just make a stdenv.cc.isClang)
|
|
||||||
stdenv.lib.optionals (!stdenv.isDarwin) [ llvm clang ] ++
|
|
||||||
stdenv.lib.optionals stdenv.isDarwin [ libcxxabi libobjc ];
|
stdenv.lib.optionals stdenv.isDarwin [ libcxxabi libobjc ];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
@ -80,9 +78,6 @@ let
|
|||||||
|
|
||||||
# TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
|
# TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
|
||||||
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
||||||
configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [
|
|
||||||
"CXXFLAGS=-I${libcxx}/include/c++/v1"
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp
|
sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp
|
||||||
@ -108,8 +103,6 @@ let
|
|||||||
# include_next "unistd.h"
|
# include_next "unistd.h"
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
|
||||||
sed -i -e 's|clang++|& -I${libcxx}/include/c++/v1|' cctools/autogen.sh
|
|
||||||
'' + stdenv.lib.optionalString useOld ''
|
'' + stdenv.lib.optionalString useOld ''
|
||||||
cd cctools
|
cd cctools
|
||||||
'';
|
'';
|
||||||
@ -128,20 +121,11 @@ let
|
|||||||
popd
|
popd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall =
|
postInstall = ''
|
||||||
if hostPlatform.isDarwin
|
|
||||||
then ''
|
|
||||||
cat >$out/bin/dsymutil << EOF
|
cat >$out/bin/dsymutil << EOF
|
||||||
#!${stdenv.shell}
|
#!${stdenv.shell}
|
||||||
EOF
|
EOF
|
||||||
chmod +x $out/bin/dsymutil
|
chmod +x $out/bin/dsymutil
|
||||||
''
|
|
||||||
else ''
|
|
||||||
for tool in dyldinfo dwarfdump dsymutil; do
|
|
||||||
${makeWrapper}/bin/makeWrapper "${maloader}/bin/ld-mac" "$out/bin/${targetPlatform.config}-$tool" \
|
|
||||||
--add-flags "${xctoolchain}/bin/$tool"
|
|
||||||
ln -s "$out/bin/${targetPlatform.config}-$tool" "$out/bin/$tool"
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
@ -29,7 +29,6 @@ in
|
|||||||
inherit (darwin) libobjc maloader;
|
inherit (darwin) libobjc maloader;
|
||||||
stdenv = if stdenv.isDarwin then stdenv else pkgs.libcxxStdenv;
|
stdenv = if stdenv.isDarwin then stdenv else pkgs.libcxxStdenv;
|
||||||
libcxxabi = pkgs.libcxxabi;
|
libcxxabi = pkgs.libcxxabi;
|
||||||
xctoolchain = darwin.xcode.toolchain;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cf-private = callPackage ../os-specific/darwin/cf-private {
|
cf-private = callPackage ../os-specific/darwin/cf-private {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user