Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

unable to install luapress using luarocks #71

Open
necronomimicon opened this issue May 22, 2019 · 7 comments
Open

unable to install luapress using luarocks #71

necronomimicon opened this issue May 22, 2019 · 7 comments

Comments

@necronomimicon
Copy link

necronomimicon commented May 22, 2019

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
Copy link
Owner

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

On Mac you can brew install discount.

@necronomimicon
Copy link
Author

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

@Fizzadar
Copy link
Owner

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.

@necronomimicon
Copy link
Author

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

@necronomimicon
Copy link
Author

necronomimicon commented May 23, 2019

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
Copy link
Contributor

JordanMajd commented May 31, 2019

@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 https://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
Copy link

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants