mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
3987ea9a9d
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; }; } |
||
---|---|---|
.. | ||
apple-sdk | ||
apple-source-releases | ||
binutils | ||
cctools | ||
chunkwm | ||
CoreSymbolication | ||
darling | ||
DarwinTools | ||
duti | ||
ghc-standalone-archive | ||
goku | ||
insert_dylib | ||
iproute2mac | ||
khd | ||
kwm | ||
libtapi | ||
lsusb | ||
m-cli | ||
maloader | ||
native-x11-and-opengl | ||
noah | ||
opencflite | ||
osxfuse | ||
osxsnarf | ||
qes | ||
reattach-to-user-namespace | ||
skhd | ||
smimesign | ||
stubs | ||
swift-corelibs | ||
trash | ||
usr-include | ||
wifi-password | ||
xcode |