1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100 | # Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# NOTE: neko's install.n checks for availability of optional libraries,
# prompting the user for a path if the library is not found.
# We disable this checking (with patch), and care for availability
# by using dependencies. The .ndlls will be built if the dependency
# is installed, but themselves installed only if the respecive
# USE flag is set.
EAPI="2"
inherit eutils depend.apache
DESCRIPTION="Intermediate programming language, compiler, and virtual machine"
HOMEPAGE="http://nekovm.org/"
SRC_URI="http://nekovm.org/_media/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="sqlite mysql apache2 gtk"
RDEPEND="
dev-libs/boehm-gc[threads]
dev-libs/libpcre
sys-libs/zlib
www-servers/apache[-threads]
sqlite? ( dev-db/sqlite:3 )
mysql? ( >=dev-db/mysql-5.0.44-r1 )
gtk? ( >=x11-libs/gtk+-2.10.9 )
"
DEPEND="${RDEPEND}
>=dev-lang/ocaml-2.08.3
gtk? ( >=dev-util/pkgconfig-0.21-r1 )
"
want_apache2
# FWICT, the neko/nekoc binaries contain the std library,
# so stripping them would deprive them of their runtime environment.
RESTRICT="strip nomirror"
src_unpack() {
unpack ${A}
cd ${S}
}
src_prepare() {
epatch ${FILESDIR}/${P}-gentoo.patch
epatch ${FILESDIR}/${P}-mysql_fpic.patch
sed -i -e "s:-Wall -O3:${CFLAGS}:" Makefile || die "CFLAGS Makefile 'sed' fix failed..."
sed -i -e "s:-O3 :${CFLAGS} :" src/tools/install.neko || die "CFLAGS install.neko 'sed' fix failed..."
}
src_compile() {
# this is commented out by default in the makefile, rather then patching around
# it, just change the cflags here based on the arch useflag.
if use amd64
then ${CFLAGS} = ${CFLAGS} -D_64BITS
fi
emake -j1 || die "emake failed"
}
src_install() {
exeinto /usr/bin
doexe bin/{neko,nekoc,nekoml,nekotools}
dolib.so bin/libneko.so || die "Could not install libneko.so!"
insinto /usr/lib/neko
doins bin/{std,regexp,zlib}.ndll || die "Could not install neko libraries!"
if use sqlite ; then
doins bin/sqlite.ndll || die "Could not install sqlite module!"
fi
if use mysql ; then
doins bin/mysql.ndll || die "Could not install mysql module!"
fi
if use gtk ; then
doins bin/ui.ndll || die "Could not install gtk module!"
fi
if use apache2 ; then
insinto ${APACHE_MODULESDIR}
doins bin/mod_neko2.ndll || die "Could not install mod_neko!"
insinto ${APACHE_MODULES_CONFDIR}
doins ${FILESDIR}/50_mod_neko.conf || die "Could not install 50_mod_neko.conf!"
fi
insinto /usr/include/neko
doins vm/neko.h || die "Could not install neko.h!"
doenvd ${FILESDIR}/50neko || die "Could not 'doenvd files/50neko'!"
}
|