Last active
December 17, 2015 09:49
-
-
Save JbIPS/5590277 to your computer and use it in GitHub Desktop.
Script to install Haxe 3.0.0-RC2 along with another Haxe version. Create a symbolic link in /usr/lib/haxe which will target haxe3, but you can easily change it to target your older version (renamed /usr/lib/haxe2). Must be executed as root.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ -z $1]]; then | |
| v=3.0.0 | |
| else | |
| v=$1 | |
| fi | |
| echo "Downloading and installing Haxe3" | |
| curl http://haxe.org/file/haxe-$v-osx.tar.gz -o haxe-$v-osx.tar.gz && | |
| tar -xzf haxe-$v-osx.tar.gz && | |
| # Rename your old haxe version | |
| mv /usr/lib/haxe /usr/lib/haxe2 && | |
| # Create a dir for the new one | |
| mkdir /usr/lib/haxe3 && | |
| cp -r haxe-$v-osx/* /usr/lib/haxe3 && | |
| # Create the link that will make the switch | |
| ln -s /usr/lib/haxe3 /usr/lib/haxe && | |
| mv /usr/lib/haxe3/haxelib /usr/lib/haxe3/haxelib_bak && | |
| cp haxe-$v-osx/std/tools/haxelib/haxelib.sh /usr/lib/haxe3/haxelib && | |
| chmod +x /usr/lib/haxe3/haxelib && | |
| mkdir /usr/lib/haxe3/lib && | |
| chmod 777 /usr/lib/haxe3/lib && | |
| # Clean | |
| rm -rf haxe-$v-osx.tar.gz haxe-$v-osx && | |
| echo "Haxe $v installed successfully!" | |
| echo "Downloading and installing Neko 2" | |
| curl http://nekovm.org/_media/neko-2.0.0-osx.tar.gz -o neko-2.0.0-osx.tar.gz && | |
| tar -xzf neko-2.0.0-osx.tar.gz && | |
| cp neko-2.0.0-osx/libneko.dylib /usr/lib && | |
| cp neko-2.0.0-osx/neko neko-2.0.0-osx/nekoc neko-2.0.0-osx/nekotools neko-2.0.0-osx/nekoml neko-2.0.0-osx/nekoml.std /usr/bin && | |
| cp neko-2.0.0-osx/*.ndll /usr/lib/neko | |
| neko neko-2.0.0-osx/test.n | |
| rm -rf neko-2.0.0-osx.tar.gz neko-2.0.0-osx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment