summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordragon788 <dragon788@users.noreply.github.com>2016-01-04 05:21:30 +0100
committerdragon788 <dragon788@users.noreply.github.com>2016-01-04 05:21:30 +0100
commitab7d6dca4106bae6876b46f06fe157478a62ecda (patch)
tree730d0ac1043d83aa4470af328914ad389dce295d
parenta07d2df99c74623ec3e5299a17bfaa621dfd7e2f (diff)
downloadqmk_firmware-ab7d6dca4106bae6876b46f06fe157478a62ecda.tar.gz
qmk_firmware-ab7d6dca4106bae6876b46f06fe157478a62ecda.tar.xz
Adding Vagrantfile for easier compile environment setup
-rw-r--r--.gitignore1
-rw-r--r--Vagrantfile45
-rw-r--r--avr_setup.sh23
3 files changed, 69 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index f3f46872a..e6652999e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ tags
*~
build/
*.bak
+.vagrant/
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 000000000..e1082a08d
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,45 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+ config.vm.box = "dragon788/arch-ala-elasticdog"
+
+ # This section allows you to customize the Virtualbox VM
+ # settings, ie showing the GUI or upping the memory
+ # or cores if desired
+ config.vm.provider "virtualbox" do |vb|
+ # Hide the VirtualBox GUI when booting the machine
+ vb.gui = false
+
+ # Customize the amount of memory on the VM:
+ vb.memory = "512"
+ end
+
+ # This section allows you to customize the VMware VM
+ # settings, ie showing the GUI or upping the memory
+ # or cores if desired
+ config.vm.provider "vmware" do |vmw|
+ # Hide the VMware GUI when booting the machine
+ vmw.gui = false
+
+ # Customize the amount of memory on the VM:
+ vmw.memory = "512"
+ end
+
+ # This ensures the system always gets the latest updates when powered on
+ # If this causes issues you can run a 'vagrant destroy' and then
+ # comment out these three lines and run 'vagrant up' to get a working
+ # non-updated box and then attempt to troubleshoot after it has started
+ #
+ config.vm.provision "shell", run: "always", inline: <<-SHELL
+ sudo pacman -Syu --needed --noconfirm
+ SHELL
+
+ # Allow user to speed up package installs using powerpill/wget tweaks
+ # Always run the pacman mirror update script if possible when vagrant comes up
+ # This will ensure that users never get stalled on a horribly slow mirror
+
+ config.vm.provision "shell", path: "avr_setup.sh"
+
+ config.vm.post_up_message = """Change directory to the keyboard you wish to program and modify your layout, then run 'make clean' and 'make' to compile the .eep and .hex files."""
+end
diff --git a/avr_setup.sh b/avr_setup.sh
new file mode 100644
index 000000000..ff4153ba3
--- /dev/null
+++ b/avr_setup.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# This script will attempt to setup the Linux dependencies for compiling QMK/TMK
+
+# This could probably go much lower, but since we are including an Arch vagrant,
+# making it the first match makes sense
+
+if [[ -n "$(type -P pacman )" ]]; then
+ # Arch linux and derivatives like Apricity
+ pacman -S --needed --noconfirm base-devel avr-gcc avr-binutils avr-libc dfu-utils
+
+elif [[ -n "$(type -P apt-get)" ]]; then
+ # Debian and derivatives
+ apt-get install -y build-essential gcc unzip wget zip gcc-avr binutils-avr avr-libc
+
+elif [[ -n "$(type -P yum)" ]]; then
+ # Fedora, CentOS or RHEL and derivatives
+ yum -y install gcc glibc-headers kernel-devel kernel-headers make perl git wget
+
+elif [[ -n "$(type -P zypper)" ]]; then
+ # openSUSE
+ zypper --non-interactive install git make gcc kernel-devel patch wget
+
+fi