
正文
centos 编译lantrn
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
github上的安装指导:
- Custom fork of Go is currently required. We'll eventually switch to Go 1.7 which supports what we need due to this.
- An OSX or Linux host. Building on Windows is only partially supported with the help of Cygwin.
- Git -
brew install git,apt-get install git, etc - GNU Make
- Nodejs & NPM
- GNU C Library (linux only) -
apt-get install libc6-dev-i386, etc - Gulp -
npm i gulp-cli -g
To build and run Lantern desktop, just do:
git clone https://github.com/getlantern/lantern.gitcd lanternmake lantern./lantern
During development, you'll likely want to do a clean build like this:
make clean-desktop lantern && ./lantern
按照此方法开始安装
1.安装go
这里需要编译lantern的go语言源代码,否则出现变量为定义。此问题是由于 Lantern 是用golang写的,但是不知道为啥,自己fork了一份golang。所以如果用官方的go编译会编译不通过。因为有个变量(tr.MaxIdleTime undefined)在官方的go标准库里面没有。
从github上lantern克隆下来go的源代码编译 git clone https://github.com/golang/go
cd到go 执行编译 ./all.bash
Error:Cannot find /root/go1.4/bin/go.
解决办法连接:https://blog.csdn.net/zhang197093/article/details/78468918
https://github.com/northbright/Notes/blob/master/Golang/china/install-go1.6-from-source-on-centos7-in-china.md
https://blog.csdn.net/qq_15437667/article/details/59776840
上面的连接下载的go1.9.2.linux-amd64.tar.gz,然后使用这个编译lantern在github上fork的go。
在 /etc/profile 文件中添加以下几行
export GOROOT=/你的go1.4的目录
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
export GOROOT_BOOTSTRAP=/你的go1.4的目录
使用export命令查看环境变量。
[root@localhost src]# source /etc/profile
[root@localhost src]# env | grep GO
GOBIN=/root/software/go-go1.9.2/bin
GOROOT=/root/software/go-go1.9.2
[root@localhost src]# echo $PATH
/usr/local/luajit/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/software/go-go1.9.2/bin
[root@localhost src]# go version
go version go1.9.2 linux/amd64
安装完成go1.4,并配置完环境变量,cd到lantern版本的go下面编译。
然后配置为新编译的环境变量下。
export GOROOT=/你的go-lantern的目录
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
export GOROOT_BOOTSTRAP=/你的go-lantern的目录
解决完上面问题再去编译一把,缺少的一些libqt的库直接网上搜索,在qt网站上会有安装命令。最后再编译下:
出现错误
import cycle not allowed
package github.com/getlantern/flashlight/main
imports flag
imports errors
imports runtime
imports runtime/internal/atomic
imports runtime
make: *** [lantern] Error 1
网上搜索到这是互相依赖造成的,看样子是因为代码的相互依赖造成的。只有等开发者修复了。
折腾到此结束。看来想用lantern还是用ubuntu吧,毕竟直接提供deb包







