summaryrefslogtreecommitdiff
blob: edfb7984cbf29905f3eb85f0c6e6c1db170a4e0d (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/soylatte-jdk-bin/soylatte-jdk-bin-7.ebuild,v 1.1 2012/10/30 20:23:46 grobian Exp $

EAPI="3"

JAVA_SUPPORTS_GENERATION_1="true"
inherit java-vm-2 multilib

DESCRIPTION="Landon Fuller's OpenJDK 7 for Mac OS X 10.5/PPC"
HOMEPAGE="http://landonf.bikemonkey.org/static/soylatte/"
SRC_URI="http://landonf.bikemonkey.org/static/soylatte/bsd-dist/openjdk7_darwin/openjdk7-macppc-2009-12-16-b4.tar.bz2"
SLOT="1.7"
LICENSE="GPL-2-with-exceptions"
KEYWORDS="~ppc-macos"
IUSE="examples"

RDEPEND="dev-db/unixODBC"

JAVA_PROVIDE="jdbc-stdext"

S=${WORKDIR}/openjdk7-macppc-2009-12-16-b4

src_prepare() {
	# fix install_names
	local original_root=/Users/landonf/Desktop/openjdk-ppc/bsd-port/build/bsd-ppc
	local original_demo=${original_root}/demo
	local original_lib=${original_root}/lib
	for dir in demo jre ; do
		for dynamic_lib in $(find ${dir} -name '*.dylib'); do
			install_name_tool \
				-id "${EPREFIX}"/opt/${P}/${dynamic_lib} \
				${dynamic_lib}
			for linked_against in $(scanmacho -BF'%n#f' ${dynamic_lib} | tr ',' ' '); do
				case ${linked_against} in
					${original_lib}/*)
						install_name_tool -change \
							${linked_against} \
							"${EPREFIX}"/opt/${P}/jre${linked_against#${original_root}} \
							${dynamic_lib}
					;;
					${original_demo}/*)
						install_name_tool -change \
							${linked_against} \
							"${EPREFIX}"/opt/${P}${linked_against#${original_root}} \
							${dynamic_lib}
					;;
					libjvm.dylib)
						install_name_tool -change \
							${linked_against} \
							"${EPREFIX}"/opt/${P}/jre/lib/ppc/server/libjvm.dylib \
							${dynamic_lib}
					;;
					*/libodbc*.dylib)
						install_name_tool -change \
							${linked_against} \
							"${EPREFIX}"/usr/$(get_libdir)/${linked_against##*/} \
							${dynamic_lib}
					;;
				esac
			done
		done
	done
}

src_install() {
	local dirs="bin include jre lib man"
	dodir /opt/${P}

	cp -pPR $dirs "${ED}/opt/${P}/" || die "failed to copy"

	cp -pP src.zip "${ED}/opt/${P}/" || die

	if use examples; then
		cp -pPR demo sample "${ED}/opt/${P}/" || die
	fi

	# create dir for system preferences
	dodir /opt/${P}/jre/.systemPrefs
	# Create files used as storage for system preferences.
	touch "${ED}"/opt/${P}/jre/.systemPrefs/.system.lock
	chmod 644 "${ED}"/opt/${P}/jre/.systemPrefs/.system.lock
	touch "${ED}"/opt/${P}/jre/.systemPrefs/.systemRootModFile
	chmod 644 "${ED}"/opt/${P}/jre/.systemPrefs/.systemRootModFile

	set_java_env
}