Fizzadar / Luapress

:newspaper: Static site/blog generator written in Lua.
MIT License
198 stars 32 forks source link

unable to install luapress using luarocks #71

Open OOQQok opened 5 years ago

OOQQok commented 5 years ago

DISCOUNT dependency fails on me every time :/

Error: Failed installing dependency: https://luarocks.org/discount-0.4-1.rockspec - Could not find header file for DISCOUNT No file mkdio.h in /usr/local/include No file mkdio.h in /usr/include You may have to install DISCOUNT in your system and/or pass DISCOUNT_DIR or DISCOUNT_INCDIR to the luarocks command. Example: luarocks install discount DISCOUNT_DIR=/usr/local

either win admin account, or mac sudo command, please bear my n00bness

Fizzadar commented 5 years ago

@OOQQ you'll need to install the discount library for your platform.

On Mac you can brew install discount.

OOQQok commented 5 years ago

no mac here, only linux / win, and I'm unable to install discount on linux, see above error (?)

Fizzadar commented 5 years ago

I think you'll need to compile the library by hand in that case, see: https://github.com/Orc/discount/blob/master/INSTALL

This is less than ideal! Unfortunately I've yet to find a decent Lua-only markdown library.

OOQQok commented 5 years ago

Probably a Lua-only markdown library it's a good project on it's own lol

OOQQok commented 5 years ago

okay... so i've followed the install guide of home Discount, and this is what I get now...

ooqq@ooqq-OptiPlex-7020:~/Desktop/discount-2.2.4$ sudo make install
[sudo] password for ooqq:      
/home/ooqq/Desktop/discount-2.2.4/config.md /usr/local/lib/pkgconfig
/usr/bin/install -s -m 755 markdown /usr/local/bin
./librarian.sh install libmarkdown VERSION /usr/local/lib
/usr/bin/install -m 444 mkdio.h /usr/local/include
/usr/bin/install -m 444 libmarkdown.pc /usr/local/lib/pkgconfig
ooqq@ooqq-OptiPlex-7020:~/Desktop/discount-2.2.4$ make test
cc -Wno-return-type -Wno-implicit-int -I. -o echo tools/echo.c
cc -Wno-return-type -Wno-implicit-int -I. -o cols tools/cols.c
headers ... GOOD
Reddit-style automatic links ......................... OK
(rest of tests also passes)

ooqq@ooqq-OptiPlex-7020:~/Desktop/discount-2.2.4$ sudo luarocks install luapress
Installing https://luarocks.org/luapress-3.5.2-0.rockspec
Missing dependencies for luapress 3.5.2-0:
   discount (not installed)
   luafilesystem (not installed)
   lustache (not installed)

luapress 3.5.2-0 depends on discount (not installed)
Installing https://luarocks.org/discount-0.4-1.rockspec
gcc -O2 -fPIC -I/usr/include/lua5.2 -c discount.c -o discount.o
discount.c:20:10: fatal error: lua.h: No such file or directory
 #include <lua.h>
          ^~~~~~~
compilation terminated.

Error: Failed installing dependency: https://luarocks.org/discount-0.4-1.rockspec - Build error: Failed compiling object discount.o

-_-

JordanMajd commented 5 years ago

@OOQQ I had some trouble with this on Ubuntu 18.04 and ended up compiling my own, this solved my issues:

# download discount source code
wget http://www.pell.portland.or.us/~orc/Code/discount/discount-2.2.4.tar.bz2
# extract 
tar xjf discount-2.2.4.tar.bz2
# navigate to extracted directory
cd discount-2.2.4

# configure for your system.
./configure.sh

# I had some issues with linking later on, so I added -fPIC as a CFLAG to the makefile
# Other people may or may not need to do this
vim Makefile # update $CFLAGS from "-g" to "-g -fPIC"
# compile
make
# install to system
sudo make install

# install luapress and cross fingers (--local is only if you want a local install)
luarocks install luapress --local

If for some reason compilation fails or you run into issues remember to run make clean before trying something new.

koivunen commented 4 years ago

Somewhat similar to Ubuntu above, for debian 10 the location needed to be manually specified:

$ apt-get install libmarkdown2-dev
$ dpkg-query -L libmarkdown2-dev | grep mkdio
/usr/include/x86_64-linux-gnu/mkdio.h
$ luarocks install discount DISCOUNT_INCDIR=/usr/include/x86_64-linux-gnu
Installing https://luarocks.org/discount-0.4-1.rockspec
gcc -O2 -fPIC -I/usr/include/lua5.1 -c discount.c -o discount.o
gcc -shared -o discount.so -L/usr/local/lib discount.o -lmarkdown
discount 0.4-1 is now installed in /usr/local (license: ISC)