TONPPAMF

The Official NPPAngband And NPPMoria Forum

You are not logged in.

Announcement

November 28, 2016 - NPPAngband forum has been migrated to a new host. SSL has been enabled so please use https:// if possible.

#1 2008-10-21 13:40:10

Bandobras
Member
From: Hobbiton
Registered: 2006-05-06
Posts: 39

Compiling NPP for Linux?

Any idea how to compile the NPP SVN sources for Linux? No 'configure' to run and 'make -f Makefile.std' fails miserably. Also, a year ago the wonderful Tolkienian fonts didn't work under my Debian Linux --- do they work now for anybody?

Thanks a lot. smile

Offline

#2 2008-10-22 00:32:13

MegaKurt
TONPPAMF Maintainer
From: Town Level
Registered: 2004-07-01
Posts: 213
Website

Re: Compiling NPP for Linux?

If anyone can build an executable for Linux, please send a copy for me to host. We're sadly out of date on most of the executables. sad


~ MegaKurt

Offline

#3 2008-10-22 09:48:59

Bandobras
Member
From: Hobbiton
Registered: 2006-05-06
Posts: 39

Re: Compiling NPP for Linux?

Thanks to the help on oook, I managed to compile NPP, though without some visual platform support that's in Makefile.std. It turns out NPP has Linux framebuffer and XAW turned on by default in Makefile.std, unlike UN and V, and I don't have the libraries. Fonts seem to work OK this time, too, after running compile_bdf_fonts.sh (it should be documented, though).

Now, for a Brigand on small levels, with all quests on. I wonder about the race... After I die 50 times, a Mage, tomorrow, to try the new Mage spells in NPP.

Edit: The 16x16 font is wonderful! I've always wanted a square font. Plus the accents... I only don't like the doors and walls that flicker on all the overclocked monitors I use, both CRT and LCD (with VGA connector). Anyway, we need it badly in Un!

Offline

#4 2008-10-22 23:17:30

ramela
Member
From: Helsinki
Registered: 2004-10-01
Posts: 420

Re: Compiling NPP for Linux?

High Elf is by far the best race for a Brigand, Half-Orcs would propably be good too.


style7,NPPAngband.png

Offline

#5 2008-10-23 17:45:15

Bandobras
Member
From: Hobbiton
Registered: 2006-05-06
Posts: 39

Re: Compiling NPP for Linux?

ramela wrote:

High Elf is by far the best race for a Brigand, Half-Orcs would propably be good too.

Oh, I've only now read your advice. I've chosen Half-Troll and I have no usual Half-Troll problems so far. Actually, I have no problems at all, since I could afford a crossbow. smile Except I could not afford it with 3 CHR, if not for the money from two quests. Who says money rewards suck?

Edit: I only forget all the time about the trap-setting, which would save a lot of my CCW and so money, if used... With a Hobbit Rogue, ages ago, it was different --- I relied almost exclusively on trap-setting. smile

Last edited by Bandobras (2008-10-23 18:18:00)

Offline

#6 2012-04-10 12:25:32

oldmansutton
Member
Registered: 2012-04-10
Posts: 1

Re: Compiling NPP for Linux?

To get this back on topic and actually give others some info on HOW to get this to compile in Linx.... (at least Debian/Ubuntu, that's all I've tried)....

edit the autogen.sh file, so the first line reads
#!/bin/bash 

convert the file's line terminators to linux, using something like
fromdos autogen.sh

Make sure the autogen.sh file is executable...
chmod +x autogen.sh

run the autogen.sh file
./autogen.sh


..... after that it's a pretty standard
./configure
make

Refer to the compile.txt file for ./configure suggestions and dependencies.

Hope this helps.

Offline

#7 2013-01-20 11:34:16

RunningAway
Member
Registered: 2012-02-27
Posts: 246

Re: Compiling NPP for Linux?

My main development computer is now emulating a paperweight, so I am trying to compile from scratch on the other computer.  And not having very much success.
It's running an older Linux distribution that hasn't been upgraded in a while because (#include long rant about how much the newer releases suck) and I haven't gotten around to switching distros.

Anyway.

It's choking on autogen.sh.

Firstly, you need to make sure that the shell scripts and configure use the Unix LF line termination instead of the DOS CRLF.  Easy enough to fix.

But, autogen.h still doesn't work:

: command not found2:
: command not found5:
'/autogen.sh: line 15: syntax error near unexpected token `
'/autogen.sh: line 15: `run_or_die ()

Not much to go on, but running ./configure (worth a shot, right?) then fails with:

config.status: creating mk/sinclude.mk
config.status: error: cannot find input file: `src/autoconf.h.in'

Offline

#8 2013-01-20 14:25:11

NPPAngband
NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647
Website

Re: Compiling NPP for Linux?

Which Linux version?  Is it debian based, or redhat?  I have an old computer with Ubuntu on it, and it has compiled fine for the last year or so.  And I think it compiles OK on other debian based linuxs versions.

I am not sure how much help I could be.  Just trying to brainstorm.

Offline

#9 2013-01-20 14:53:25

RunningAway
Member
Registered: 2012-02-27
Posts: 246

Re: Compiling NPP for Linux?

Ubuntu 10.10.
Specifically autoconf 2.67,bash 4.1.5.

Offline

#10 2013-01-20 17:43:04

murphy
Member
Registered: 2007-03-17
Posts: 275

Re: Compiling NPP for Linux?

Hi, I can share my compile method, I'm using it on an ubuntu-based distro (jolicloud) so I expect you can use it as well.  I don't use the configure flow at all, I just go into the src directory and use Makefile.std with a few minor edits.

first probably want to throw away your existing work directory, because I dont know the effects of running configure on the source files.  so erase everything and do a new tarball extract.  then go into src directory and make these changes to Makefile.std

28c28
< SYS_x11 = -DUSE_X11 -lX11
---
> SYS_x11 =
32c32
< SYS_gcu = -DUSE_GCU -DUSE_NCURSES -lncurses
---
> SYS_gcu = -DUSE_GCU -DUSE_NCURSES -lncurses -DHAVE_MKDIR
39c39
< SYS_sdl = -DUSE_SDL $(shell sdl-config --cflags) $(shell sdl-config --libs) -lSDL_ttf -lSDL_image
---
> SYS_sdl =
82c82
< MAINOBJS = main.o main-gcu.o main-x11.o main-sdl.o snd-sdl.o $(GTKOBJS)
---
> MAINOBJS = main.o main-gcu.o $(GTKOBJS)


basically I'm just removing the x11 and sdl targets, and I'm adding the HAVE_MKDIR define to the gcu compile flags.   After these edits, compile and run with


make -f Makefile.std
cd ..
./nppangband

Last edited by murphy (2013-01-20 17:58:36)

Offline

#11 2013-01-27 09:17:09

RunningAway
Member
Registered: 2012-02-27
Posts: 246

Re: Compiling NPP for Linux?

That works.  It's limited to a single term window, and it doesn't seem to handle resizing the term, but it works.  The colors are a little weird, muted, but that could be the xterm.  Playing in a single 80x25 window is definitely cramped.  And, the mouse stuff doesn't work.

The changes to Makefile.std have changed.  The line numbers are different, so look for the 'SYS_' prefixes.  Also, no SYS_x11 line to edit.

Perhaps add this as a separate Makefile.   Makefile.crs, for 'curses'?

Funny thing, Eclipse wants to open Makefile.std in OpenOffice (this distro is too old for LibreOffice) because of the extension.  Annoying.

I'll stick with Wine for running "official" builds because of the screen real estate.  Still, now I can test stuff.

Last edited by RunningAway (2013-01-27 10:57:37)

Offline

#12 2013-01-27 13:44:58

NPPAngband
NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647
Website

Re: Compiling NPP for Linux?

Yes, GCU is an ancient port, and it will always only support single windows and no mouse.  It might be you could follow similar instructions, deleting the other two ports and get the sdl one working.

Offline

#13 2013-02-16 10:39:50

NPPAngband
NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647
Website

Re: Compiling NPP for Linux?

@Running away - The link below has instructions on getting NPP compiled and running the gcu and sdl ports.

http://forum.nppangband.org/viewtopic.php?id=1224

I tested them today on the latest Ubuntu.  I only had to update the makefile in *NPPAngband/lib/prefs to remove 4-5 file references to the x11 and gtk ports.  Both the sdl and gcu ports work fine, and I will upload the corrected makefile for that directory shortly.

-Jeff

UPDATE:  I had the exact same problem with the src zip file autogen.sh file.  Replacing it with the one from github worked.  Using the source from github in the first place, I didn't have any issues.

Offline

#14 2013-03-24 10:57:27

RunningAway
Member
Registered: 2012-02-27
Posts: 246

Re: Compiling NPP for Linux?

I just compiled 6.1.1 on Unbuntu 64-bit without any problems.  No need to change any files.  It crashed after character creation just like that bug said.

Downloaded the latest WIP from GIT, compiled, and it works fine.  Yay.

Offline

#15 2013-03-24 11:57:13

murphy
Member
Registered: 2007-03-17
Posts: 275

Re: Compiling NPP for Linux?

don't have enough details to be sure, but a crash after character creation might mean it couldnt create the notes file, which might be fixable by adding  -DHAVE_MKDIR  to the gcc flags

Offline

#16 2013-03-24 18:49:48

NPPAngband
NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647
Website

Re: Compiling NPP for Linux?

One other bug, recently fixed, was that the new sidebar was causing the game to crash only on 64 bit Linux machines.  That might have been the source as well.

Offline

#17 2013-03-24 19:36:23

RunningAway
Member
Registered: 2012-02-27
Posts: 246

Re: Compiling NPP for Linux?

I'm pretty sure it was the sidebar bug since the WIP (to clarify, your WIP, not mine) version works fine.

Something I'd like to see down the line is a .deb (and .rpm for those of you that swing that way), but it's something I've never done before.

Offline

#18 2013-03-24 23:24:52

murphy
Member
Registered: 2007-03-17
Posts: 275

Re: Compiling NPP for Linux?

Distributing a linux binary via .deb or .rpm would mean dependencies on specific versions of libc, libncurses, etc; in other words, you would need a separate .deb for each version of each distro.  It's not really feasible :-( especially for something that's still under development

Offline

#19 2013-03-25 20:39:01

RunningAway
Member
Registered: 2012-02-27
Posts: 246

Re: Compiling NPP for Linux?

Not strictly true.  I recently installed printer drivers on the Ubuntu system from a .deb that was good for a wide range of releases.

Without looking things up, I'm pretty sure that you can set version requirements as a minimum, a range, or a specific version.  Angband should be happy with just a minimum version.

Offline

#20 2013-03-26 01:33:22

murphy
Member
Registered: 2007-03-17
Posts: 275

Re: Compiling NPP for Linux?

After compiling nppangband you can run

ldd nppangband

to see the shared libraries required to run the binary.  If you compile nppangband on ubuntu 12.10, then try to run that executable on a ubuntu 11.10 system, it won't work because it has different versions of these shared libraries.

However if you run ldd on your printer driver I'm guessing you will see that it does not have any shared library dependencies, thats why its distro agnostic :-)

Offline

Board footer

Powered by FluxBB