Radagast. Posted April 13, 2014 Report Share Posted April 13, 2014 (edited) 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_onelinerIt 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 --cleanYou 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.txtThe 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 January 4, 2015 by Radagast. 1 Quote Link to comment Share on other sites More sharing options...
auron2401 Posted June 20, 2014 Report Share Posted June 20, 2014 Goddarn, Champ. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 20, 2014 Report Share Posted June 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 20, 2014 Author Report Share Posted June 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted July 3, 2014 Author Report Share Posted July 3, 2014 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/" Quote Link to comment Share on other sites More sharing options...
Radagast. Posted January 4, 2015 Author Report Share Posted January 4, 2015 Update:- Added Github.- Added option to update repo.- Added option to clean before updating workspaces.- Works for both SVN and Git. Tell me if not. (Still *nix operating systems only.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.