nixpkgs/pkgs
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
..
applications mpv: add flag for swift on darwin 2020-02-06 14:15:35 +01:00
build-support bazel-deps: remove 2020-02-04 12:35:47 +11:00
common-updater common-updater-scripts: move destructive changes further in the script 2020-02-04 06:25:38 +01:00
data Merge pull request #79173 from chkno/nerd-fonts 2020-02-05 00:17:39 +01:00
desktops gnustep/base: replace libbfd with binutils-unwrapped 2020-02-03 18:42:42 +01:00
development ansible-lint: it builds 2020-02-06 10:50:23 +01:00
games dwarf-fortress: Update themes.json 2020-02-03 00:57:53 -08:00
misc brightnessctl: 0.4 -> 0.5.1 2020-02-06 05:21:26 +00:00
os-specific mpv: add flag for swift on darwin 2020-02-06 14:15:35 +01:00
servers Merge pull request #79259 from foxit64/master 2020-02-06 10:36:19 +00:00
shells Revert "Revert "Merge master into staging-next"" 2020-02-05 19:41:25 +01:00
stdenv Merge staging-next into staging 2020-02-02 15:33:13 +01:00
test llvm_4: remove 2020-01-30 18:35:31 -05:00
tools screen: 4.7.0 -> 4.8.0 2020-02-05 23:58:17 +01:00
top-level python3Packages.nbformat: 4.4.0 -> 5.0.4 2020-02-06 10:25:19 +01:00