From fc363d74ebe621d9169ee1ae9f4552e894ff25c3 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Fri, 7 Apr 2017 11:26:52 -0700 Subject: [PATCH] sourcery: statically link Swift runtime libraries The current formula _requires_ that the user have the exact same version of Xcode as Homebrew's Jenkins CI machines located exactly at the same location (`/Applications/Xcode.app`). That's because the formula uses Swift Package Manager to build the bottle, which adds an `LC_RPATH` command to the binary with an absolute path to the SDK where the Swift runtime dynamic libraries can be found. So if you've installed Xcode anywhere else, or if the version of Xcode you have installed at that location isn't the same version as was used on Homebrew's Jenkins machines, you'll have to build from source using a command like `brew install sourcery --HEAD`. --- Formula/sourcery.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Formula/sourcery.rb b/Formula/sourcery.rb index ac2acd4198..f534362b3c 100644 --- a/Formula/sourcery.rb +++ b/Formula/sourcery.rb @@ -3,6 +3,7 @@ class Sourcery < Formula homepage "https://github.com/krzysztofzablocki/Sourcery" url "https://github.com/krzysztofzablocki/Sourcery/archive/0.5.9.tar.gz" sha256 "1f5dee5184a7271a70552c0e85dd1d730e711088e5fdcf3dd7aa1f96b993e414" + revision 1 bottle do cellar :any @@ -15,7 +16,7 @@ class Sourcery < Formula def install ENV.delete("CC") ENV["SDKROOT"] = MacOS.sdk_path - system "swift", "build", "-c", "release" + system "swift", "build", "-c", "release", "-Xswiftc", "-static-stdlib" bin.install ".build/release/sourcery" lib.install Dir[".build/release/*.dylib"] end