3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/darwin
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
..
apple-sdk mpv: add flag for swift on darwin 2020-02-06 14:15:35 +01:00
apple-source-releases graalvm8: 19.1.1 -> 19.2.1 2020-01-18 16:43:03 +01:00
binutils cctools, darwin biutils: Use pname and version 2019-11-24 18:36:40 +00:00
cctools cctools: fixup gnu-config detection 2020-01-03 15:20:55 -05:00
chunkwm treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
CoreSymbolication
darling
DarwinTools
duti treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
ghc-standalone-archive
goku treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
insert_dylib
iproute2mac darwin.iproute2mac: explicitly use python2 2020-01-13 11:41:23 +01:00
khd treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
kwm treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
libtapi darwin.libtapi: python2 -> python3 2020-01-13 11:41:23 +01:00
lsusb treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
m-cli treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
maloader
native-x11-and-opengl
noah
opencflite treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
osxfuse treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
osxsnarf osxsnarf: init at 0.1.0 2019-10-30 08:57:59 -07:00
qes treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
reattach-to-user-namespace reattach-to-user-namespace: 2.7 -> 2.8 2020-01-08 13:50:08 +03:00
skhd treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
smimesign treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
stubs
swift-corelibs darwin.CF: python2 -> python3 2020-01-13 11:13:06 +01:00
trash treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
usr-include
wifi-password wifi-password: init at 0.1.0 (#68373) 2019-09-10 00:40:05 +02:00
xcode lib/systems: use newer ios sdk 2020-01-03 15:20:54 -05:00