vysheng / tg

telegram-cli
GNU General Public License v2.0
6.46k stars 1.53k forks source link

Compile with Lua on heroku #466

Open lukefx opened 9 years ago

lukefx commented 9 years ago

Hi guys,

I'm really sorry to fill an issue here, but I don't know where else to ask about it, I'm trying to compile telegram-cli with Lua support on Heroku. Everything is there, I'm using buildpack-multi and buildpack-apt with these packages:

libreadline6-dev
libconfig-dev
libssl-dev
lua5.2
liblua5.2-dev
lua-socket
libevent-dev
make

Packages are installed in /app/.apt/usr/ ... Lua headers are present in:

~ $ find -name "lua.h"
./.apt/usr/include/lua5.2/lua.h

I've added these paths to env

~/vendor/tg/bin $ env
LDFLAGS=-L/app/.apt/usr/lib -L/app/.apt/usr/lib/ -L/app/.apt/usr/lib/x86_64-linux-gnu/lua/5.2
BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
TERM=xterm
CPPFLAGS=-I/app/.apt/usr/include/lua5.2
LIBRARY_PATH=/app/.apt/usr/lib/x86_64-linux-gnu:/app/.apt/usr/lib/i386-linux-gnu:/app/.apt/usr/lib:
OLDPWD=/app/vendor/tg
WEB_MEMORY=512
MEMORY_AVAILABLE=512
INCLUDE_PATH=/app/.apt/usr/include:
LD_LIBRARY_PATH=/app/.apt/usr/lib/x86_64-linux-gnu:/app/.apt/usr/lib/i386-linux-gnu:/app/.apt/usr/lib::/app/vendor/tg/bin
CPATH=/app/.apt/usr/include:
COLUMNS=80
DYNO=run.2366
PATH=/app/.heroku/node/bin:/app/bin:/app/node_modules/.bin:/app/.apt/usr/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/tg/bin:/app/.apt/usr/bin
WEB_CONCURRENCY=1
PWD=/app/vendor/tg/bin
PS1=\[\033[01;34m\]\w\[\033[00m\] \[\033[01;32m\]$ \[\033[00m\]
LINES=24
HOME=/app
SHLVL=2
CFLAGS=-I/app/.apt/usr/include -I/app/.apt/usr/include/lua5.2/
LUA_LIB=-llua5.2
PKG_CONFIG_PATH=/app/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:/app/.apt/usr/lib/i386-linux-gnu/pkgconfig:/app/.apt/usr/lib/pkgconfig:
PORT=15659
HEROKU_URL=app.herokuapp.com
CPPPATH=/app/.apt/usr/include:
NODE_HOME=/app/.heroku/node
_=/usr/bin/env

But ./configure still can't find Lua header file:

~/vendor/tg $ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for sqrt in -lm... yes
checking for library containing clock_gettime... none required
checking for library containing backtrace... none required
checking for event_base_new in -levent... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking event2/event.h usability... yes
checking event2/event.h presence... yes
checking for event2/event.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking if zlib is wanted... yes
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for rl_save_prompt in -lreadline... yes
checking for libconfig... enabled
checking for config_init in -lconfig... yes
checking for liblua... enabled
checking for lua... no
checking for lua5.2... /app/.apt/usr/bin/lua5.2
checking if /app/.apt/usr/bin/lua5.2 is a Lua interpreter... yes
checking for lua version... 5.2
checking for lua platform... unknown
checking for lua script directory... ${prefix}/share/lua/5.2
checking for lua module directory... ${exec_prefix}/lib/lua/5.2
checking if LUA_VERSION is defined... yes
checking lua.h usability... no
checking lua.h presence... no
checking for lua.h... no
checking lualib.h usability... no
checking lualib.h presence... no
checking for lualib.h... no
checking lauxlib.h usability... no
checking lauxlib.h presence... no
checking for lauxlib.h... no
checking luaconf.h usability... no
checking luaconf.h presence... no
checking for luaconf.h... no
configure: error: No lua headers found. Try --disable-liblua

Even with prefix...nothing.

LUA=/app/.apt/usr/bin/lua5.2 LUA_INCLUDE=-I/app/.apt/usr/include/lua5.2 LUA_LIB=-llua-5.2 ./configure --prefix=/app/.apt/usr

Someone can help me please? There's a way to compile telegram-cli with Lua support?

Oh...naturally with --disable-liblua everything compile flawlessly

natsu90 commented 8 years ago

How are you doing now? Did you try https://github.com/TimoLins/heroku-buildpack-telegram instead? It works fine to me.