# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jdk/sun-jdk-1.5.0.05.ebuild,v 1.2 2005/10/10 16:23:12 betelgeuse Exp $ inherit pax-utils eutils java-pkg-2 java-vm-2 openjdk="openjdk-7-ea-src-b21-27_sep_2007.zip" DESCRIPTION="Open Source JDK" HOMEPAGE="https://openjdk.dev.java.net/" SRC_URI="http://icedtea.classpath.org/download/source/${P}.tar.gz http://download.java.net/openjdk/jdk7/promoted/b21/${openjdk}" SLOT="1.7" # Needs other for Apache asm etc see THIRD_PARTY_README LICENSE="GPL-2-with-linking-exception sun-prerelease-jdk7" KEYWORDS="~amd64 ~x86" IUSE="nsplugin xulrunner" COMMON_DEP=" media-libs/alsa-lib media-libs/libpng x11-libs/libX11 x11-libs/libXext x11-libs/libXi x11-libs/libXinerama x11-libs/libXtst nsplugin? ( net-libs/xulrunner )" # Found by included libs but not built by default I think: # dev-libs/elfutils # Bundled (should make it to use system copy): # media-libs/jpeg DEPEND=" app-arch/unzip app-arch/zip virtual/motif >=virtual/jdk-1.6 dev-java/ant-core x11-libs/libXmu x11-libs/libXrandr x11-libs/libXt x11-proto/inputproto x11-proto/xextproto x11-proto/xproto x11-proto/xineramaproto net-print/cups >=dev-java/eclipse-ecj-3.3 >sys-devel/gcc-4.2 xulrunner? ( net-libs/xulrunner ) ${COMMON_DEP}" RDEPEND="${COMMON_DEP} doc? ( =dev-java/java-sdk-docs-1.6.0* ) >=dev-libs/nspr-4.7" #S="${WORKDIR}/o" JAVA_PROVIDE="jdbc-stdext jdbc-rowset" pkg_setup() { if ! built_with_use sys-devel/gcc gcj; then eerror "You need to build sys-devel/gcc with USE=gcj enabled." die "gcc w/o gcj-support detected." else einfo "gcc compiled with gcj-support =)" fi java-vm-2_pkg_setup java-pkg-2_pkg_setup } src_unpack() { unpack ${P}.tar.gz cp ${DISTDIR}/${openjdk} ${S} || die "copy of openjdk failed" cd ${S} unpack ${openjdk} rm -v ${S}/patches/icedtea-debuginfo.patch epatch "${FILESDIR}/icedtea-1.4-gentoo.patch" epatch "${FILESDIR}/icedtea-1.4-no-werror.patch" if use xulrunner ; then epatch "${FILESDIR}/icedtea-1.4-xulrunner.patch" fi } src_compile() { local SUNJDK="$(java-config --select-vm=sun-jdk-1.7 -O)" #local GCJJDK="$(java-config --select-vm=gcj-jdk-4.3 -O)" local GCJJDK="/usr/share/$CHOST/$(has_version gcc)java" local ECJJAR=$(grep CLASS /usr/share/eclipse-ecj-3.[3,4]*/package.env | awk -F= '{print $2}') unset CFLAGS CXXFLAGS unset JAVA_HOME CLASSPATH LD_LIBRARY_PATH ./configure --with-ecj-jar=${ECJJAR} \ --with-libgcj-jar=${GCJJDK} \ --with-icedtea-home=${SUNJDK} || die 'configure failed' #--with-gcj-home=/usr/lib/gcj \ emake -j1 \ COMPILER_WARNINGS_FATAL=false \ MILESTONE=experimental \ BUILD_NUMBER=gentoo-${P} || die 'make failed' } src_install() { local dest=/opt/${P} local ddest="${D}/${dest}" dodir ${dest} local arch=i586 [[ ${ARCH} = amd64 ]] && arch=amd64 cd ${S}/openjdk/control/build/linux-${arch}/ if use doc; then dohtml -r docs/* || die fi cd j2sdk-image # For some people the files got 600 so doing it manually # should be investigated why this happened if is-java-strict; then if [[ $(find . -perm 600) ]]; then eerror "OpenJDK built with permission mask 600" eerror "report this on #gentoo-java on freenode" fi fi # doins can't handle symlinks cp -vRP bin include jre lib man "${ddest}" || die "failed to copy" find "${ddest}" -type f -exec chmod 644 {} + find "${ddest}" -type d -exec chmod 755 {} + chmod 755 ${ddest}/bin/* \ ${ddest}/jre/bin/* \ ${ddest}/jre/lib/*/*.{so,cfg} \ ${ddest}/jre/lib/*/*/*.so \ ${ddest}/jre/lib/jexec \ ${ddest}/lib/jexec || die if [[ $(find "${ddest}" -perm 600) ]]; then eerror "Files with permission set to 600 found in the image" eerror "please report this to java@gentoo.org" fi pax-mark m $(list-paxables ${ddest}{,/jre}/bin/*) dodoc LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README || die dohtml README.html || die if use examples; then cp -pPR demo sample "${ddest}/share/" fi cp src.zip "${ddest}" || die if use nsplugin; then local plugin_dir="ns7-gcc29" if has_version '>=sys-devel/gcc-3' ; then plugin_dir="ns7" fi install_mozilla_plugin /opt/${P}/jre/lib/${arch}/gcjwebplugin.so fi # create dir for system preferences dodir /opt/${P}/jre/.systemPrefs # Create files used as storage for system preferences. touch ${D}/opt/${P}/jre/.systemPrefs/.system.lock chmod 644 ${D}/opt/${P}/jre/.systemPrefs/.system.lock touch ${D}/opt/${P}/jre/.systemPrefs/.systemRootModFile chmod 644 ${D}/opt/${P}/jre/.systemPrefs/.systemRootModFile set_java_env } pkg_postinst() { # Set as default VM if none exists java-vm-2_pkg_postinst echo ewarn "!!!!!! THIS IS SOO BETA ITS ALPHA !!!!!!" }