summaryrefslogtreecommitdiff
blob: 173ec37f4a539d386260f9e30321a48f128aae7f (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/cctools-extras/cctools-extras-525.ebuild,v 1.5 2005/02/27 21:57:10 kito Exp $

S=${WORKDIR}/cctools-${PV}

DESCRIPTION="Extra cctools"
HOMEPAGE="http://darwinsource.opendarwin.org/"
SRC_URI="http://darwinsource.opendarwin.org/tarballs/apsl/cctools-${PV}.tar.gz"

LICENSE="APSL-2"

SLOT="0"
KEYWORDS="ppc-macos"
IUSE="build"

DEPEND="sys-apps/bootstrap_cmds
		sys-libs/libstreams
		sys-libs/libsystem"

src_unpack() {
	unpack ${A}

	cd ${S}/ld
	sed -i -e 's:seg_hack:${S}/misc/seg_hack.NEW:' Makefile
}

src_compile() {
	cd ${S}
	rm -rf ar as cbtlibs dyld file gprof libdyld mkshlib otool
	make SUBDIRS="libmacho libstuff misc" RC_OS=macos || die "make failed"

	cd ${S}/ld
	make RC_OS=macos kld_build || die "static kld build failed"
}

src_install() {
	cd ${S}/misc
	newbin check_dylib.NEW check_dylib || die "check_dylib failed"
	newbin checksyms.NEW checksyms || die "checksyms failed"
	newbin dylib_pcsampler.NEW dylib_pcsampler || die "dylib_pcsampler failed"
	newbin indr.NEW indr || die "indr failed"
	newbin seg_addr_table.NEW seg_addr_table || die "seg_addr_table failed"
	newbin seg_hack.NEW seg_hack || die "seg_hack failed"

	mkdir -p ${D}/usr/include/mach
	cp -Rfp ${S}/include/mach-o ${D}/usr/include
	cp -Rfp ${S}/include/mach/* ${D}/usr/include/mach

	cd ${S}/ld/static_kld
	dolib.a *.a

	if ! use build; then
		cd ${S}/man
		doman {check_dylib.1,checksyms.1,indr.1,seg_addr_table.1}
	fi
}