From 29ec84a980947e2afac19bbd3ed490333058dda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Mon, 18 Jun 2018 15:20:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20ebuild=20eclipse-sdk-bin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * https://github.com/gentoo/eclipse-overlay.git/dev-utils/eclipse-sdk-bin --- dev-util/eclipse-sdk-bin/Manifest | 2 + .../eclipse-sdk-bin-4.6.2-r1.ebuild | 112 ++++++++++++++++++ .../files/eclipse-sdk-bin-4.6.2-eclipse-bin | 50 ++++++++ .../files/eclipse-sdk-bin-4.6.2-eclipserc-bin | 29 +++++ dev-util/eclipse-sdk-bin/metadata.xml | 11 ++ 5 files changed, 204 insertions(+) create mode 100644 dev-util/eclipse-sdk-bin/Manifest create mode 100644 dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.6.2-r1.ebuild create mode 100644 dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipse-bin create mode 100644 dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipserc-bin create mode 100644 dev-util/eclipse-sdk-bin/metadata.xml diff --git a/dev-util/eclipse-sdk-bin/Manifest b/dev-util/eclipse-sdk-bin/Manifest new file mode 100644 index 000000000..6e83aa704 --- /dev/null +++ b/dev-util/eclipse-sdk-bin/Manifest @@ -0,0 +1,2 @@ +DIST eclipse-java-neon-2-linux-gtk-4.6.2.tar.gz 167301233 SHA256 44b8c068a9a199817852b58325b90add3905e27ed33f4eb89197f6eb4c7c3be0 SHA512 b9ab913cb697ed3810c53dd9ee87aa831edb043e3e1bd6d5d04007a51ae61a367f6f851e5c436709eb610e0abdce3a155fdfb175e07aafeeab8ef8d7decdd169 WHIRLPOOL b808146bac1cf6b58e0c8549de0c9ce30fcf3b885d4901febd55edb60d3a04c6af650797ed9bb1719e5bc8d1a1708d0e01f722d4e8afba94a21329bb352d1ce5 +DIST eclipse-java-neon-2-linux-gtk-x86_64-4.6.2.tar.gz 167449069 SHA256 b276ee8af940d37b9339ecb639c23953a25584af8564526be06e0cc95f2f6a60 SHA512 7cd7c5a020bb4a8644fdaa1b4e3b1b9daab34edd17677e28b2cdd7934f2a6432320fbba241e4fb91349ae056405721522e4bfe29970a3934d49a3e8385558691 WHIRLPOOL 4d5190375a23f149e1c2b09ffa0c9858b6dc4b70b760dbb549544a179933f3bc037f9779330bb9b5ab6f009a3fe15024728cd8d5f41c7f00d95942ae09786b39 diff --git a/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.6.2-r1.ebuild b/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.6.2-r1.ebuild new file mode 100644 index 000000000..4e8224624 --- /dev/null +++ b/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.6.2-r1.ebuild @@ -0,0 +1,112 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils versionator java-utils-2 + +SR="$(get_version_component_range 3-)" +RNAME="neon" + +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="lombok" + +CDEPEND=" + >=dev-java/commons-httpclient-3.1:3 + >=dev-java/icu4j-56.1:56 + >=dev-java/javax-inject-1:0 + >=dev-java/jsr250-1.2:0 + >=dev-java/xml-commons-resolver-1.2:0 + " +DEPEND="${CDEPEND}" +RDEPEND=">=virtual/jdk-1.8 + x11-libs/gtk+:3 + lombok? ( dev-java/lombok-bin ) + ${CDEPEND}" + +S="${WORKDIR}"/eclipse + +HTML_DOCS="readme/" + +_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_56.1.0.v201601250100.jar icu4j-56 icu4j.jar + _unbundle_single "${mode}" plugins/javax.annotation_1.2.0.v201602091430.jar jsr250 jsr250.jar + _unbundle_single "${mode}" plugins/javax.inject_1.0.0.v20091030.jar javax-inject javax-inject.jar + _unbundle_single "${mode}" plugins/org.apache.commons.httpclient_3.1.0.v201012070820.jar commons-httpclient-3 commons-httpclient.jar + _unbundle_single "${mode}" plugins/org.apache.xml.resolver_1.2.0.v201005080400.jar xml-commons-resolver xml-commons-resolver.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 + + eapply_user +} + +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 + + einstalldocs + + 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" +} diff --git a/dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipse-bin b/dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipse-bin new file mode 100644 index 000000000..d71ee1407 --- /dev/null +++ b/dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipse-bin @@ -0,0 +1,50 @@ +#! /bin/bash +# +# Tiny startup wrapper for Eclipse +# +# Copyright (c) 2004, Karl Trygve Kalleberg +# Copyright (c) 2007-2008, Jean-Noël Rivasseau +# Copyright (c) 2004-2008, Gentoo Foundation +# Copyright (c) 2015, Sebastian Pipping +# Copyright (c) 2016, Stefan Langenmaier +# +# Licensed under the GNU General Public License, version 2 +# + +[[ -f "/etc/eclipserc-bin-%SLOT%" ]] && . "/etc/eclipserc-bin-%SLOT%" +[[ -f "$HOME/gentoo/.eclipserc" ]] && . "$HOME/gentoo/.eclipserc" + +ECLIPSE_HOME=${ECLIPSE_HOME:="/opt/eclipse-sdk-bin-%SLOT%"} +ECLIPSE_BIN="${ECLIPSE_HOME}/eclipse" + +if [[ ! -x "${ECLIPSE_BIN}" ]] ; then + echo "Failed to find executable '${ECLIPSE_BIN}'" > /dev/stderr + exit 1 +fi + +if [[ $(id -u) -eq 0 ]] ; then + echo "Do not run eclipse as root user! Exiting ..." > /dev/stderr + exit 1 +fi + +case "$(java-config -f)" in + *gcj*) + export JAVA_PKG_CLASSMAP="${ECLIPSE_HOME}/eclipse.gcjdb" + ;; +esac + +[ -n "${ECLIPSE_XMS}" ] && VM_ARGS="${VM_ARGS} -Xms${ECLIPSE_XMS}" +[ -n "${ECLIPSE_XMX}" ] && VM_ARGS="${VM_ARGS} -Xmx${ECLIPSE_XMX}" +[ -n "${ECLIPSE_PERMSIZE}" ] && VM_ARGS="${VM_ARGS} -XX:PermSize=${ECLIPSE_PERMSIZE}" +[ -n "${ECLIPSE_MAX_PERMSIZE}" ] && VM_ARGS="${VM_ARGS} -XX:MaxPermSize=${ECLIPSE_MAX_PERMSIZE}" + +# lombok support +[ -n "${LOMBOK_JAR}" ] && [ -f "${LOMBOK_JAR}" ] && VM_ARGS="${VM_ARGS} -javaagent:${LOMBOK_JAR}" + +# Fix for JRE 1.5. +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib + +# option to switch GTK backend +[ -n "${SWT_GTK3}" ] && export SWT_GTK3="${SWT_GTK3}" + +exec "${ECLIPSE_BIN}" -vm $(java-config --java) "$@" "${ECLIPSE_USER_ARGS}" -vmargs ${VM_ARGS} diff --git a/dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipserc-bin b/dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipserc-bin new file mode 100644 index 000000000..2b148245f --- /dev/null +++ b/dev-util/eclipse-sdk-bin/files/eclipse-sdk-bin-4.6.2-eclipserc-bin @@ -0,0 +1,29 @@ +# This file specifies some initial Eclipse settings, like memory allowed +# These settings only affect Eclipse startup and overall configuration +# Main Eclipse configuration should be done within Eclipse (with the GUI) + +# Following variables controls the minimal and maximum amounts of memory +# allocated to Eclipse (respectively). +# Increase those numbers if you get OutOfMemory errors. + +ECLIPSE_XMS=128m +ECLIPSE_XMX=256m + +# Following variables controls the minimal and maximum amounts of memory +# allocated to the permanent generation space. +# This space contains data related to all classes. +# Thus, if you use a lot of Eclipse plugins, it is recommended to uncomment +# these variables and even increase it, if you have enough RAM. +# Else you will get crashes related to OutOfMemory in PermGen exceptions. + +#ECLIPSE_PERMSIZE=64m +#ECLIPSE_MAX_PERMSIZE=128m + +# Eclipse 4.5 Mars has some visual issues with GTK>=3.16 +# SWT_GTK3=1 - to enable GTK3 +# SWT_GTK3=0 - to enable GTK2 +SWT_GTK3=1 + +# Default lombok.jar +# can also be unset/overwritten by the user +LOMBOK_JAR=/usr/share/lombok/lib/lombok.jar diff --git a/dev-util/eclipse-sdk-bin/metadata.xml b/dev-util/eclipse-sdk-bin/metadata.xml new file mode 100644 index 000000000..ac59091a0 --- /dev/null +++ b/dev-util/eclipse-sdk-bin/metadata.xml @@ -0,0 +1,11 @@ + + + + maintainer-wanted + + Use the system-wide dev-java/icu4j + Pull in dev-java/lombok, it can still be overwritten on a per-user basis + + + +