]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Adding Vagrantfile for easier compile environment setup
authordragon788 <dragon788@users.noreply.github.com>
Mon, 4 Jan 2016 04:21:30 +0000 (22:21 -0600)
committerdragon788 <dragon788@users.noreply.github.com>
Mon, 4 Jan 2016 04:21:30 +0000 (22:21 -0600)
.gitignore
Vagrantfile [new file with mode: 0644]
avr_setup.sh [new file with mode: 0644]

index f3f46872a07e990dcf0f8dca6c8de554d0fdce66..e6652999e730e6e1c8b0bdc9627cc96c59d1ae63 100644 (file)
@@ -11,3 +11,4 @@ tags
 *~
 build/
 *.bak
+.vagrant/
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644 (file)
index 0000000..e1082a0
--- /dev/null
@@ -0,0 +1,45 @@
+# -*- mode: ruby -*-\r
+# vi: set ft=ruby :\r
+\r
+Vagrant.configure(2) do |config|\r
+  config.vm.box = "dragon788/arch-ala-elasticdog"\r
+\r
+  # This section allows you to customize the Virtualbox VM\r
+  # settings, ie showing the GUI or upping the memory\r
+  # or cores if desired\r
+  config.vm.provider "virtualbox" do |vb|\r
+    # Hide the VirtualBox GUI when booting the machine\r
+    vb.gui = false\r
+  \r
+    # Customize the amount of memory on the VM:\r
+    vb.memory = "512"\r
+  end\r
+\r
+  # This section allows you to customize the VMware VM\r
+  # settings, ie showing the GUI or upping the memory\r
+  # or cores if desired\r
+  config.vm.provider "vmware" do |vmw|\r
+    # Hide the VMware GUI when booting the machine\r
+    vmw.gui = false\r
+  \r
+    # Customize the amount of memory on the VM:\r
+    vmw.memory = "512"\r
+  end\r
+\r
+  # This ensures the system always gets the latest updates when powered on\r
+  # If this causes issues you can run a 'vagrant destroy' and then\r
+  # comment out these three lines and run 'vagrant up' to get a working\r
+  # non-updated box and then attempt to troubleshoot after it has started\r
+  #\r
+  config.vm.provision "shell", run: "always", inline: <<-SHELL\r
+    sudo pacman -Syu --needed --noconfirm\r
+  SHELL\r
+  \r
+  # Allow user to speed up package installs using powerpill/wget tweaks\r
+  # Always run the pacman mirror update script if possible when vagrant comes up\r
+  # This will ensure that users never get stalled on a horribly slow mirror\r
+\r
+  config.vm.provision "shell", path: "avr_setup.sh"\r
+\r
+  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."""\r
+end\r
diff --git a/avr_setup.sh b/avr_setup.sh
new file mode 100644 (file)
index 0000000..ff4153b
--- /dev/null
@@ -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