My “Get AROS” Script

I mentioned in my previous blog post that I wanted the ability to easily build and install AROS from the current trunk, without repeating the same manual steps each time. Since I did not know at the time about the existing gimmearos script, I decided to write my own.

I’ve been a fan of command lines ever since I can remember.  I think that’s natural for anyone that started using computers before GUIs were available (at least for the masses). But I’ve also been spoiled by technology.  Between using a GUI desktop every day to having a smart phone that can do almost everything my desktop can do, with a GUI no less, I don’t use the command line as much as I used to.  I also haven’t used Linux much in the past 15 years, so I only know the basic shell commands.  Learning Linux (and shell scripting) is just one of the adventures awaiting my AROS journey.  🙂

Luckily, the commands that I needed to build AROS are available online.  This includes all of the package dependencies and the AROS build system itself.  The problem for a newcomer is that the information needed is not in a centralized location nor is the information consistent or up-to-date.  Once I figured out the current steps (and commands) needed, I was able to put together my script.

Programming mostly in DOS and Windows for the past 25 years certainly gave me enough experience to hack around on AROS.  However, there was (and still is) so much to learn before I can really get my hands dirty.  If you are new to Linux, you definitely need to learn how to use the package manager officially supported by the distribution.  For Debian (and I suspect related distros like Ubuntu), the package manager is apt-get, although there are several others.  Many of the programming environments and languages, such as Python and Go, have their own package managers as well.  These greatly simplify the task of installing what you need to develop in Linux, including compilers, build tools, editors, utilities, and source code libraries that you can use to avoid re-inventing the wheel for many common tasks.  Linux and GNU are both mature enough to make a very powerful development environment.  You just gotta learn a little.

I had other goals for my script aside from simplifying the process of building and installing AROS from scratch.  The first goal is that I wanted the ability to have multiple “versions” of AROS, basically local copies (or “branches”) of the AROS repository so I could experiment and break things without breaking my daily AROS environment.

I also wanted the ability to cross-compile AROS for other targets.  Although my preference is to easily build AROS from Linux, Mac, or Windows, Linux is definitely the most polished of the three as Linux is the platform used by most of the AROS developers.

I accomplished both goals using script variables, placed at the top of the script for easy adjustments.  Eventually I may add the ability to modify the script behavior using command line parameters.  At this point, the script isn’t used frequently enough for it to matter.

The last goal that I had for my script was to make it flexible enough and user-friendly enough to be published as an official “Get AROS” script.  However, that was before I discovered the existing gimmearos script, which is much more complete and definitely the route that I recommend.  Unless you’re like me and decide to write your own just for the learning experience.  🙂

In summary, I now have a decent script that I pieced together using commands and examples found online, using trial and error to figure out which ones really worked or did what I wanted, or how to modify the command to do what I wanted.  The script currently performs these actions:

  1. Set variables to control:
    1. Location where AROS source folder is located.
    2. Name of the AROS folder.  The folder name can be changed to easily allow multiple development copies (or local “branches”, if you prefer).
    3. Location of the download folder used by the AROS build system.  The same download folder may be re-used each time, avoiding the need to download required libraries each time.
    4. The destination platform for the AROS build, such as linux-i386 for “Linux Hosted”.
  2. Warn the user that the “AROS folder” (specified by the script variable) will be completely removed and allow the user to abort rather than continue the script.
  3. Remove the existing “AROS folder” and create a new, empty folder with the same folder name.
  4. Retrieve the current AROS trunk code using Subversion.
  5. Call the AROS configure script to configure the AROS build system for the target specified by the script variable.
  6. Call make to build AROS.

All stdout and stderror output is logged to a text file, along with build start and stop times.  However, it appears that not everything is making it to my log file.  I haven’t spent the time to investigate it further than confirming that the log file I shared with other developers (for assistance) was indeed truncated on my local system as well.

Not only does my script do what I wanted on Linux, but the exact same script worked in MacOS as well!  Of course I needed to change my variable values for folder location and target, but that was the purpose of the script.  🙂  (Do note that I had to have several MacOS specific prerequisites installed that are not handled by my script, such as MacPorts.)

So now I’m able to build and run AROS Native, AROS/Linux Hosted, and AROS/MacOS Hosted.  I started working on the steps to build AROS from Windows, but that’s a bit more of a learning curve than I’m interested in.  I’m really not interested in turning my Windows environment into a *nix environment.  I’ll use my Debian vm, thank you.  😉

If you’re wanting to grab the AROS source and build it yourself the first time, I still recommend the gimmearos script.  However, if you’d like to take a look at my script, possibly as an example for getting started on your own, you can grab my script from here.

 

 

Advertisements

Author: Jon Robertson

Software developer, Commodore hacker, and a fortunate husband and father!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s