Use https by default
[gentoo.git] / dev-java / netbeans-extide / netbeans-extide-8.0.2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6 inherit eutils java-pkg-2 java-ant-2
7
8 DESCRIPTION="Netbeans ExtIDE Cluster"
9 HOMEPAGE="http://netbeans.org/projects/ide"
10 SLOT="8.0"
11 SOURCE_URL="http://download.netbeans.org/netbeans/8.0.2/final/zip/netbeans-8.0.2-201411181905-src.zip"
12 SRC_URI="${SOURCE_URL}
13         https://dev.gentoo.org/~fordfrog/distfiles/netbeans-8.0.2-build.xml.patch.bz2
14         http://hg.netbeans.org/binaries/22CB933E3A1450B092C45785C187837E97523F5C-ant-libs-1.9.4.zip
15         http://hg.netbeans.org/binaries/95CCE237B1E9390FBED0440B601822813DB220E6-ant-misc-1.9.4.zip"
16 LICENSE="|| ( CDDL GPL-2-with-linking-exception )"
17 KEYWORDS="amd64 x86"
18 IUSE=""
19 S="${WORKDIR}"
20
21 CDEPEND="~dev-java/netbeans-ide-${PV}
22         ~dev-java/netbeans-platform-${PV}"
23 DEPEND="virtual/jdk:1.7
24         app-arch/unzip
25         dev-java/javahelp:0
26         ${CDEPEND}"
27 RDEPEND=">=virtual/jdk-1.7
28         ${CDEPEND}"
29
30 INSTALL_DIR="/usr/share/${PN}-${SLOT}"
31
32 EANT_BUILD_XML="nbbuild/build.xml"
33 EANT_BUILD_TARGET="rebuild-cluster"
34 EANT_EXTRA_ARGS="-Drebuild.cluster.name=nb.cluster.extide -Dext.binaries.downloaded=true -Djava.awt.headless=true"
35 EANT_FILTER_COMPILER="ecj-3.3 ecj-3.4 ecj-3.5 ecj-3.6 ecj-3.7"
36 JAVA_PKG_BSFIX="off"
37
38 src_unpack() {
39         unpack $(basename ${SOURCE_URL})
40
41         einfo "Deleting bundled jars..."
42         find -name "*.jar" -type f -delete
43
44         unpack netbeans-8.0.2-build.xml.patch.bz2
45
46         pushd "${S}" >/dev/null || die
47         ln -s "${DISTDIR}"/22CB933E3A1450B092C45785C187837E97523F5C-ant-libs-1.9.4.zip o.apache.tools.ant.module/external/ant-libs-1.9.4.zip || die
48         ln -s "${DISTDIR}"/95CCE237B1E9390FBED0440B601822813DB220E6-ant-misc-1.9.4.zip o.apache.tools.ant.module/external/ant-misc-1.9.4.zip || die
49         popd >/dev/null || die
50 }
51
52 src_prepare() {
53         einfo "Deleting bundled class files..."
54         find -name "*.class" -type f | xargs rm -vf
55
56         epatch netbeans-8.0.2-build.xml.patch
57
58         # Support for custom patches
59         if [ -n "${NETBEANS80_PATCHES_DIR}" -a -d "${NETBEANS80_PATCHES_DIR}" ] ; then
60                 local files=`find "${NETBEANS80_PATCHES_DIR}" -type f`
61
62                 if [ -n "${files}" ] ; then
63                         einfo "Applying custom patches:"
64
65                         for file in ${files} ; do
66                                 epatch "${file}"
67                         done
68                 fi
69         fi
70
71         einfo "Symlinking external libraries..."
72         java-pkg_jar-from --build-only --into javahelp/external javahelp jhall.jar jhall-2.0_05.jar
73
74         einfo "Linking in other clusters..."
75         mkdir "${S}"/nbbuild/netbeans || die
76         pushd "${S}"/nbbuild/netbeans >/dev/null || die
77
78         ln -s /usr/share/netbeans-ide-${SLOT} ide || die
79         cat /usr/share/netbeans-ide-${SLOT}/moduleCluster.properties >> moduleCluster.properties || die
80         touch nb.cluster.ide.built
81
82         ln -s /usr/share/netbeans-platform-${SLOT} platform || die
83         cat /usr/share/netbeans-platform-${SLOT}/moduleCluster.properties >> moduleCluster.properties || die
84         touch nb.cluster.platform.built
85
86         popd >/dev/null || die
87
88         java-pkg-2_src_prepare
89 }
90
91 src_compile() {
92         unset DISPLAY
93         eant -f ${EANT_BUILD_XML} ${EANT_EXTRA_ARGS} ${EANT_BUILD_TARGET} || die "Compilation failed"
94 }
95
96 src_install() {
97         pushd nbbuild/netbeans/extide >/dev/null || die
98
99         insinto ${INSTALL_DIR}
100
101         grep -E "/extide$" ../moduleCluster.properties > "${D}"/${INSTALL_DIR}/moduleCluster.properties || die
102
103         doins -r *
104
105         popd >/dev/null || die
106
107         dosym ${INSTALL_DIR} /usr/share/netbeans-nb-${SLOT}/extide
108 }