Page 1 of 1

SGDK Development Vagrantfile

Posted: Sun Aug 17, 2014 8:25 pm
by kubilus1
I wrote a Vagrantfile that sets up a linux development environment with SGDK. This should allow Genesis development for any operating system that supports Vagrant.

Code: Select all

# -*- mode: ruby -*-
# vi: set ft=ruby :

#Vagrant::Config.run do |config|
Vagrant.configure("2") do |config|
  # All Vagrant configuration is done here. The most common configuration
  # options are documented and commented below. For a complete reference,
  # please see the online documentation at vagrantup.com.

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "ubuntu/precise32"

  config.vm.provision "shell", inline: "apt-get update"
  config.vm.provision "shell", inline: "apt-get install -y vim screen subversion build-essential unzip texinfo"
  config.vm.provision "shell", inline: "mkdir -p src", privileged: false
  config.vm.provision "shell", inline: "cd src && svn checkout http://gendev.googlecode.com/svn/trunk/ gendev-read-only", privileged: false
  config.vm.provision "shell", inline: "cd src/gendev-read-only && make", privileged: false
  config.vm.provision "shell", inline: ". ~/.gendev && cd src/gendev-read-only/sgdk && make install", privileged: false
  config.vm.provision "shell", inline: "wget http://segaretro.org/images/7/75/Gens_2.16.7_i386.deb", privileged: false
  config.vm.provision "shell", inline: "dpkg -i Gens_2.16.7_i386.deb; apt-get install -yf"

  #config.vm.synced_folder "~", "/home/curuser"
  
  config.ssh.forward_x11 = true

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", "2048"]
    vb.customize ["modifyvm", :id, "--cpus", "2"]  
    vb.customize ["modifyvm", :id, "--ioapic", "on"] 
  end  
end
For those unfamiliar with Vagrant, it is a system that allow repeatable platform independent development and testing environments.

See: http://www.vagrantup.com/

Posted: Sun Aug 17, 2014 9:07 pm
by Stef
Gens 2.16 ??

Posted: Sun Aug 17, 2014 9:34 pm
by kubilus1
Yeah, I couldn't find a newer version for Ubuntu floating around. Really this shouldn't be a show stopper, since you can have Vagrant build to the hosts filesystem. Just use whatever you link emulator wise on the host, or install other emulators in the Vagrant VM.

Posted: Sun Aug 17, 2014 9:38 pm
by Stef
Hehe,i didn't know that a 2.16 version existed, my last "official" version is 2.14 ;)
Anyway, well done for your vagrant "script", honestly i don't use it myself but i believe it will make life easier for many (and mostly linux i guess) SGDK users =)

Posted: Sun Aug 17, 2014 9:49 pm
by kubilus1
... Or for people that want to use FreeBSD or MacOSX.

Posted: Sun Aug 17, 2014 10:19 pm
by Stef
Yeah, they both are linux based system ;)

Posted: Mon Aug 18, 2014 12:31 am
by kubilus1
Nah. OsX and FreeBSD are BSD based systems, and are closer to truer Unix than Linux in a lot of ways. A completely different and parallel evolutionary path. Not to nit pick ;)

Posted: Mon Aug 18, 2014 8:58 am
by Stef
Ah yeah, i should have said "Unix" based system then ;)
For me Unix or Linux is almost the same :p

Posted: Tue Sep 23, 2014 10:56 pm
by Zontar
Does this use the latest SGDK?

Posted: Wed Sep 24, 2014 10:10 pm
by kubilus1
The Vagrantfile will do a linux build environment which currently builds SGDK at revision 176.

Posted: Thu Sep 25, 2014 12:14 am
by Mask of Destiny
I'm a little disappointed this installs Gens rather than BlastEm (no offense to Stef of course, Gens was great back in the day just unmaintained now). I've got gdb remote debugging support! I imagine you're sticking to a 32-bit Ubuntu to support those with a 32-bit OS? I suppose Gens makes a more reasonable choice in that case.

Posted: Thu Sep 25, 2014 9:56 am
by Stef
No offense, i totally agree with you on that point :p Gens is really outdated, not very accurate and does not support GDB debugging. To be honest i'm still looking for good GDB support on windows platform myself :-/

Posted: Thu Oct 23, 2014 9:06 pm
by Zontar
I posted this in the SGDK thread but it may better belong here. Does anyone else have trouble using the modulo (%) operator? My compiler using this setup gives an error when attempting to use it.

Posted: Fri Oct 24, 2014 6:12 pm
by kubilus1
It's easy enough to alter the script to install a 64 bit OS and install BlastEm or other emulators. That's the beauty of Vagrantfiles!

But even for this one, there is no need to run the emulator inside the VM. The directory that the Vagrantfile is on the host is mounted inside the VM at /vagrant.

This allows you to easily share stuff between vagrant VM and host. You development workflow might go something like:

Code: Select all

[inside vagrant]$ cd /vagrant/source_code
[inside vagrant]$ make

[outside vagrant]$  my_fav_emu out.bin
Also, it is easy to add more mounts to the vagrant VM. You simply add:

Code: Select all

config.vm.synced_folder "folder_on_host", "folder_in_vm"