Installing the latest Haxe and Neko on Fedora

Installing and setting up the developer tools


To install Haxe and Neko on Fedora, you must first install the developer tools so you are able to build the RPMs. To install these and set them up for your account, open up your favourite terminal emulator and run:
yum install @development-tools fedora-packager
rpmdev-setuptree

Downloading the latest versions of Haxe and Neko


If you haven't already, install subversion by running:
yum install subversion

Then navigate to your repository folder if you have one and run:
svn checkout http://nekovm.googlecode.com/svn/trunk/ nekovm
svn checkout http://haxe.googlecode.com/svn/trunk/ haxe

Now you should have 2 folders, nekovm and haxe, with all the sources in each. Now, on your file manager right click the 'nekovm' folder and compress it into "~/rpmbuild/SOURCES/nekovm-2.0.0.tar.gz". Then do the same with Haxe to "~/rpmbuild/SOURCES/haxe-3.0.tar.gz". Now you can delete the folders if you want to, all we need are the sources.

Getting the RPM Specs


Create a new file "~/rpmbuild/SPECS/NEKOVM.spec"
Name:        nekovm
Version:    2.0.0
Release:    1%{?dist}
License:    GPLv2
Group:        Development/Languages
URL:        http://nekovm.org
Source:        %{name}-%{version}.tar.gz
Summary:    A cross-platform lightweight virtual machine and language.
BuildRequires:    httpd gc-devel gtk2 mysql-devel mysql-libs pcre-static sqlite zlib-static

%description
Neko VM is a virtual machine and dynamic language that is both lightweight and efficient.
%prep
sudo ln -s /usr/lib64/mysql/libmysqlclient_r.so /usr/lib64/mysql/libmysqlclient_r.a
%setup -q -n %{name}
%build
make clean all
%install
rm -r %{buildroot}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
cp %{_builddir}/%{name}/bin/neko %{buildroot}%{_bindir}
cp %{_builddir}/%{name}/bin/nekoc %{buildroot}%{_bindir}
cp %{_builddir}/%{name}/bin/nekoml %{buildroot}%{_bindir}
cp %{_builddir}/%{name}/bin/nekotools %{buildroot}%{_bindir}
cp %{_builddir}/%{name}/bin/*.ndll %{buildroot}%{_libdir}
cp %{_builddir}/%{name}/bin/*.so %{buildroot}%{_libdir}
%files
%{_bindir}/*
%{_libdir}/*

Then, create a new file "~/rpmbuild/SPECS/HAXE.spec". Enter this in:
Name:        haxe
Version:    3.0
Release:    RC1%{?dist}
License:    GPLv2
Group:        Development/Languages
URL:        http://code.google.com/p/haxe/
Source:        %{name}-%{version}.tar.gz
Summary:    A cross-target language akin to AS3 and Java.
BuildRequires:    nekovm, subversion, ocaml, sed, zlib, ocaml-camlp4, ocaml-camlp4-devel, zlib-static

%description
Haxe is a cross-target programming language inspired by Java and AS3 that allows you compile to lots of other programming languages/binaries.

%prep
%setup -q -n %{name}
%build
make clean > /dev/null
sed --in-place=.orig -e "s/\\(Haxe Compiler %d.%.2d\\) -/\\1 [SVN r$pkgver] -/" main.ml 
make libs
make haxe
HAXE_STD_PATH=%{_builddir}/%{name}/std make tools
mkdir -p "%{_builddir}/%{name}/doc"
cd %{_builddir}/%{name}/doc
rm -rf content *.xml
HAXE_STD_PATH=%{_builddir}/%{name}/std %{_builddir}/%{name}/haxe all.hxml
[ ! \( -f flash8.xml -a -f flash9.xml -a -f neko.xml -a -f js.xml -a -f php.xml -a -f cpp.xml \) ] && return 1
  %{_builddir}/%{name}/std/tools/haxedoc/haxedoc -v "flash8.xml;flash8;flash" "neko.xml;neko" "js.xml;js" "flash9.xml;flash" "php.xml;php" "cpp.xml;cpp"
  _res=$?

%install
rm -r %{buildroot}
mkdir -p %{buildroot}%{_datarootdir}/haxe/std
mkdir -p %{buildroot}%{_datarootdir}/haxe/doc
mkdir -p %{buildroot}%{_datarootdir}/haxe/lib
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}/etc/profile.d
cp %{_builddir}/%{name}/haxe %{buildroot}%{_bindir}
cp %{_builddir}/%{name}/haxelib %{buildroot}%{_bindir} 
cp %{_builddir}/%{name}/haxedoc %{buildroot}%{_bindir}
cp -r %{_builddir}/%{name}/std %{buildroot}%{_datarootdir}/haxe
cp -r %{_builddir}/%{name}/doc %{buildroot}%{_datarootdir}/haxe
echo "export HAXE_STD_PATH=%{_datarootdir}/haxe/std" >> %{buildroot}/etc/profile.d/haxe_init.sh

%files
%{_datarootdir}/haxe/*
/etc/profile.d/*
%{_bindir}/*

%post
chmod -R 777 %{_datarootdir}/haxe/lib
haxelib setup %{_datarootdir}/haxe/lib

Building and installing Neko


Enter this into a terminal:
rpmbuild -ba ~/rpmbuild/SPECS/NEKOVM.spec

This will build the Neko RPM. Then navigate to "~/rpmbuild/RPMS", pick your processor and install the Neko RPM. Now we can get to the main part: Haxe

Building and installing Haxe


Enter this into a terminal:
rpmbuild -ba ~/rpmbuild/SPECS/HAXE.spec

This will build the Haxe RPM. Then navigate to "~/rpmbuild/RPMS" again, pick your processor and install the Haxe RPM. Haxelib will already be set up for you.
version #17839, modified 2013-02-28 23:03:37 by TopHattedCoder