SourceMod-Compile is primarily a script for Vagrant, a program that uses Oracle’s VirtualBox to build configurable, lightweight, and portable virtual machines dynamically, to allow you to quickly and easily provision a virtual environment that you can use to compile SourceMod extensions for Linux.

The environment that is setup is aimed at extensions using the AMBuild build system (which is the preferred one), but with some fiddling you should be able to build any extension.

Here is the relevant chapters from Vagrant's Getting Started guide to give you a head-start in compiling SourceMod extensions.

Get VirtualBox

Vagrant depends on Oracle’s VirtualBox to create all of its virtual environments. VirtualBox is a general-purpose full virtualiser for x86 hardware. Targeted at server, desktop and embedded use, it is a professional-quality virtualisation solution that is also open source software. VirtualBox runs on Windows, Mac OS X, Linux, and Solaris.

Here is a link directly to the download page.

Vagrant currently supports VirtualBox 4.0.x, 4.1.x and 4.2.x.

Install Vagrant

To install Vagrant, download the appropriate package or installer from the downloads page, and install it using standard operating system procedures. On Windows and Mac OS X, the vagrant command should automatically be placed on your PATH. On other systems, you must add /opt/vagrant/bin to your PATH.

If a Vagrant package is not available for your platform, you can also install using RubyGems via a gem install vagrant. But note that the packages are the preferred and best supported method of installation.

Starting Your New Environment

Now you've done all that, this is the simple part! Just run

vagrant up

from the directory you cloned this repository into and you'll see Vagrant download the base box image, spin-up the VM, and then finally run the Puppet script that downloads all the required packages and SDKs for building SourceMod extensions. This process will take roughly 10 - 15 minutes.

By default, this will create a directory called src in the repository root. Here you can drop all the projects you want to compile (however you wish to organise them, AMBuild recursively searches upwards for SDKs).

When you're ready to compile, run

vagrant ssh

to be immediately dropped into a SSH session with the VM, you can then cd into the source directory and run whatever commands you need.

Note: On Windows, vagrant ssh will instead print the information required to connect your favourite SSH client to the virtual machine. See here for more information.

To update all the SDKs to the latest version, simply run

vagrant provision

this will also synchronise any changes to the Puppet files (as long as your copy of this repository is up-to-date) such as additional SDKs or keeping up with release versions.

See the Vagrant documentation for more commands for such tasks as shutting down the VM or starting from a clean slate.