-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from tindy2013/dev
- Loading branch information
Showing
9 changed files
with
312 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
#!/bin/bash | ||
set -e | ||
#initialize sudo so that no password entering during installation | ||
sudo -v | ||
|
||
echo installing brew | ||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
|
||
#install most libraries and client through brew | ||
brew install cmake git wget [email protected] libpng yaml-cpp freetype rapidjson shadowsocks-libev | ||
|
||
echo downloading and compiling pngwriter | ||
git clone https://github.com/pngwriter/pngwriter | ||
cd pngwriter | ||
cmake . | ||
sudo make install -j8 | ||
#fix install error | ||
#sudo install libPNGwriter.a /usr/local/lib/ | ||
cd .. | ||
|
||
echo downloading and compiling shadowsocksr-libev | ||
git clone https://github.com/shadowsocksrr/shadowsocksr-libev | ||
cd shadowsocksr-libev | ||
./configure --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/include --disable-documentation | ||
make -j8 | ||
#fix dynamic lib reference error | ||
install_name_tool -change @rpath/libssl.1.1.dylib /usr/local/opt/[email protected]/lib/libssl.1.1.dylib src/ss-local | ||
install_name_tool -change @rpath/libcrypto.1.1.dylib /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib src/ss-local | ||
#will not directly install this one, use another method | ||
sudo install src/ss-local /usr/local/bin/ssr-local | ||
cd .. | ||
|
||
echo installing v2ray from brew | ||
brew tap v2ray/v2ray | ||
brew install v2ray-core | ||
|
||
echo all done! | ||
#!/bin/bash | ||
set -e | ||
#initialize sudo so that no password entering during installation | ||
sudo -v | ||
|
||
echo installing brew | ||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
|
||
#install most libraries and client through brew | ||
brew install cmake git wget [email protected] libpng yaml-cpp freetype rapidjson shadowsocks-libev | ||
|
||
echo downloading and compiling pngwriter | ||
git clone https://github.com/pngwriter/pngwriter | ||
cd pngwriter | ||
cmake . | ||
sudo make install -j8 | ||
#fix install error | ||
#sudo install libPNGwriter.a /usr/local/lib/ | ||
cd .. | ||
|
||
echo downloading and compiling shadowsocksr-libev | ||
git clone https://github.com/shadowsocksrr/shadowsocksr-libev | ||
cd shadowsocksr-libev | ||
./configure --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/include --disable-documentation | ||
make -j8 | ||
#fix dynamic lib reference error | ||
install_name_tool -change @rpath/libssl.1.1.dylib /usr/local/opt/[email protected]/lib/libssl.1.1.dylib src/ss-local | ||
install_name_tool -change @rpath/libcrypto.1.1.dylib /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib src/ss-local | ||
#will not directly install this one, use another method | ||
sudo install src/ss-local /usr/local/bin/ssr-local | ||
cd .. | ||
|
||
echo installing v2ray from brew | ||
brew tap v2ray/v2ray | ||
brew install v2ray-core | ||
|
||
echo all done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
pkg upgrade | ||
|
||
#first install core utilities | ||
pkg install -y git cmake clang autoconf automake libtool | ||
|
||
#then install precompiled library from repo | ||
pkg install -y openssl-static libcurl-static libpng-static libev-static libz-static freetype-static | ||
|
||
#get rapidjson | ||
git clone https://github.com/tencent/rapidjson | ||
cd rapidjson | ||
cmake -D CMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr . | ||
make install -j2 | ||
cd .. | ||
|
||
#get pngwriter | ||
git clone https://github.com/pngwriter/pngwriter | ||
cd pngwriter | ||
cmake -D CMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr . | ||
make install -j2 | ||
cd .. | ||
|
||
#get yaml-cpp | ||
git clone https://github.com/jbeder/yaml-cpp | ||
cd yaml-cpp | ||
cmake -D CMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr . | ||
make install -j2 | ||
cd .. | ||
|
||
echo all done! | ||
#!/bin/bash | ||
set -e | ||
pkg upgrade | ||
|
||
#first install core utilities | ||
pkg install -y git cmake clang autoconf automake libtool | ||
|
||
#then install precompiled library from repo | ||
pkg install -y openssl-static libcurl-static libpng-static libev-static libz-static freetype-static | ||
|
||
#get rapidjson | ||
git clone https://github.com/tencent/rapidjson | ||
cd rapidjson | ||
cmake -D CMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr . | ||
make install -j2 | ||
cd .. | ||
|
||
#get pngwriter | ||
git clone https://github.com/pngwriter/pngwriter | ||
cd pngwriter | ||
cmake -D CMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr . | ||
make install -j2 | ||
cd .. | ||
|
||
#get yaml-cpp | ||
git clone https://github.com/jbeder/yaml-cpp | ||
cd yaml-cpp | ||
cmake -D CMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr . | ||
make install -j2 | ||
cd .. | ||
|
||
echo all done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "rapidjson_extra.h" | ||
|
||
void operator >> (const rapidjson::Value& value, std::string& i) | ||
{ | ||
if(value.IsNull()) | ||
i = std::string(); | ||
else if(value.IsInt64()) | ||
i = std::to_string(value.GetInt64()); | ||
else if(value.IsDouble()) | ||
i = std::to_string(value.GetDouble()); | ||
else if(value.IsString()) | ||
i = std::string(value.GetString()); | ||
else | ||
i = std::string(); | ||
} | ||
|
||
void operator >> (const rapidjson::Value& value, int& i) | ||
{ | ||
if(value.IsNull()) | ||
i = 0; | ||
else if(value.IsInt()) | ||
i = value.GetInt(); | ||
else if(value.IsString()) | ||
i = std::stoi(value.GetString()); | ||
else | ||
i = 0; | ||
} | ||
|
||
std::string GetMember(const rapidjson::Value& value, std::string member) | ||
{ | ||
std::string retStr; | ||
if(value.HasMember(member.data())) | ||
value[member.data()] >> retStr; | ||
return retStr; | ||
} | ||
|
||
void GetMember(const rapidjson::Value& value, std::string member, std::string* target) | ||
{ | ||
std::string retStr = GetMember(value, member); | ||
if(retStr.size()) | ||
target->assign(retStr); | ||
} |
Oops, something went wrong.