Difficulties compiling nethack

Hello,

Since the game nethack is not in the repos (its a fantastic game, it really should be, its in the repos of all the other distributions like fedora or ubuntu), I am trying to compile it myself, but I get an issue with lex and the build fails when I try to compile it

The error I get when I try to make install:


make[2]: Entering directory '/home/etai/Downloads/nethack-3.6.0/src'

make[2]: '../include/date.h' is up to date.

make[2]: Leaving directory '/home/etai/Downloads/nethack-3.6.0/src'

lex dgn_comp.l

make[1]: lex: Command not found

make[1]: *** [Makefile:344: dgn_lex.c] Error 127

make[1]: Leaving directory '/home/etai/Downloads/nethack-3.6.0/util'

make: *** [Makefile:201: dungeon] Error 2

I can post the full output of the command, but I put what I thought was the relevant part

Is the issue that the flex package provided by solus does not have the lex command?

I would be very grateful for any  help

Level 1 Asked on September 16, 2017 in General.
Add Comment
1 Answer(s)

Solus does not have the lex command in the flex package but I have found a workaround.

There should be a file in sys/unix/ called Makefile.utl

Run this command:


cat Makefie.utl | grep -n lex

and you will get a list of lines that have the word “lex” in them [and their associated line numbers].

There should be two lines [near the top] that say:


LEX = lex
# LEX = flex

Change the lines to:


# LEX = lex
LEX = flex

and try again. Good luck!

Level 1 Answered on December 29, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.