go開發ide之liteide的安裝

weixin_33861800發表於2018-04-22

LiteIDE是國人開發的一款開源免費的Go語言程式開發IDE,本文紀錄LiteIDE在Mac上的安裝過程。

LiteIDE安裝環境要求

首先,要安裝Go語言及工具。安裝檔案及方法參見golang官網的這個頁面。需要說明的是,官方的安裝教程預設是安裝到/usr/local/go目錄,此時不需要額外設定GOROOT環境變數(具體原因參考這篇文章),只需要將path新增到.bash_profile:


export PATH=$PATH:/usr/local/go/bin

根據官方說明:


 The Go binary distributions assume they will be installed in /usr/local/go (or c:\Go under Windows), but it is possible to install the Go tools to a different location. In this case you must set the GOROOT environment variable to point to the directory in which it was installed.

如果不是安裝在這個預設目錄(/usr/local/go),需要另外設定GOROOT環境變數並新增PATH變數。比如把go安裝到$HOME下,需要在$HOME/.bash_profile新增以下2行:


export GOROOT=$HOME/go

export PATH=$PATH:$GOROOT/bin

安裝LiteIDE

二進位制檔案安裝

首先從http://sourceforge.net/projects/liteide/files 下載二進位制檔案

windows

下載包檔案並解壓到C:/

Linux && MacOSX

下載包檔案並解壓到/usr/local或者$HOME

原始檔安裝

首先要安裝qt

可以從這裡https://www.qt.io/download/ 下載二進位制檔案安裝,或者使用homebrew安裝:


$ brew update

$ brew install qt

安裝過程終端輸出以下資訊:


==> Downloading https://homebrew.bintray.com/bottles/qt-4.8.7_2.el_capitan.bottl

######################################################################## 100.0%

==> Pouring qt-4.8.7_2.el_capitan.bottle.tar.gz

==> Caveats

We agreed to the Qt opensource license for you.

If this is unacceptable you should uninstall.

Qt Designer no longer picks up changes to the QT_PLUGIN_PATH environment

variable as it was tweaked to search for plug-ins provided by formulae in

 /usr/local/lib/qt4/plugins

.app bundles were installed.

Run `brew linkapps qt` to symlink these to /Applications.

==> Summary

? /usr/local/Cellar/qt/4.8.7_2: 2,815 files, 113.0M

接下來編譯安裝LiteIDE

依次執行以下命令:


$ git clone https://github.com/visualfc/liteide.git

$ export QTDIR=$HOME/QtSDK/Desktop/Qt/484/gcc #If QT is installed with brew, input: export QTDIR=/usr/local/Cellar/qt/4.8.7_2

$ cd liteide/build

$ ./update_pkg.sh

$ ./build_osx.sh

$ ./deploy_osx_qt4.sh

執行以上最後一行輸出:


deploy liteide/LiteIDE.app

QTDIR=/usr/local/Cellar/qt/4.8.7_2

GOROOT=

BUILD_ROOT=/Users/chenxin/Documents/Work/Workspace/liteide/build

LITEIDE_ROOT=/Users/chenxin/Documents/Work/Workspace/liteide/build/../liteidex

接下來就可以啟動LiteIDE了:


$ cd ..

$ cd liteidex/liteide/bin

啟動LiteIDE.app即可

參考

相關文章