无需Homebrew即可在macOS上安装Vapor

时间:2017-08-23 10:43:40

标签: swift vapor

我正在尝试启动Swift Vapor项目。在指南here之后,似乎Homebrew是唯一的选择。我已经拥有MacPorts,并且在许多方面更喜欢自制软件。不幸的是,Vapor没有端口,所以我选择了Vapor人所描述的SPM安装here。我之前在Kitura取得了成功,所以我想为什么不用Vapor。好吧,当你去构建你的项目时,你得到了

$ swift build

[... build stuff ...]

note: you may be able to install ctls using your system-packager:

    brew install ctls

[... more build stuff ...]

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
    ^
[... more like that ...]

  /Users/morpheu5/web/vizex/api/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift:1:8: error: could not build Objective-C module 'CTLS'
import CTLS
    ^
<unknown>:0: error: build had 1 command failures
error: exit(1):/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/morpheu5/web/vizex/api/.build/debug.yaml

显然你真的需要这个ctls包,获得它的唯一方法似乎是通过Homebrew / Tap。

我真的不想要或不需要Homebrew,所以我该如何找到它的底部?我真的很想试试Vapor。

1 个答案:

答案 0 :(得分:5)

强制性1:安装Homebrew是最简单的方法。如果你决定不想要自制软件,它会非常整齐地卸载。

强制性2:使用Linux VM是第二种最简单的方法。

但要回答您的问题并手动安装listen.owner = nobody listen.group = nobody user = nginx group = nginx

  1. 确保您安装了CTLSLibreSSL的库(可能是使用MacPorts)

  2. 下载OpenSSL的最新release

  3. 从发布存档中,将CTLS重命名为macos.pc,然后使用文本编辑器对其进行编辑。更改路径以指向LibreSSL / OpenSSL安装。

  4. 将已修改的ctls.pc移至ctls.pc

  5. 我已经对此进行了测试,它对我有用,我使用Homebrew安装了$PKG_CONFIG_PATH,但我不知道MacPorts会把它放在哪里。