Wire-Server 介绍
Wire-Server is a open source code for wire server, here is the download path here .
编译步骤
下载源码并放在~/wireserver 下,解压。
安装Haskell Stack Tool
wget -qO- https://get.haskellstack.org/ | sh
root权限下,完成安装stack命令(如果网络使用代理,需要关闭代理)。
编译wire-server
cd ~/wireserver
,执行
make
这个过程的下载过程比较漫长,需要耐心等待。
在make的过程中会国内用户遇到下载依赖项的问题:
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/) ...
国内访问 https://s3.amazonaws.com/hackage.fpcomplete.com/
有问题,可能被墙了,所以根据这个链接替换了清华的源。
在~/.stack/config.yaml
下添加下面设置:
package-indices:
- name: Tsinghua
download-prefix: https://mirrors.tuna.tsinghua.edu.cn/hackage/package/
http: https://mirrors.tuna.tsinghua.edu.cn/hackage/00-index.tar.gz
setup-info: "http://mirrors.tuna.tsinghua.edu.cn/stackage/stack-setup.yaml"
urls:
latest-snapshot: http://mirrors.tuna.tsinghua.edu.cn/stackage/snapshots.json
lts-build-plans: http://mirrors.tuna.tsinghua.edu.cn/stackage/lts-haskell/
nightly-build-plans: http://mirrors.tuna.tsinghua.edu.cn/stackage/stackage-nightly/
重新运行make
.
耐心等待…
- 在编译过程中遇到的另一个问题就是
protoc
找不到的情况:
参照https://google.github.io/proto-lens/installing-protoc.html
:
PROTOC_ZIP=protoc-3.3.0-osx-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.3.0/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
rm -f $PROTOC_ZIP
- 安装icu
yum install libicu-devel geoip geoip-devel snappy-devel openssl
运行通过。