Daiderd Jordan
3987ea9a9d
mpv: add flag for swift on darwin
While we currently don't have a pure swift build on macOS it's possible
to build mpv using the swift compiler from CLT. eg.
self: super:
let
CommandLineTools = "/Library/Developer/CommandLineTools";
in
{
swift = super.stdenv.mkDerivation {
name = "swift-CommandLineTools-0.0.0";
phases = [ "installPhase" "fixupPhase" ];
propagatedBuildInputs = [ self.darwin.DarwinTools ];
installPhase = ''
mkdir -p $out/bin $out/lib
ln -s ${CommandLineTools}/usr/bin/swift $out/bin
ln -s ${CommandLineTools}/usr/lib/swift $out/lib
ln -s ${CommandLineTools}/SDKs $out
'';
setupHook = builtins.toFile "hook" ''
addCommandLineTools() {
echo >&2
echo "WARNING: this is impure and unreliable, make sure the CommandLineTools are installed!" >&2
echo " $ xcode-select --install" >&2
echo >&2
[ -d ${CommandLineTools} ]
export NIX_LDFLAGS+=" -L@out@/lib/swift/macosx"
export SWIFT=swift
export SWIFT_LIB_DYNAMIC=@out@/lib/swift/macosx
export MACOS_SDK_VERSION=$(sw_vers -productVersion | awk -F. '{print $1 "." $2}')
export MACOS_SDK=@out@/SDKs/MacOSX$MACOS_SDK_VERSION.sdk
}
prePhases+=" addCommandLineTools"
'';
__impureHostDeps = [ CommandLineTools ];
};
mpv = super.mpv.override { swiftSupport = true; };
}
2020-02-06 14:15:35 +01:00
..
2020-02-06 14:15:35 +01:00
2020-01-18 16:43:03 +01:00
2019-11-24 18:36:40 +00:00
2020-01-03 15:20:55 -05:00
2019-08-15 13:41:18 +01:00
2018-04-09 18:35:35 -05:00
2019-04-20 23:17:04 -04:00
2017-01-08 02:28:44 -06:00
2019-08-15 13:41:18 +01:00
2018-01-02 21:00:13 -05:00
2019-08-15 13:41:18 +01:00
2019-01-06 22:34:19 -06:00
2020-01-13 11:41:23 +01:00
2019-08-15 13:41:18 +01:00
2019-08-15 13:41:18 +01:00
2020-01-13 11:41:23 +01:00
2019-08-28 11:07:32 +00:00
2019-08-15 13:41:18 +01:00
2018-09-08 20:08:34 +02:00
2018-05-03 13:09:20 -05:00
2019-06-12 21:30:00 -05:00
2019-08-15 13:41:18 +01:00
2019-08-28 11:07:32 +00:00
2019-10-30 08:57:59 -07:00
2019-08-28 11:07:32 +00:00
2020-01-08 13:50:08 +03:00
2019-08-15 13:41:18 +01:00
2019-08-15 13:41:18 +01:00
2019-02-26 14:10:49 +00:00
2020-01-13 11:13:06 +01:00
2019-08-15 13:41:18 +01:00
2017-08-27 17:06:45 +02:00
2019-09-10 00:40:05 +02:00
2020-01-03 15:20:54 -05:00