Difference between revisions of "Compiling Mudlet"

From Mudlet
Jump to navigation Jump to search
Line 41: Line 41:
 
  exists(/usr/lib/x86_64-linux-gnu/libluajit-5.1.a):LIBLUA = -L/usr/lib/x86_64-linux-gnu/ -lluajit-5.1
 
  exists(/usr/lib/x86_64-linux-gnu/libluajit-5.1.a):LIBLUA = -L/usr/lib/x86_64-linux-gnu/ -lluajit-5.1
  
'''6. address the removal of yajl1 from the offical repos'''
+
'''6. address the removal of yajl1 from the offical repos (thanks to Blackice89 for this info from the arch compile guide)'''
 
  wget http://vrac.kadarniad.fr/lua_yajl2.c
 
  wget http://vrac.kadarniad.fr/lua_yajl2.c
 
  for i in *.{cpp,h} ; do sed -i 's/#include <phonon>/#include <phonon\/MediaObject>\n#include <phonon\/AudioOutput>/' $i ; done
 
  for i in *.{cpp,h} ; do sed -i 's/#include <phonon>/#include <phonon\/MediaObject>\n#include <phonon\/AudioOutput>/' $i ; done

Revision as of 10:27, 22 November 2012

Compiling on Ubuntu 12.10

1. Install GIT

sudo apt-get install git

2. Installing the needed packages

sudo apt-get install build-essential qt4-dev-tools lua5.1 liblua5.1-0-dev libpcre3-dev libboost-dev zlib1g-dbg zlib1g-dev libyajl2 \
libyajl-dev libyajl2-dbg liblua5.1-rex-pcre0 liblua5.1-sql-sqlite3-2 libphonon-dev libhunspell-dev libzzip-dev liblua5.1-zip0 \
liblua5.1-filesystem0

3. get mudlet source

git clone git://mudlet.git.sourceforge.net/gitroot/mudlet/mudlet

4. goto the mudlet src folder

cd mudlet/src

5.a edit src.pro like so (for 32bit):

replace the corresponding part near the beginning of the file with this:

LIBLUA = -llua5.1
!exists(/usr/lib/i386-linux-gnu/liblua5.1.a):LIBLUA = -llua

# automatically link to LuaJIT if it exists
exists(/usr/lib/i386-linux-gnu/libluajit-5.1.a):LIBLUA = -L/usr/lib/i386-linux-gnu/ -lluajit-5.1


5.b edit src.pro like so (for 64bit):

replace the corresponding part near the beginning of the file with this:

LIBLUA = -llua5.1
!exists(/usr/lib/x86_64-linux-gnu/liblua5.1.a):LIBLUA = -llua

# automatically link to LuaJIT if it exists
exists(/usr/lib/x86_64-linux-gnu/libluajit-5.1.a):LIBLUA = -L/usr/lib/x86_64-linux-gnu/ -lluajit-5.1

6. address the removal of yajl1 from the offical repos (thanks to Blackice89 for this info from the arch compile guide)

wget http://vrac.kadarniad.fr/lua_yajl2.c
for i in *.{cpp,h} ; do sed -i 's/#include <phonon>/#include <phonon\/MediaObject>\n#include <phonon\/AudioOutput>/' $i ; done
sed -i 's/lua_yajl1.c/lua_yajl2.c/' TLuaInterpreter.cpp
sed -i 's/-lhunspell/-lhunspell-1.3/' src.pro
sed -i 's/lua_yajl1.c/lua_yajl2.c/' src.pro
sed -i '/MOC_DIR.*/i QMAKE_MOC += -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED' src.pro
sed -i '/.*unix:LIBS.*/a -lz \\' src.pro

7. run the following commands

qmake-qt4
make
./mudlet


8. enjoy

Compiling on Ubuntu 11.10

1. Install GIT

sudo apt-get install git

2. Installing the needed packages

sudo apt-get install build-essential qt4-dev-tools lua5.1 liblua5.1-0-dev libpcre3-dev libboost1.46-dev zlib1g-dbg zlib1g-dev libyajl1
libyajl-dev libyajl1-dbg liblua5.1-rex-pcre0 liblua5.1-sql-sqlite3-2 libphonon-dev libhunspell-dev libzzip-dev liblua5.1-zip0 
liblua5.1-filesystem0

3. get mudlet source

git clone git://mudlet.git.sourceforge.net/gitroot/mudlet/mudlet

4. goto the mudlet src folder

cd mudlet/src

5.a edit src.pro like so (for 32bit):

replace the corresponding part near the beginning of the file with this:

LIBLUA = -llua5.1
!exists(/usr/lib/i386-linux-gnu/liblua5.1.a):LIBLUA = -llua

# automatically link to LuaJIT if it exists
exists(/usr/lib/i386-linux-gnu/libluajit-5.1.a):LIBLUA = -L/usr/lib/i386-linux-gnu/ -lluajit-5.1


5.b edit src.pro like so (for 64bit):

replace the corresponding part near the beginning of the file with this:

LIBLUA = -llua5.1
!exists(/usr/lib/x86_64-linux-gnu/liblua5.1.a):LIBLUA = -llua

# automatically link to LuaJIT if it exists
exists(/usr/lib/x86_64-linux-gnu/libluajit-5.1.a):LIBLUA = -L/usr/lib/x86_64-linux-gnu/ -lluajit-5.1

6. run the following commands

qmake-qt4
make
./mudlet


7. enjoy



Compiling in ArchLinux

The best way to do this would be to use the PKGBUILD found here. You'll just download the PKGBUILD into a directory, run

makepkg
sudo pacman -U [name of the generated pkg file]

and you'll be done. For more info on what this does, visit this site. If you really want to compile it by hand, please note that it won't be as simple due to ArchLinux' aggressive update philosophy. The instructions provided here might be outdated due to said philosophy, so you will have to know how to use Google, and you'll need to be willing to read through C++ compilation errors. If you're still willing to go through this, then read on.

1. Install required packages

Mudlet has a bunch of dependencies that you'll need to compile the source. You can get an updated list of packages here, it's just a matter of figuring out what they're called in pacman. As for the lua dependencies, I recommend you get luarocks, and use it to install them. You'll also need git to download the source.

2. Get the source through Git

Run the following in a terminal to get the source:

git clone git://mudlet.git.sourceforge.net/gitroot/mudlet/mudlet

it should download the source automatically.

3. Address yajl issue

There are two versions of yajl: 1 and 2. If you installed yajl via pacman, you probably have 2. If you do have two, then you'll have to download this file and add it into the src directory. If you do not want to do this, then download and install yajl1 from AUR.

3. Edit src.pro (to be improved)

Run the following in a terminal from the src directory:

for i in *.{cpp,h} ; do sed -i 's/#include <phonon>/#include <phonon\/MediaObject>\n#include <phonon\/AudioOutput>/' $i ; done
sed -i 's/lua_yajl1.c/lua_yajl2.c/' TLuaInterpreter.cpp
sed -i 's/-lhunspell/-lhunspell-1.3/' src.pro
sed -i 's/lua_yajl1.c/lua_yajl2.c/' src.pro
sed -i '/MOC_DIR.*/i QMAKE_MOC += -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED' src.pro
sed -i '/.*unix:LIBS.*/a -lz \\' src.pro
sed -i 's#QString path = \"mudlet-lua/lua/LuaGlobal.lua\";#QString path = \"/usr/local/share/mudlet/LuaGlobal.lua\";#' TLuaInterpreter.cpp

4. Compile the source

qmake
make

5. Run Mudlet

./mudlet