1

我想知道是否有人设法在其 macOS 机器上从源代码安装unison的最新版本(这里我正在尝试使用 Catalina)。我按照这里的步骤操作:

  1. 我确认我已经安装了 XCode(否则忘记编译任何东西 :)

  2. 我通过运行克隆了官方 Git 存储库

    git clone https://github.com/bcpierce00/unison.git

  3. 我移动到新创建的目录unison

    cd unison

  4. 正如文档中提到的那样,我然后运行make命令告诉它构建文本 UI:

    make UISTYLE=text

结果应该是一个名为的可执行文件,unison但我得到了以下错误:

Blablabla$ make UISTYLE=text
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src UISTYLE=text
UISTYLE = text
Building for Unix
NATIVE = true
THREADS = false
STATIC = false
OSTYPE =
OSARCH = osx
ocamlopt: ubase/rx.mli ---> ubase/rx.cmi
ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -ccopt -mmacosx-version-min=10.6 -c /Users/Shared/unison/src/ubase/rx.mli
make[1]: ocamlopt: No such file or directory
make[1]: *** [ubase/rx.cmi] Error 1
make: *** [text] Error 2
  1. 然后我想知道 XCode 是否可能不携带OCaml 编译器。所以我使用MacPort安装了官方的,因此运行:
sudo port install ocaml
sudo port install opam
  1. 然后我重新运行相同的make命令

    make UISTYLE=text

  2. 这次结果看起来更好,并以:

/Applications/Xcode.app/Contents/Developer/usr/bin/make tags
if [ -f "`which etags`" ]; then \
        etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
             *Makefile* \
      ; fi
  1. 但是,仍然没有任何unison文件可见。

问题是......因为没有错误消息,这个可执行文件在哪里?

4

1 回答 1

1

再次问候来自互联网的人们,

我设法在这里帮助自己,并unison在我的 macOS Catalina 计算机上获得了一个漂亮而新鲜的可执行文件。

基本上,基础make试图将编译产品移入/Users/<your_user>/bin/.我猜是有道理的,但我们 macOS 用户很少使用。所以这是我为解决这个问题所做的:

  1. 将目录创建bin到您的家中

    mkdir ~/bin

  2. 重新make运行

    make UISTYLE=text

  3. 通过询问其版本来验证您是否拥有可执行文件:

    ~/bin/unison -version

  4. 很高兴,我从终端收到了预期的消息:

    unison version 2.51.3 (ocaml 4.08.1)

希望它可以帮助某人。

于 2019-12-12T21:32:00.540 回答