SGDK Development Vagrantfile

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

SGDK Development Vagrantfile

Post by kubilus1 » Sun Aug 17, 2014 8:25 pm

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/

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sun Aug 17, 2014 9:07 pm

Gens 2.16 ??

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Sun Aug 17, 2014 9:34 pm

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.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sun Aug 17, 2014 9:38 pm

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 =)

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Sun Aug 17, 2014 9:49 pm

... Or for people that want to use FreeBSD or MacOSX.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sun Aug 17, 2014 10:19 pm

Yeah, they both are linux based system ;)

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Mon Aug 18, 2014 12:31 am

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 ;)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Aug 18, 2014 8:58 am

Ah yeah, i should have said "Unix" based system then ;)
For me Unix or Linux is almost the same :p

Zontar
Very interested
Posts: 55
Joined: Fri Oct 21, 2011 8:58 pm

Post by Zontar » Tue Sep 23, 2014 10:56 pm

Does this use the latest SGDK?

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Wed Sep 24, 2014 10:10 pm

The Vagrantfile will do a linux build environment which currently builds SGDK at revision 176.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Thu Sep 25, 2014 12:14 am

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.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Sep 25, 2014 9:56 am

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 :-/

Zontar
Very interested
Posts: 55
Joined: Fri Oct 21, 2011 8:58 pm

Post by Zontar » Thu Oct 23, 2014 9:06 pm

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.

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Fri Oct 24, 2014 6:12 pm

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"

Post Reply