Use https by default
[gentoo.git] / dev-java / gcj-jdk / gcj-jdk-4.8.4-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit java-vm-2 multilib
8
9 DESCRIPTION="Java wrappers around GCJ"
10 HOMEPAGE="https://www.gentoo.org/"
11 SRC_URI=""
12
13 LICENSE="GPL-2"
14 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-linux"
15 SLOT="0"
16 IUSE="awt"
17
18 API_DIFF_PV="4.8.2"
19
20 # perl is needed for javac wrapper
21 RDEPEND="
22         dev-java/ecj-gcj:*
23         dev-lang/perl
24         ~sys-devel/gcc-${PV}[awt?,gcj]"
25 DEPEND="${RDEPEND}"
26
27 S="${WORKDIR}"
28
29 src_install() {
30         # jre lib paths ...
31         local libarch="$(get_system_arch)"
32         local gcc_version=${PV}
33         local gccbin=$(gcc-config -B ${gcc_version})
34         gccbin=${gccbin#"${EPREFIX}"}
35         local gcclib=$(gcc-config -L ${gcc_version} | cut -d':' -f1)
36         gcclib=${gcclib#"${EPREFIX}"}
37         local gcjhome="/usr/$(get_libdir)/${P}"
38         local gcjprefix="${EPREFIX}${gcjhome}"
39         local gccchost="${CHOST}"
40         local gcjlibdir=$(echo "${EPREFIX}"/usr/$(get_libdir)/gcj-${gcc_version}-*)
41         gcjlibdir=${gcjlibdir#"${EPREFIX}"}
42
43         # links
44         dodir ${gcjhome}/bin
45         dodir ${gcjhome}/jre/bin
46         dosym ${gccbin}/gij ${gcjhome}/bin/java
47         dosym ${gccbin}/gij ${gcjhome}/jre/bin/java
48         dosym ${gccbin}/gjar ${gcjhome}/bin/jar
49         dosym ${gccbin}/gjdoc ${gcjhome}/bin/javadoc
50         dosym ${gccbin}/grmic ${gcjhome}/bin/rmic
51         dosym ${gccbin}/gjavah ${gcjhome}/bin/javah
52         dosym ${gccbin}/jcf-dump ${gcjhome}/bin/javap
53         dosym ${gccbin}/gappletviewer ${gcjhome}/bin/appletviewer
54         dosym ${gccbin}/gjarsigner ${gcjhome}/bin/jarsigner
55         dosym ${gccbin}/grmiregistry ${gcjhome}/bin/rmiregistry
56         dosym ${gccbin}/grmiregistry ${gcjhome}/jre/bin/rmiregistry
57         dosym ${gccbin}/gkeytool ${gcjhome}/bin/keytool
58         dosym ${gccbin}/gkeytool ${gcjhome}/jre/bin/keytool
59         dosym ${gccbin}/gnative2ascii ${gcjhome}/bin/native2ascii
60         dosym ${gccbin}/gorbd ${gcjhome}/bin/orbd
61         dosym ${gccbin}/gorbd ${gcjhome}/jre/bin/orbd
62         dosym ${gccbin}/grmid ${gcjhome}/bin/rmid
63         dosym ${gccbin}/grmid ${gcjhome}/jre/bin/rmid
64         dosym ${gccbin}/gserialver ${gcjhome}/bin/serialver
65         dosym ${gccbin}/gtnameserv ${gcjhome}/bin/tnameserv
66         dosym ${gccbin}/gtnameserv ${gcjhome}/jre/bin/tnameserv
67
68         dodir ${gcjhome}/jre/lib/${libarch}/client
69         dodir ${gcjhome}/jre/lib/${libarch}/server
70         dosym ${gcjlibdir}/libjvm.so ${gcjhome}/jre/lib/${libarch}/client/libjvm.so
71         dosym ${gcjlibdir}/libjvm.so ${gcjhome}/jre/lib/${libarch}/server/libjvm.so
72         use awt && dosym ${gcjlibdir}/libjawt.so ${gcjhome}/jre/lib/${libarch}/libjawt.so
73
74         dosym /usr/share/gcc-data/${gccchost}/${gcc_version}/java/libgcj-${gcc_version/_/-}.jar \
75                 ${gcjhome}/jre/lib/rt.jar
76         dodir ${gcjhome}/lib
77         dosym /usr/share/gcc-data/${gccchost}/${gcc_version}/java/libgcj-tools-${gcc_version/_/-}.jar \
78                 ${gcjhome}/lib/tools.jar
79         dosym ${gcclib}/include ${gcjhome}/include
80
81         exeinto ${gcjhome}/bin
82         sed -e "s#@JAVA@#${gcjprefix}/bin/java#" \
83                 -e "s#@ECJ_JAR@#${EPREFIX}/usr/share/eclipse-ecj/ecj.jar#" \
84                 -e "s#@RT_JAR@#${gcjprefix}/jre/lib/rt.jar#" \
85                 -e "s#@TOOLS_JAR@#${gcjprefix}/lib/tools.jar#" \
86                 "${FILESDIR}"/javac.in \
87         | newexe - javac
88         assert
89
90         set_java_env
91 }
92
93 pkg_postinst() {
94         # Do not set as system VM (see below)
95         # java-vm-2_pkg_postinst
96
97         ewarn "gcj does not currently provide all the 1.5 or 1.6 APIs."
98         ewarn "See http://fuseyism.com/japi/ibmjdk15-libgcj-${API_DIFF_PV}.html"
99         ewarn "and http://fuseyism.com/japi/icedtea6-libgcj-${API_DIFF_PV}.html"
100         ewarn "Check for existing bugs relating to missing APIs and file"
101         ewarn "new ones at http://gcc.gnu.org/bugzilla/"
102         ewarn
103         ewarn "Due to this and limited manpower, we currently cannot support"
104         ewarn "using gcj-jdk as a system VM. Its main purpose is to bootstrap"
105         ewarn "IcedTea without prior binary VM installation. To do that, execute:"
106         ewarn
107         ewarn "emerge -o icedtea && emerge icedtea"
108 }