Last active
June 28, 2019 09:34
-
-
Save Jamesits/3be0f66a92934bcc32d3631aa68b893f to your computer and use it in GitHub Desktop.
How to compile tg-cli on macOS 10.12
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
#!/bin/bash | |
# for macOS | |
brew install libconfig readline lua python libevent jansson openssl | |
ln -s /usr/local/opt/readline/lib/libreadline.7.dylib /usr/local/opt/readline/lib/libreadline.6.dylib | |
git clone https://github.com/vysheng/tg.git --recursive | |
cd tg | |
CFLAGS="-I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include" \ | |
LDFLAGS="-L/usr/local/lib -L/usr/local/Cellar/readline/6.3.8/lib" \ | |
./configure --with-openssl=/usr/local/opt/openssl | |
sed -i -e 's/-Werror//g' Makefile | |
make |
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
#!/bin/bash | |
# for Ubuntu | |
sudo apt-get install build-essential libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make | |
git clone https://github.com/vysheng/tg.git --recursive | |
cd tg | |
./configure | |
make |
Error when using the first script to install tg-cli on mac:
sed: Makefile: No such file or directory
I have installed readline with different version, so my CL and LD FLAGS paths were different.
In my case it was in "/usr/local/Cellar/readline/8.0.0_1" not 6.3.8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested on macOS Sierra 10.12.1 Beta (16B2327e), but should work on any version of OS X from 10.10
Requisite: Homebrew, git
I strongly recommend execute this script line by line manually.
Known bugs:
libreadline 7 seems to be some sort of incompatible with libreadline 6 but the program should build (while strange blink of cursor and bugs like you can't delete input may happen)
Tips:
tg-cli
don't follow*_PROXY
environment variables, so if you have a censored network, use Proxifier(this profile maintained by me should work out of box), proxychain-ng or similar software.