Linux installer script and Haxe 3.2.0

Hi,

I just modified the linux install script for Haxe 3.2.0 and tested it on openSUSE. I just did not found the right place it in the openfl.org GitHub repos, otherwise I would have created a PR already.

Could anyone of you guys take care of it or maybe tell me, what repo to PR against?

Thanks + have fun,
JensG

1 Like

Yeah, I wish there was a little repo or gist to maintain, ATM, it’s a file that I extract, tweak and zip again :smile:

Would you mind sharing the updated script, and the tar.gz, here on the forums? I had forgotten that the installer was not available for 3.2 official, yet

Thanks!

You mean right here?
You could just follow the link, but ok … here we go.

#!/bin/sh


HAXE_VERSION=3.2.0
#HAXE_VERSION_COMMA=3,2,0 - no longer needed
NEKO_VERSION=2.0.0


if [ "$1" = "y" -o "$1" = "-y" ]; then
	
	echo "Do you want to install Haxe $HAXE_VERSION and Neko $NEKO_VERSION? (y/n) y"
	RESP=y
	
else
	
	read -p "Do you want to install Haxe $HAXE_VERSION and Neko $NEKO_VERSION? (y/n) " RESP
	
fi


if [ $RESP = "y" ]; then
	
	
	if [ -n "$(command -v yum)" ]; then
		
		echo ""
		echo "---------------------------------------"
		echo "    Installing Dependencies"
		echo "---------------------------------------"
		
		sudo yum -y install wget
		
	elif [ -n "$(command -v pacman)" ]; then
		
		echo ""
		echo "---------------------------------------"
		echo "    Installing Dependencies"
		echo "---------------------------------------"
		
		set -e
		sudo pacman -S wget --noconfirm
		
	elif [ -n "$(command -v apt-get)" ]; then
		
		echo ""
		echo "---------------------------------------"
		echo "    Removing Haxe (if installed)"
		echo "---------------------------------------"
		
		set +e
		sudo apt-get remove haxe neko
		set -e
		
	fi
	
	
	if [ `uname -m` = "x86_64" ]; then
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Downloading Neko $NEKO_VERSION (64-bit)"
		echo "---------------------------------------"	
	
		wget -c http://nekovm.org/_media/neko-$NEKO_VERSION-linux64.tar.gz
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Installing Neko $NEKO_VERSION"
		echo "---------------------------------------"
		
		# Extract and copy files to /usr/lib/neko
		
		tar xvzf neko-$NEKO_VERSION-linux64.tar.gz
		sudo mkdir -p /usr/lib/neko
		sudo rm -rf /usr/lib/neko/neko
		sudo rm -rf /usr/lib/neko/nekotools
		sudo cp -r neko-$NEKO_VERSION-linux/* /usr/lib/neko
		
		# Add symlinks
		
		sudo rm -rf /usr/bin/neko
		sudo rm -rf /usr/bin/nekoc
		sudo rm -rf /usr/bin/nekotools
		sudo rm -rf /usr/lib/libneko.so
		
		sudo ln -s /usr/lib/neko/libneko.so /usr/lib/libneko.so
		sudo ln -s /usr/lib/neko/neko /usr/bin/neko
		sudo ln -s /usr/lib/neko/nekoc /usr/bin/nekoc
		sudo ln -s /usr/lib/neko/nekotools /usr/bin/nekotools
		
		if [ -d "/usr/lib64" ]; then
			
			set +e
			sudo rm -rf /usr/lib64/libneko.so
			sudo ln -s /usr/lib/neko/libneko.so /usr/lib64/libneko.so
			set -e
			
		fi
		
		# Cleanup
		
		rm -rf neko-$NEKO_VERSION-linux
		rm neko-$NEKO_VERSION-linux64.tar.gz
		
		
	else
		
		
		echo ""
		echo "--------------------------------------"
		echo "    Downloading Neko $NEKO_VERSION (32-bit)"
		echo "---------------------------------------"	
		
		wget -c http://nekovm.org/_media/neko-$NEKO_VERSION-linux.tar.gz
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Installing Neko $NEKO_VERSION"
		echo "---------------------------------------"
		
		
		# Extract and copy files to /usr/lib/neko
		
		tar xvzf neko-$NEKO_VERSION-linux.tar.gz
		sudo mkdir -p /usr/lib/neko
		sudo rm -rf /usr/lib/neko/neko
		sudo rm -rf /usr/lib/neko/nekotools
		sudo cp -r neko-$NEKO_VERSION-linux/* /usr/lib/neko
		
		# Add symlinks
		
		sudo rm -rf /usr/bin/neko
		sudo rm -rf /usr/bin/nekoc
		sudo rm -rf /usr/bin/nekotools
		sudo rm -rf /usr/lib/libneko.so
		
		sudo ln -s /usr/lib/neko/neko /usr/bin/neko
		sudo ln -s /usr/lib/neko/nekoc /usr/bin/nekoc
		sudo ln -s /usr/lib/neko/nekotools /usr/bin/nekotools
		sudo ln -s /usr/lib/neko/libneko.so /usr/lib/libneko.so
		
		
		# Cleanup
		
		rm -rf neko-$NEKO_VERSION-linux
		rm neko-$NEKO_VERSION-linux.tar.gz
		
		
	fi
	
	
	# Install libgc, which is required for Neko
	
	if [ -n "$(command -v yum)" ]; then
		
		sudo yum -y install libgc
		
	elif [ -n "$(command -v pacman)" ]; then
		
		sudo pacman -S gc --noconfirm
		
	elif [ -n "$(command -v zypper)" ]; then
		
		sudo zypper --non-interactive install libgc1
		
	else
		
		sudo apt-get -y install libgc-dev
		
	fi
	
	if [ -d "/usr/lib64" ] && [ ! -f "/usr/lib64/libpcre.so.3" ]; then
		
		set +e
		sudo ln -s /usr/lib64/libpcre.so.1 /usr/lib64/libpcre.so.3
		set -e
		
	fi
	
	
	if [ `uname -m` = "x86_64" ]; then
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Downloading Haxe $HAXE_VERSION (64-bit)"
		echo "---------------------------------------"	
		
		wget -c http://haxe.org/website-content/downloads/$HAXE_VERSION/downloads/haxe-$HAXE_VERSION-linux64.tar.gz
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Installing Haxe $HAXE_VERSION"
		echo "---------------------------------------"
		
		
		# Extract and copy files to /usr/lib/haxe
		
		sudo mkdir -p /usr/lib/haxe
		sudo rm -rf /usr/lib/haxe/haxe
		sudo tar xvzf haxe-$HAXE_VERSION-linux64.tar.gz -C /usr/lib/haxe --strip-components=1
		
		
		# Add symlinks
		
		sudo rm -rf /usr/bin/haxe
		sudo rm -rf /usr/bin/haxelib
		sudo rm -rf /usr/bin/haxedoc
		
		sudo ln -s /usr/lib/haxe/haxe /usr/bin/haxe
		sudo ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib
		
		
		# Set up haxelib
		
		sudo mkdir -p /usr/lib/haxe/lib
		sudo chmod -R 777 /usr/lib/haxe/lib
		haxelib setup /usr/lib/haxe/lib
		
		
		# Cleanup
		
		rm haxe-$HAXE_VERSION-linux64.tar.gz
		
		
	else
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Downloading Haxe $HAXE_VERSION (32-bit)"
		echo "---------------------------------------"	
		
		wget -c http://haxe.org/website-content/downloads/$HAXE_VERSION/downloads/haxe-$HAXE_VERSION-linux32.tar.gz
		
		
		echo ""
		echo "---------------------------------------"
		echo "    Installing Haxe $HAXE_VERSION"
		echo "---------------------------------------"
		
		
		# Extract and copy files to /usr/lib/haxe
		
		sudo mkdir -p /usr/lib/haxe
		sudo rm -rf /usr/lib/haxe/haxe
		sudo tar xvzf haxe-$HAXE_VERSION-linux32.tar.gz -C /usr/lib/haxe --strip-components=1
		
		
		# Add symlinks
		
		sudo rm -rf /usr/bin/haxe
		sudo rm -rf /usr/bin/haxelib
		sudo rm -rf /usr/bin/haxedoc
		
		sudo ln -s /usr/lib/haxe/haxe /usr/bin/haxe
		sudo ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib
		
		
		# Set up haxelib
		
		sudo mkdir -p /usr/lib/haxe/lib
		sudo chmod -R 777 /usr/lib/haxe/lib
		sudo haxelib setup /usr/lib/haxe/lib
		
		
		# Cleanup
		
		rm haxe-$HAXE_VERSION-linux32.tar.gz
		
		
	fi
	
	
fi


echo ""

Oh sorry, I didn’t see the link :slight_smile:

Thanks!

http://www.openfl.org/builds/haxe/

Awesome!

The page at http://www.openfl.org/documentation/getting-started/installing-openfl/ still links to 3.1.3 as I write this, not to “latest”. By intention?

Have fun,
JensG

1 Like

That’s out-of-date, try http://www.openfl.org/download/