summaryrefslogtreecommitdiff
blob: 45351c5eb0e03375e67c5e35e8f9c82331490e9f (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
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/gnustep-base/gnustep-make/gnustep-make-1.10.0.ebuild,v 1.5 2004/11/12 03:46:56 fafhrd Exp $

inherit gnustep

DESCRIPTION="The makefile package is a simple, powerful and extensible way to write makefiles for a GNUstep-based project."

HOMEPAGE="http://www.gnustep.org"
SRC_URI="ftp://ftp.gnustep.org/pub/gnustep/core/${P}.tar.gz"
KEYWORDS="~x86 ~ppc ~amd64 ~sparc ~alpha"
SLOT="0"
LICENSE="GPL-2"

IUSE="${IUSE} doc"
DEPEND="${GNUSTEP_CORE_DEPEND}
	>=sys-devel/make-3.75
	${DOC_DEPEND}"
RDEPEND="${DEPEND}
	${DOC_RDEPEND}"

pkg_setup() {
	gnustep_pkg_setup

	# okay, I couldn't figure out how to check if a dependency was
	#  compiled with a specific use flag, so we do it ./configure
	#  check-for-lib style ...
	gcc ${FILESDIR}/helloworld.m -o $TMP/helloworld -lobjc || die \
		"gcc must be compiled with Objective-C support! See the objc USE flag."
}

src_unpack() {
	unpack ${A}
	EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/make-user-defaults.patch-${PV}
}

src_compile() {
	cd ${S}

	myconf="--prefix=${GENTOO_GNUSTEP_ROOT}"
	myconf="$myconf --with-network-root=${GENTOO_GNUSTEP_ROOT}/Network"
	myconf="$myconf --with-tar=/bin/tar"
	econf $myconf || die "configure failed"

	egnustep_make
}

src_install() {
	. ${S}/GNUstep.sh

	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
		if use debug ; then
			emake -j1 INSTALL_ROOT=${D} \
				GNUSTEP_SYSTEM_ROOT=${D}${GNUSTEP_SYSTEM_ROOT} \
				GNUSTEP_NETWORK_ROOT=${D}${GNUSTEP_NETWORK_ROOT} \
				GNUSTEP_LOCAL_ROOT=${D}${GNUSTEP_LOCAL_ROOT} \
				debug=yes install || die "install has failed"
		else
			emake -j1 INSTALL_ROOT=${D} \
				GNUSTEP_SYSTEM_ROOT=${D}${GNUSTEP_SYSTEM_ROOT} \
				GNUSTEP_NETWORK_ROOT=${D}${GNUSTEP_NETWORK_ROOT} \
				GNUSTEP_LOCAL_ROOT=${D}${GNUSTEP_LOCAL_ROOT} \
				install || die "install has failed"
		fi
	else
		die "no Makefile found"
	fi

	. ${D}${GENTOO_GNUSTEP_ROOT}/System/Library/Makefiles/GNUstep.sh

	if use doc ; then
		cd Documentation
		make INSTALL_ROOT=${D} \
			GNUSTEP_SYSTEM_ROOT=${D}${GNUSTEP_SYSTEM_ROOT} \
			GNUSTEP_MAKEFILES=${D}${GENTOO_GNUSTEP_ROOT}/System/Library/Makefiles \
			GNUSTEP_USER_ROOT=${TMP}/GNUstep \
			GNUSTEP_DEFAULTS_ROOT=${TMP}/GNUstep \
			all || die "doc build failed"
		make INSTALL_ROOT=${D} \
			GNUSTEP_SYSTEM_ROOT=${D}${GNUSTEP_SYSTEM_ROOT} \
			GNUSTEP_MAKEFILES=${D}${GENTOO_GNUSTEP_ROOT}/System/Library/Makefiles \
			GNUSTEP_USER_ROOT=${TMP}/GNUstep \
			GNUSTEP_DEFAULTS_ROOT=${TMP}/GNUstep \
			install || die "doc install failed"
		cd ..
	fi
}