summaryrefslogtreecommitdiff
blob: fc355561433ccfd4573cba86e479582c2da44dea (plain)
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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ada/garlic/garlic-3.15p-r1.ebuild,v 1.4 2003/10/28 20:03:25 dholm Exp $

inherit gnat

S="${WORKDIR}/glade-${PV}-src"
DESCRIPTION="The GNAT implementation of the ARM Annex for Distributed Systems."
SRC_URI="http://gd.tuwien.ac.at/languages/ada/gnat/3.15p/glade/glade-${PV}-src.tgz"

HOMEPAGE="http://www.gnat.com/"
LICENSE="GMGPL"
DEPEND="<dev-lang/gnat-5.0"
RDEPEND=""
SLOT="0"
IUSE=""
KEYWORDS="x86 ~ppc"

src_compile() {
	local CFLAGS="${ADACFLAGS} -fPIC"
	local ADACFLAGS="${ADACFLAGS} -fPIC"

#	./configure \
#		--host=${CHOST} \
#		--prefix=/usr \
#		--infodir=/usr/share/info \
#		--mandir=/usr/share/man || die "./configure failed"
	econf || die "./configure failed"
	emake || die

	${ADAC} -shared -Wl,-soname,libgarlic-${PV}.so.1 \
		-o Garlic/libgarlic-${PV}.so.1 Garlic/*.o -lc
}

src_install () {
	make prefix=${D}/usr \
		GARLIC=${D}/usr/lib/ada/adainclude/garlic install || die

	dodoc COPYING INSTALL NEWS README

	insinto /usr/lib/ada/adalib/garlic
	chmod 0755 Garlic/libgarlic-${PV}.so.1
	doins Garlic/libgarlic-${PV}.so.1
	cd ${D}/usr/lib/ada/adalib/garlic/
	ln -s libgarlic-${PV}.so.1 libgarlic-${PV}.so
	ln -s libgarlic-${PV}.so libgarlic.so
	dosym /usr/lib/ada/adalib/garlic/libgarlic-${PV}.so.1 /usr/lib
	dosym /usr/lib/ada/adalib/garlic/libgarlic-${PV}.so /usr/lib
	dosym /usr/lib/ada/adalib/garlic/libgarlic.so /usr/lib
	cd ${S}

	# And of course, as usualy make install does not conform to GNAE
	mv ${D}/usr/lib/ada/adainclude/garlic/*.ali \
		${D}/usr/lib/ada/adalib/garlic/
	mv ${D}/usr/lib/ada/adainclude/garlic/lib*.a \
		${D}/usr/lib/ada/adalib/garlic/

	#install examples
	cp -r Examples ${D}/usr/share/doc/${PF}/

	#set up environment
	dodir /etc/env.d
	echo "ADA_OBJECTS_PATH=/usr/lib/ada/adalib/${PN}" \
		> ${D}/etc/env.d/55garlic
	echo "ADA_INCLUDE_PATH=/usr/lib/ada/adainclude/${PN}" \
		>> ${D}/etc/env.d/55garlic
}

pkg_postinst() {
	einfo "The envaironment has been set up to make gnat automatically find files for"
	einfo "Garlic. In order to immediately activate these settings please do:"
	einfo "env-update"
	einfo "source /etc/profile"
	einfo "Otherwise the settings will become active next time you login"
}