Compile Celestia in Ubuntu.

General discussion about Celestia that doesn't fit into other forums.
Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #21by Christophe » 22.06.2007, 17:51

Here is the commented shell script I use to produce my deb packages:

Code: Select all

#!/bin/bash

#
# Celestia deb builder
#
# A cvs checkout is expected in ~/celestia-cvs
# A ~/debian directory must exist and hold a celestia.diff.gz patch
# (a copy of the latest diff.gz from http://epicycle.free.fr/ubuntu/ )
#

DATE=`date +'%Y%m%d'`
CUR_VER=1.4.1
VER=1.4.99-cvs$DATE

# update the CVS checkout
cd ~/celestia-cvs
cvs up -PAd
cd ..

# make a copy, and update the version number
if [ -d celestia_$DATE ] ; then rm -rf celestia_$DATE ; fi
cp -a celestia-cvs celestia_$DATE
cd celestia_$DATE
sed -e "s/\[$CUR_VER\]/[$VER]/" < configure.in > configure.in_ && \
  rm configure.in && \
  mv configure.in_ configure.in
if [ -f Makefile.am.wo ] ; then rm Makefile.am.wo ; fi

# generate the configure script, run it and generate the distribution
make -f Makefile.cvs
cd ~/celestia_$DATE
./configure --with-kde
touch Makefile.am.wo
make dist
cd

# rename distribution, move it under ~/debian/ and remove the work directory
mv celestia_$DATE/celestia-$VER.tar.gz debian/celestia_$VER.orig.tar.gz
rm -rf celestia_$DATE

# untar the distribution and apply the debian patch
cd debian
tar xvzf celestia_$VER.orig.tar.gz
cd celestia-$VER
zcat ../celestia.diff.gz | patch -p1

# update the version number in Changelog
# (otherwise debuild complains about unmatching version numbers)
cd debian
sed -e "1 s/\\(.*\\)(.*)\\(.*\\)/\\1($VER-0ubuntu1)\\2/" < changelog > changelog_ && \
  rm changelog && \
  mv changelog_ changelog
cd ..

#
# you can apply other changes to debian/* or the sources here
#

# generate the packages
debuild
cd ..

# upload to ftp server
# ncftpput -u $USER -p $PASS $SERVER $DIR *$VER*{.diff.gz,.tar.gz,.deb}
Christophe

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #22by tech2000 » 23.06.2007, 23:58

While I have been playing around in Celestia for Linux-Gnome I noticed that I can't get the lua_edu_tools to run.. :cry:
Any suggestions?

And there really should be a bookmark menu for Gnome too.

Bye, Anders

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #23by Christophe » 25.06.2007, 08:00

tech2000 wrote:While I have been playing around in Celestia for Linux-Gnome I noticed that I can't get the lua_edu_tools to run.. :cry:
Any suggestions?

My own Gnome build works fine with the edu tools, what exactly happens when you try to run it?

tech2000 wrote:And there really should be a bookmark menu for Gnome too.


Well, Pat hasn't been very active lately, I don't know what his plans are in regards to adding new features to the Gnome interface.
Christophe

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #24by tech2000 » 25.06.2007, 16:09

Christophe wrote:
tech2000 wrote:While I have been playing around in Celestia for Linux-Gnome I noticed that I can't get the lua_edu_tools to run.. :cry:
Any suggestions?

My own Gnome build works fine with the edu tools, what exactly happens when you try to run it?


Well, actually nothing happens. Celestia starts as normal without the edu_tools.
Do I have to do anything after I have compiled Celestia that I have missed?

And one other thing;
All on screen text is in Swedish but the menus are in English..

bye Anders

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #25by Christophe » 26.06.2007, 19:06

tech2000 wrote:Well, actually nothing happens. Celestia starts as normal without the edu_tools.
Do I have to do anything after I have compiled Celestia that I have missed?

Did you add the LuaHook entry to the config file? and if you did, are you sure that config file is the one used?

tech2000 wrote:And one other thing;
All on screen text is in Swedish but the menus are in English..


That's normal. The Gnome GUI hasn't been internationalized so only the core strings appear translated.
Christophe

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #26by tech2000 » 26.06.2007, 21:44

Christophe wrote:Did you add the LuaHook entry to the config file? and if you did, are you sure that config file is the one used?
Are there more than one config file? I have edited the one on in the celestia root directory.

That's normal. The Gnome GUI hasn't been internationalized so only the core strings appear translated.


Okay, that explains it. And also how typical that is.. I go Gnome and the good stuff is for KDE..

Bye, Anders

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #27by Christophe » 26.06.2007, 22:08

tech2000 wrote:Are there more than one config file? I have edited the one on in the celestia root directory.

You can easily end up with several if you have another installation of Celestia. Typicaly if you install a deb, you have /etc/celestia.cfg which points to /usr/share/celestia/celestia.cfg but isn't used by your compiled binary.

You can also use ~/.celestia.cfg which allows you to have personalized settings shared by several installations of Celestia. This one is parsed after the system wide config file which is installation dependent.

So the safest is to put in ~/.celestia.cfg:

Code: Select all

Configuration
{
  LuaHook "~/[...]/luahookinit.lua"
}


so you're sure it will be used whichever celestia binary you're using.

Okay, that explains it. And also how typical that is.. I go Gnome and the good stuff is for KDE..


Well, now that you're all set up it may be time to get your hands dirty with the code and help improve the Gnome version ;-)
Christophe

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #28by tech2000 » 26.06.2007, 22:46

Christophe wrote:
tech2000 wrote:Are there more than one config file? I have edited the one on in the celestia root directory.

You can easily end up with several if you have another installation of Celestia. Typicaly if you install a deb, you have /etc/celestia.cfg which points to /usr/share/celestia/celestia.cfg but isn't used by your compiled binary.

You can also use ~/.celestia.cfg which allows you to have personalized settings shared by several installations of Celestia. This one is parsed after the system wide config file which is installation dependent.

So the safest is to put in ~/.celestia.cfg:

Code: Select all

Configuration
{
  LuaHook "~/[...]/luahookinit.lua"
}


so you're sure it will be used whichever celestia binary you're using.

Okay, that explains it. And also how typical that is.. I go Gnome and the good stuff is for KDE..

Well, now that you're all set up it may be time to get your hands dirty with the code and help improve the Gnome version ;-)


Okay, let me be as clear as possible.. 8)
I haven't installed Celestia from a deb file yet.. (First I need to make me one :wink: )
I did check for the config file in your suggested paths, ie:
/etc/celestia.cfg
/usr/share/celestia/celestia.cfg
None of the above files exist.

And I really don't get this part: ~/.celestia.cfg ?

I do believe that you are on the right track since I renamed the StarDatabase "data/stars.dat" in the config just to see if Celestia loaded the stars anyway, which it did... :(
Now I really don't know were to look for it.. Please bare in mind that I'm really fresh on this platform.. I have been playing around with Linux now in very short time.. I still have a long way to go.

About translating Gnome, sure that could be fun as long as it doesn't include programing. I have just recently compiled for the first time in.. ..hmm.. ..15 years or so. I might also add that I haven't 'installed' Celestia yet.. I'm running it from the compiled files in the same directory I downloaded the cvs files to according to the earlier help I have received in this thread.

Bye, Anders

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #29by Christophe » 27.06.2007, 07:41

tech2000 wrote:Okay, let me be as clear as possible.. 8)
I haven't installed Celestia from a deb file yet.. (First I need to make me one :wink: )
I did check for the config file in your suggested paths, ie:
/etc/celestia.cfg
/usr/share/celestia/celestia.cfg
None of the above files exist.

And I really don't get this part: ~/.celestia.cfg ?

Sorry, that wasn't clear for a unix 'newbie'. '~' is a shorthand for your home directory, it is equivalent do $HOME. Try "echo ~" or "echo $HOME".

'~' in front of a username is also a shorthand for that user's home. "echo ~root".

When a filename starts with a dot, that makes that file hidden. It isn't listed by default by 'ls' and doesn't show in file managers. 'ls -a' list all files including hidden ones.

By convention, most Unix programs use a systemwide configuration file which is in /etc, and a user configuration file which is hidden in the user's home, see "ls -al ~".

Following this convention Celestia allows each user to override systemwide settings in its "~/.celestia.cfg" file.

tech2000 wrote:I do believe that you are on the right track since I renamed the StarDatabase "data/stars.dat" in the config just to see if Celestia loaded the stars anyway, which it did... :(
Now I really don't know were to look for it.. Please bare in mind that I'm really fresh on this platform.. I have been playing around with Linux now in very short time.. I still have a long way to go.

Ok, one way to know which .cfg file is used is to trace celestia. strace is a utility which reports all system calls done by a process:

Code: Select all

strace -f -e chdir celestia

it will report something like:

Code: Select all

[pid   444] chdir("/usr/share/celestia") = 0


which is the home directory where celestia will look for celestia.cfg.

tech2000 wrote:About translating Gnome, sure that could be fun as long as it doesn't include programing. I have just recently compiled for the first time in.. ..hmm.. ..15 years or so. I might also add that I haven't 'installed' Celestia yet.. I'm running it from the compiled files in the same directory I downloaded the cvs files to according to the earlier help I have received in this thread.


Ok, that may be the source of your problem, running Celestia uninstalled may lead to some side effects. You should run configure with --prefix=/usr/local and run make install. The configuration file will be /usr/local/share/celestia/celestia.cfg, but as I said before it is best to leave the systemwide file as is and put your personnalized settings in ~/.celestia.cfg, otherwise next time you upgrade Celestia your conf will be lost.
Christophe

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #30by tech2000 » 27.06.2007, 12:59

Now things are getting much clearer..

I did 'strace -f -e chdir celestia' and found out that Celestia is running from

/usr/local/gnome/share/celestia/

and of course that makes sense now when I take a better look at ./configure

./configure --prefix=/usr/local/gnome --with-gnome --with-lua --enable-theora
After the ./configure... I did 'make' & 'sudo make install' but the Celestia
executable is not to be found in /usr/local/gnome/share/celestia where the
rest of all files seems to be.

Apart from that, Celestia wont start if I copy the luahookinit.lua into the
/usr/local/gnome/share/celestia directory, but starts again as normal as soon
as the file is removed from there... Can this have something to do with me
using Ubuntu 64 bit?

I will take a good look at your make deb file script and see if I can make
me one to see if that makes any difference...

Bye, Anders

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Post #31by steffens » 27.06.2007, 13:11

tech2000 wrote:./configure --prefix=/usr/local/gnome --with-gnome --with-lua --enable-theora
After the ./configure... I did 'make' & 'sudo make install' but the Celestia
executable is not to be found in /usr/local/gnome/share/celestia where the
rest of all files seems to be.
Using that prefix, the executable will be /usr/local/gnome/bin/celestia (=<prefix>/bin/celestia). This is a very uncommon place to install software, why not just use prefix=/usr/local (the default)? In this case, the executable will be in /usr/local/bin, which is in PATH.

tech2000 wrote:Apart from that, Celestia wont start if I copy the luahookinit.lua into the
/usr/local/gnome/share/celestia directory, but starts again as normal as soon as the file is removed from there... Can this have something to do with me
using Ubuntu 64 bit?

No idea what's wrong here. Did you put the files from the extras folder of the LuaEduTools.zip to /usr/local/gnome/share/celestia/extras? Are there any messages when starting Celestia from commandline?

steffens

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #32by Christophe » 27.06.2007, 13:33

tech2000 wrote:Apart from that, Celestia wont start if I copy the luahookinit.lua into the
/usr/local/gnome/share/celestia directory, but starts again as normal as soon
as the file is removed from there... Can this have something to do with me
using Ubuntu 64 bit?


You also need to have the luahook add-on in one of your extras dir, otherwise Celestia won't start. You can use --extrasdir=... on the command line to specify an additional extras dir.
Christophe

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #33by t00fri » 27.06.2007, 13:40

Sorry for joking a bit:

judging from the 31 posts about "Compiling Celestia in Ubuntu", this looks like a pretty complicated task ;-)

Also it seems to be misplaced. This extensive topic is definitely about Celestia and could be helpful to others. So why is it lurking in Purgatory??


Cheers,
Fridger
Image

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #34by selden » 27.06.2007, 13:47

'cause that's where tech2000 started it.

I've moved it to the Users forum.
Selden

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #35by tech2000 » 27.06.2007, 13:49

steffens wrote:
tech2000 wrote:./configure --prefix=/usr/local/gnome --with-gnome --with-lua --enable-theora
After the ./configure... I did 'make' & 'sudo make install' but the Celestia
executable is not to be found in /usr/local/gnome/share/celestia where the
rest of all files seems to be.
Using that prefix, the executable will be /usr/local/gnome/bin/celestia (=<prefix>/bin/celestia). This is a very uncommon place to install software, why not just use prefix=/usr/local (the default)? In this case, the executable will be in /usr/local/bin, which is in PATH.
Well, now I know better, please bare in mind that I have followed the instructions step by step, and was told to do so earlier in this thread, I just changed kde -> gnome for obvious reasons. Now I have learned that lesson... But before I can redo the ./configure part I want to know how to remove the files created in /usr/local/gnome/share/celestia. Is there an easy way to do that?

tech2000 wrote:Apart from that, Celestia wont start if I copy the luahookinit.lua into the
/usr/local/gnome/share/celestia directory, but starts again as normal as soon as the file is removed from there... Can this have something to do with me
using Ubuntu 64 bit?
No idea what's wrong here. Did you put the files from the extras folder of the LuaEduTools.zip to /usr/local/gnome/share/celestia/extras? Are there any messages when starting Celestia from commandline?

steffens


Yes all files are in the correct directory. I have checked it and I'm running a self made addon for some better textures for our planet. And that one is found only in the extras found in this 'bad' path together with the lua_edu_tools.

And I get no messages from starting Celestia from the CLI except a list of the the loaded shaders.

One other question: How do I run the script to make the debfile? :oops:

Bye, Anders

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #36by tech2000 » 27.06.2007, 13:53

t00fri wrote:Sorry for joking a bit:

judging from the 31 posts about "Compiling Celestia in Ubuntu", this looks like a pretty complicated task ;-)

Also it seems to be misplaced. This extensive topic is definitely about Celestia and could be helpful to others. So why is it lurking in Purgatory??


Cheers,
Fridger


Compiling it was a child's task. Doing it the 'correct' way and having lua_edu_tools on it was different... :wink:

I'm blindly following the steps given here. I will experiment much more when I got the hang of it... I'm still learning to crawl here.. hehe

Bye, Anders

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #37by tech2000 » 27.06.2007, 14:01

Christophe wrote:
tech2000 wrote:Apart from that, Celestia wont start if I copy the luahookinit.lua into the
/usr/local/gnome/share/celestia directory, but starts again as normal as soon
as the file is removed from there... Can this have something to do with me
using Ubuntu 64 bit?

You also need to have the luahook add-on in one of your extras dir, otherwise Celestia won't start. You can use --extrasdir=... on the command line to specify an additional extras dir.

I did put the luatoolsinit.lua in the celestia root directory and all content of the luatools extras into the celesta/extras/

Do I also need to put an extra copy of the luatoolsinit.lua into the extras directory? If not, I'm not sure I follow this:
You also need to have the luahook add-on in one of your extras dir, otherwise Celestia won't start.


And thank you all for your patience, I'm doing my best here.. :wink:
And strangely enough that for some reasons isn't that easy as I first though.. :lol: But heck, I will get there... 8)

Bye, Anders

Topic author
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #38by tech2000 » 27.06.2007, 14:06

selden wrote:'cause that's where tech2000 started it.

I've moved it to the Users forum.


I though I would be asking a few questions and that would be it... hehe, How wrong I was..

Well, all this info can be used to write a small guide. 'How to compile Celestia in Linux'.. I might do that after I gain some more experience on the subject.

Cheers, Anders

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Post #39by steffens » 27.06.2007, 15:15

tech2000 wrote:But before I can redo the ./configure part I want to know how to remove the files created in /usr/local/gnome/share/celestia. Is there an easy way to do that?

A "make uninstall" should remove everything that was installed by "make install".

steffens

ElecMoHwk
Posts: 33
Joined: 02.12.2006
With us: 17 years 11 months
Location: JPL

Post #40by ElecMoHwk » 20.07.2007, 12:16

Just to add a note... Photoshop should not be any reason to stick to windows!

Code: Select all

apt-get install gimp


Return to “Celestia Users”