Skip to content

Instantly share code, notes, and snippets.

@steverichey
Last active October 27, 2015 17:48
Show Gist options
  • Save steverichey/8cb0b7f125c454645d56 to your computer and use it in GitHub Desktop.
Save steverichey/8cb0b7f125c454645d56 to your computer and use it in GitHub Desktop.
Shell script to install HaxeFlixel and dependencies on a Wercker instance
#!/bin/bash
# Install script for application setup on Wercker boxes
# Exit script on error
set -e
echo "Updating apt-get"
# Without updating, apt-get won't find curl
apt-get update
echo "Installing curl"
# Required to download files and send status to Slack
apt-get -y install curl
echo "Installing GC for Neko"
# Dependency of Neko
apt-get -y install libgc-dev
echo "Installing git"
# Required to get development flixel
apt-get -y install git
echo "Downloading Haxe"
curl -O http://haxe.org/website-content/downloads/3.2.1/downloads/haxe-3.2.1-linux64.tar.gz
echo "Extracting Haxe"
tar xvzf haxe-3.2.1-linux64.tar.gz
echo "Downloading Neko"
# Required for haxelib, even if you're not building for Neko
curl -O http://nekovm.org/media/neko-2.0.0-linux64.tar.gz
echo "Extracting Neko"
tar xvzf neko-2.0.0-linux64.tar.gz
echo "Linking Neko"
# Required for haxelib to work
# Use local to ensure write permissions
# Linking does not work (not sure why), so copy instead
cp neko-2.0.0-linux/neko /usr/local/bin/neko
cp -a neko-2.0.0-linux/. /usr/lib/
echo "Linking Haxe"
cp haxe-3.2.1/haxe /usr/local/bin/haxe
cp haxe-3.2.1/haxelib /usr/local/bin/haxelib
# Make path for std library
mkdir /usr/local/lib/haxe/
mkdir /usr/local/lib/haxe/std/
# Copy std library
cp -a haxe-3.2.1/std/. /usr/local/lib/haxe/std/
echo "Setting up Haxelib"
# Setup Haxelib, and pipe in path for libraries
echo "/usr/local/haxe/lib/" | haxelib setup
# This allows haxelib selfupdate to work
# TODO: why does this work?
mkdir null
echo "Updating Haxelib"
# have to update haxelib from a different copy of haxelib
# see https://github.com/HaxeFoundation/haxelib/issues/189
./haxe-3.2.1/haxelib selfupdate
# If we don't remove the duplicate of haxelib now, it causes issues later
rm -rf ./haxe-3.2.1
# Go ahead and remove neko too
rm -rf ./neko-2.0.0-linux
# HAXEPATH has to be set for lime
HAXEPATH="/usr/local/bin/haxe"
echo "Installing files from Haxelib"
haxelib git flixel https://github.com/HaxeFlixel/flixel dev
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons.git
haxelib install hxcpp
haxelib install lime
haxelib install openfl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment