BuildStendhalOnUbuntu: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Schmidta
imported>AntumDeluge
add page categories
 
(87 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Building Stendhal is very simple if you use ant and you satisfy the dependencies.
This guide, taken from [http://arianne.sourceforge.net/wiki/index.php?title=HowToBuildStendhal a more generic guide] will tech you how to build (compile) Stendhal on an Ubuntu machine. This guide was written with a Kubuntu 6.06 machine as the tester, so it should be pretty currect (at least for another 6 months).


== But first... are you sure that you don't want to use an IDE? ==
= Requirements =
This guide is aimed at those who just want to play the latest version of the game before it is officially released.
These are the requirements needed to build Stendhal
If you intend to do modifications to the game, it is recommended that you follow [[Configure a development environment (IDE)]] instead.
* [http://sourceforge.net/project/showfiles.php?group_id=1111&package_id=145790 Latest stendhal.X.xx-src.tar.gz package]
* [http://arianne.cvs.sourceforge.net/arianne/stendhal/libs/ Libs (all .jar files from there)]
* Sun Java SDK 1.5: sun-j2re1.5
** Note: You need to have the [http://doc.ubuntu-fr.org/doc/plf PLF repositories] to get the sun-j2re1.5 package
* ant
* ant-optional
** Note: You need to have your universe repositories enabled to get ant-optional


== Quick Req. Install ==
==Get the source Stendhal code ==
sudo apt-get update
sudo apt-get install liblog4j1.2-java sun-j2re1.5 jython ant ant-optional


First of all, you need to get the Stendhal source code. There are two ways:
cd ~
mkdir build
cd build
download the source from http://sourceforge.net/project/showfiles.php?group_id=1111&package_id=145790
tar xvzf stendhal*.tar.gz
cd stendhal*
mkdir libs
cd libs
now download the jar files from http://arianne.cvs.sourceforge.net/arianne/stendhal/libs/
* ant.jar
* jardiff.jar
* log4j.jar
* pircbot.jar
* tiled.jar
* velocity-dep-1.4.jar
* groovy.jar
* junit-4.1.jar
* marauroa.jar
* simple.jar
* velocity-1.4.jar
cd ..
ant


* Download the source distribution at https://arianne-project.org/download/stendhal-src.tar.gz Use <code>tar xzf stendhal-''version''-src.tar.gz</code> to unpack it.
= Building Time =
* Alternatively you can clone the git repository to get the latest development version: <code>sudo apt-get install git</code> and <code>git clone <nowiki>https://github.com/arianne/stendhal.git</nowiki></code>.
== Directory Structure ==
Extract Stendhal and Marauroa in their directory (the ~/build directory). Stendhal should have made it's own folder called stendhal-X.xx
tar -xvf stendhal*src.tar.gz
tar -xvf marauroa*.zip
Now make a directory called libs in the ~/build directory
mkdir libs
rename marauroa-X.xx.jar to simple marauroa.jar
cp marauroa*.jar marauroa.jar
now copy log4j.jar, marauroa.jar, and jython.jar to the libs directory
cp log4j.jar libs
cp marauroa.jar libs
cp jython.jar libs


==Requirements==
== Building with Ant ==

Change to the stendhal-X.xx directory
These are the requirements needed to build Stendhal:
cd stendhal*

Clean up the place first, just in case
* OpenJDK or Oracle JDK 1.8 ''or higher'' e.g.:
ant clean
sudo apt-get install openjdk-8-jdk
Now build!

* ant <br>http://ant.apache.org or e.g.:
sudo apt-get install ant ant-optional:

* node.js from https://nodejs.org

==Building with ant==

cd stendhal-''version''
ant clean && ant dist

This will create the binaries you should be already familiar with, such as:

===Client files===
:build/stendhal-''version''.zip
:build/stendhal-FULL-''version''.zip

===Server files===
:build/stendhal-server-''version''.zip

===Source files===
:build/stendhal-src-''version''.tar.gz

== Building just the jar files ==
'''Note:''' If you are unsure, follow the instructions described in the previous section (ant dist) to get a working system with all the files in the correct directory structure.

To only build the jar files, without putting them together inside a zip, you just write
ant
ant
And depending on how well the guide was written/you followed the guide, Stendhal will build.
The fully compiled binaries will be in ~/build/stendhal-X.xx/lib/


This will build a full set of JAR files at stendhal-''version''/build/lib folder:
=== Client Files ===

Needed to play.
===Client files===
stendhal-X.xx.jar
stendhal-data-X.xx.jar
:build/lib/stendhal-''version''.jar
:build/lib/stendhal-data-''version''.jar
:build/lib/stendhal-sound-data-''version''.jar

===Server files===
:build/lib/stendhal-server-''version''.jar
:build/lib/stendhal-xmlconf-''version''.jar
:build/lib/stendhal-maps-''version''.jar


== Trouble shooting ==
If you have the message error:
stendhal_source/build.xml:42: Could not create task or type of type: replaceregexp.

For linux users this is corrected by installing the "ant-apache-regexp" package. If you use debian or another debian dist (like Ubuntu) this is included in the "ant-optional" package.

== Finally ==
When you have successfully built Stendhal please read the install documentation. It is available on the Wiki at [[InstallingStendhal]].

In the future if you wish to just create the client and server jars (not zips and all release packages) then
ant clean compile
will suffice. Remember to "ant clean" before you "ant build" everytime - this is done automatically if you "ant dist", however.


=== Server Files ===
Needed if you make your own server
stendhal-server-X.xx.jar
stendhal-conf-X.xx.jar
stendhal-quests-X.xx.jar
stendhal-maps-X.xx.jar


[[Category:Stendhal]]
= To Play =
[[Category:Development]]
To play stendhal, simply copy the compiled binaries over your existing game (make a backup first, unless you want to re-download stendhal if you mess up).
[[Category:GNU Linux]]

Latest revision as of 00:25, 15 January 2022

Building Stendhal is very simple if you use ant and you satisfy the dependencies.

But first... are you sure that you don't want to use an IDE?

This guide is aimed at those who just want to play the latest version of the game before it is officially released. If you intend to do modifications to the game, it is recommended that you follow Configure a development environment (IDE) instead.

Get the source Stendhal code

First of all, you need to get the Stendhal source code. There are two ways:

  • Download the source distribution at https://arianne-project.org/download/stendhal-src.tar.gz Use tar xzf stendhal-version-src.tar.gz to unpack it.
  • Alternatively you can clone the git repository to get the latest development version: sudo apt-get install git and git clone https://github.com/arianne/stendhal.git.

Requirements

These are the requirements needed to build Stendhal:

  • OpenJDK or Oracle JDK 1.8 or higher e.g.:
sudo apt-get install openjdk-8-jdk
sudo apt-get install ant ant-optional:

Building with ant

cd stendhal-version 
ant clean &&  ant dist

This will create the binaries you should be already familiar with, such as:

Client files

build/stendhal-version.zip
build/stendhal-FULL-version.zip

Server files

build/stendhal-server-version.zip

Source files

build/stendhal-src-version.tar.gz

Building just the jar files

Note: If you are unsure, follow the instructions described in the previous section (ant dist) to get a working system with all the files in the correct directory structure.

To only build the jar files, without putting them together inside a zip, you just write

ant

This will build a full set of JAR files at stendhal-version/build/lib folder:

Client files

build/lib/stendhal-version.jar
build/lib/stendhal-data-version.jar
build/lib/stendhal-sound-data-version.jar

Server files

build/lib/stendhal-server-version.jar
build/lib/stendhal-xmlconf-version.jar
build/lib/stendhal-maps-version.jar


Trouble shooting

If you have the message error:

stendhal_source/build.xml:42: Could not create task or type of type: replaceregexp.

For linux users this is corrected by installing the "ant-apache-regexp" package. If you use debian or another debian dist (like Ubuntu) this is included in the "ant-optional" package.

Finally

When you have successfully built Stendhal please read the install documentation. It is available on the Wiki at InstallingStendhal.

In the future if you wish to just create the client and server jars (not zips and all release packages) then

ant clean compile

will suffice. Remember to "ant clean" before you "ant build" everytime - this is done automatically if you "ant dist", however.