blob: e4348b006abe9a43ad0d01c912633efcd64bc1e2 (
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
inherit eutils versionator java-utils-2
SR="R"
RNAME="mars"
SRC_BASE="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/${RNAME}/${SR}/eclipse-java-${RNAME}-${SR}-linux-gtk"
DESCRIPTION="Eclipse SDK"
HOMEPAGE="http://www.eclipse.org"
SRC_URI="
amd64? ( ${SRC_BASE}-x86_64.tar.gz&r=1 -> eclipse-java-${RNAME}-${SR}-linux-gtk-x86_64-${PV}.tar.gz )
x86? ( ${SRC_BASE}.tar.gz&r=1 -> eclipse-java-${RNAME}-${SR}-linux-gtk-${PV}.tar.gz )
"
LICENSE="EPL-1.0"
SLOT="$(get_version_component_range 1-2)"
KEYWORDS="~amd64 ~x86"
IUSE=""
CDEPEND="
>=dev-java/icu4j-54.1.1:52
>=dev-java/jsr250-1.2:0
"
DEPEND="${CDEPEND}"
RDEPEND=">=virtual/jdk-1.6
x11-libs/gtk+:2
${CDEPEND}"
S="${WORKDIR}"/eclipse
_unbundle_single() {
local mode="${1}" destination_jar="${2}" package="${3}" package_jar="${4}"
local abs_destination_jar="${PWD}/${destination_jar}"
local backup_dir="${T}"/${destination_jar##*/}.dir
if [[ "${mode}" = delete ]]; then
# Backup META-INF/MANIFEST.MF with checksums
# Then delete .jar file
mkdir -p "${backup_dir}"/META-INF
unzip -p "${destination_jar}" META-INF/MANIFEST.MF \
| sed -e '/^Name:/d' -e '/^SHA1-Digest:/d' -e '/^\s*$/d' \
> "${backup_dir}"/META-INF/MANIFEST.MF || die
rm "${destination_jar}" || die
elif [[ "${mode}" = wire ]]; then
einfo "Replacing bundled ${destination_jar}..."
# Create new .jar based on system-wide build
# In the process, apply META-INF/MANIFEST.MF backup
java-pkg_jar-from "${package}" "${package_jar}" "${destination_jar}"
local source_jar="$(readlink -f "${destination_jar}")"
rm "${destination_jar}" || die
cp "${source_jar}" "${destination_jar}" || die
( cd "${backup_dir}" \
&& [[ -f "${abs_destination_jar}" ]] \
&& zip "${abs_destination_jar}" META-INF/MANIFEST.MF >/dev/null
) || die
fi
}
_unbundle_known() {
local mode="${1}"
# https://wiki.gentoo.org/wiki/Eclipse/Building_From_Source
_unbundle_single "${mode}" plugins/com.ibm.icu_54.1.1.v201501272100.jar icu4j-52 icu4j.jar log4j-1.2.8.jar
_unbundle_single "${mode}" plugins/javax.annotation_1.2.0.v201401042248.jar jsr250 jsr250.jar
}
src_prepare() {
_unbundle_known delete
ewarn 'Binary dependencies left to unbundle:'
ewarn "$(find -type f -name '*.jar' -not -wholename '*/org.eclipse*' | sort | sed 's,^\./,,')"
_unbundle_known wire
cp "${FILESDIR}"/${P}-eclipse-bin "${T}/eclipse-bin-${SLOT}" || die
cp "${FILESDIR}"/${P}-eclipserc-bin "${T}/eclipserc-bin-${SLOT}" || die
sed "s,%SLOT%,${SLOT},g" -i "${T}"/eclipse{,rc}-bin-${SLOT} || die
}
src_install() {
local dest=/opt/${PN}-${SLOT}
insinto ${dest}
doins -r features icon.xpm plugins artifacts.xml p2 eclipse.ini configuration dropins
exeinto ${dest}
doexe eclipse
dohtml -r readme/*
dobin "${T}"/eclipse-bin-${SLOT}
insinto /etc
doins "${T}"/eclipserc-bin-${SLOT}
make_desktop_entry "eclipse-bin-${SLOT}" "Eclipse ${RNAME^}/${PV} (bin)" "${dest}/icon.xpm"
}
|