Skip to content

Instantly share code, notes, and snippets.

@Jamesits
Last active June 28, 2019 09:34
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jamesits/3be0f66a92934bcc32d3631aa68b893f to your computer and use it in GitHub Desktop.
Save Jamesits/3be0f66a92934bcc32d3631aa68b893f to your computer and use it in GitHub Desktop.
How to compile tg-cli on macOS 10.12
#!/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
#!/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
@Jamesits
Copy link
Author

Jamesits commented Oct 4, 2016

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.

@tddschn
Copy link

tddschn commented May 31, 2019

Error when using the first script to install tg-cli on mac:

sed: Makefile: No such file or directory

@Di9
Copy link

Di9 commented Jun 28, 2019

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