Jump to content

[Build 0AD from Source] *nix Wrapper


Radagast.
 Share

Recommended Posts

I wish to share with our open source community the following small shell script:

https://github.com/faerietree/shell__0ad_build_from_anywhere_with_a_oneliner

It wraps the already nice 0AD build scripts, use it like this:

chmod +x build0ad_on_linux.txt     # make executable. (only required once)./buildengine_on_linux.txt --prefix /my/path/into/downloaded/0ad-repo --debug --update_repo --clean

You can omit --update_repo, --debug and an optional --svn parameter.

The --prefix can be ommitted if your $HOME directory is where you put the 0AD sources you downloaded (hopefully via Git/SVN to be able to contribute back, e.g. by sharing your mods).

So in the easiest case, it's just:

./build0engine_on_linux.txt

The location of the script is not important, it works from anywhere, just call it.


Purpose:
I have created it because I always forgot in which path to switch next before initiating the next command (it's getting more and more complicated the more projects have to be compiled from source).




Caveats:

  • We could add a fallback to check for th 0ad sources in the current directory. Currently it's relying on your input (--prefix) or the default $HOME/0ad.
  • It always calls the update workspace script. There are edge-cases when you might not desire this.
  • Currently only using 1 of your CPUs. This can be set in the script, if you like, I add it as a command line option (but it requires to know that j3 is for using 2CPU and j2 for 1!). It's 1 just to be safe.

Upload software is crazy, is it? Restricting filetypes without sense? Why this hassle? (This is a general issue and not related to 0AD, wildfiregames or the quite useful forum software of the 0AD forum.)
=> uploaded a .txt you don't have to rename it. Just use it as such.

Edit:

Call like this to initiate a non-default repository location. Using --prefix= where there was a typo and therefore it didn't work until Thursday, July 3rd 2014.

/path/to/build0ad_on_linux.txt --prefix=$HOME"/0ad_dev/"

Edit:

Add option to update repository.

build0ad_on_linux.txt

Edited by Radagast.
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Note that -jx means there will be x number of threads. So it works on all processors, but if your number of threads is a lot bigger than the number of processors, it will just make your system very unresponsive.

I have 4 cores, and either build with -j3, if I know it will take long, and want to do other stuff. Or -j8 if I'm planning to watch it until it's done.

And for the script, I don't know why so many people are writing build scripts for 0 A.D. Once you have the right dependencies, building it is just one to four commands. And with auto-complete just a few tabs away.

Link to comment
Share on other sites

true, to avoid the system getting busy and fully unresponsive I chose -j1 as default.

also true that it's not complicated, but my script can be called from anywhere, no matter in which folder you are. It's arguable if it's useful, but as I already created it, I also wanted to share it.

Link to comment
Share on other sites

  • 2 weeks later...

There was a typo. Only affected when the 0ad repository has not been checked out into $HOME/0ad but for example into $HOME/0ad_dev.

Now fixed in newest version. (attached in first post).

Call like this to initiate a non-default repository location. Using --prefix.

/path/to/build0ad_on_linux.txt --prefix=$HOME"/0ad_dev/"
Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...