$ git clone https://github.com/pkulchenko/ZeroBraneStudio.git
#如果代码下载存在问题,可以本站下载一份拷贝
# wget https://www.mobibrw.com/wp-content/uploads/2018/09/ZeroBraneStudio.tar.xz
# tar xvf ZeroBraneStudio.tar.xz
$ cd ZeroBraneStudio
$ cd build
$ bash build-linux-prep-deb.sh
# gthread
$ sudo apt-get install libglib2.0-dev
# gtk+
$ sudo apt-get install libgtk2.0-dev
$ sudo apt-get install libgtk-3-dev
#opengl
$ sudo apt-get install freeglut3-dev
# ssl for luasec
$ sudo apt-get install libssl-dev
$ sudo ln -s /usr/lib/arm-linux-gnueabihf/libssl.so /usr/lib/libssl.so
# lua
$ sudo apt-get install lua5.1 liblua5.1-dev
#webview可选
#sudo apt-get install libwebkitgtk-dev
# luasec最新版本,早期版本编译不通过
$ sed -i "s/^LUASEC_BASENAME=\"luasec-0.6\"/LUASEC_BASENAME=\"luasec-0.7\"/g" build-linux.sh
#此处wxWidgets的克隆比较慢,因此可以本站下载一份拷贝,手工修改脚本的下载
# wget https://www.mobibrw.com/wp-content/uploads/2018/09/wxWidgets.tar.xz
# sed -i "s/^[ \t]*git clone \"\$WXWIDGETS_URL\".*/ wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/09\/wxWidgets.tar.xz\n rm -rf wxWidgets\n tar xvf wxWidgets.tar.xz/g" build-linux.sh
# wget
# sed -i "s/^[ \t]*git clone \"\$WXLUA_URL\" \"\$WXLUA_BASENAME\".*/ wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/09\/wxlua.tar.xz\n rm -rf wxlua\n tar xvf wxlua.tar.xz/g" build-linux.sh
# sed -i "s/^LEXLPEG_URL=\"https:\/\/foicica.com\/scintillua\/download/LEXLPEG_URL=\"https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/09/g" build-linux.sh
# for debug "bash build-linux.sh debug all"
$ bash build-linux.sh all
#编译两次,解决第一次的问题,第一次有些目录创建存在问题
$ bash build-linux.sh all
#还是需要安装一些依赖,上面编译的库并没有完整完成依赖设置
$ sudo apt-get install luarocks
$ sudo luarocks install luasocket
$ cp deps/lib/libwx.so deps/lib/wx.so
#动态链接库应当设置LUA_CPATH而不是LUA_PATH
$ export LUA_CPATH="`pwd`/deps/lib/?.so;`pwd`/deps/lib/lua/51/?.so"
$ export LD_LIBRARY_PATH=`pwd`/deps/lib
#去掉两个检测,这两检测总是会失败,原因不好排查
$ sed -i "s/check_lua_module(wx TRUE)/#check_lua_module(wx TRUE)/g" CMakeLists.txt
$ sed -i "s/check_lua_module(socket TRUE)/#check_lua_module(socket TRUE)/g" CMakeLists.txt
$ cmake -DCMAKE_SYSROOT=`pwd`/deps/ -DCMAKE_FIND_ROOT_PATH=`pwd`/deps/ .
$ make
$ sudo make install