logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

icedtea-7.2.6.28.ebuild (13459B)


  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. # Build written by Andrew John Hughes (gnu_andrew@member.fsf.org)
  4. EAPI="6"
  5. SLOT="7"
  6. inherit autotools check-reqs eutils gnome2-utils java-pkg-2 java-vm-2 multiprocessing pax-utils prefix versionator virtualx
  7. ICEDTEA_VER=$(get_version_component_range 2-4)
  8. ICEDTEA_BRANCH=$(get_version_component_range 2-3)
  9. ICEDTEA_PKG=icedtea-${ICEDTEA_VER}
  10. ICEDTEA_PRE=$(get_version_component_range _)
  11. CORBA_TARBALL="60fb55621427.tar.bz2"
  12. HOTSPOT_TARBALL="d7f4f4901aa1.tar.bz2"
  13. JAXP_TARBALL="2eedd3512498.tar.bz2"
  14. JAXWS_TARBALL="dc69e332d99f.tar.bz2"
  15. JDK_TARBALL="f42b7efa98fe.tar.bz2"
  16. LANGTOOLS_TARBALL="9cf0f33fe118.tar.bz2"
  17. OPENJDK_TARBALL="b7da16493c1b.tar.bz2"
  18. CACAO_TARBALL="cacao-c182f119eaad.tar.gz"
  19. JAMVM_TARBALL="jamvm-ec18fb9e49e62dce16c5094ef1527eed619463aa.tar.gz"
  20. CORBA_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-corba-${CORBA_TARBALL}"
  21. JAXP_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxp-${JAXP_TARBALL}"
  22. JAXWS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxws-${JAXWS_TARBALL}"
  23. JDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jdk-${JDK_TARBALL}"
  24. LANGTOOLS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-langtools-${LANGTOOLS_TARBALL}"
  25. OPENJDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-openjdk-${OPENJDK_TARBALL}"
  26. HOTSPOT_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-hotspot-${HOTSPOT_TARBALL}"
  27. CACAO_GENTOO_TARBALL="icedtea-${CACAO_TARBALL}"
  28. JAMVM_GENTOO_TARBALL="icedtea-${JAMVM_TARBALL}"
  29. DROP_URL="https://icedtea.classpath.org/download/drops"
  30. ICEDTEA_URL="${DROP_URL}/icedtea${SLOT}/${ICEDTEA_VER}"
  31. DESCRIPTION="A harness to build OpenJDK using Free Software build tools and dependencies"
  32. HOMEPAGE="https://icedtea.classpath.org"
  33. SRC_PKG="${ICEDTEA_PKG}.tar.xz"
  34. SRC_URI="
  35. https://icedtea.classpath.org/download/source/${SRC_PKG}
  36. ${ICEDTEA_URL}/openjdk.tar.bz2 -> ${OPENJDK_GENTOO_TARBALL}
  37. ${ICEDTEA_URL}/corba.tar.bz2 -> ${CORBA_GENTOO_TARBALL}
  38. ${ICEDTEA_URL}/jaxp.tar.bz2 -> ${JAXP_GENTOO_TARBALL}
  39. ${ICEDTEA_URL}/jaxws.tar.bz2 -> ${JAXWS_GENTOO_TARBALL}
  40. ${ICEDTEA_URL}/jdk.tar.bz2 -> ${JDK_GENTOO_TARBALL}
  41. ${ICEDTEA_URL}/hotspot.tar.bz2 -> ${HOTSPOT_GENTOO_TARBALL}
  42. ${ICEDTEA_URL}/langtools.tar.bz2 -> ${LANGTOOLS_GENTOO_TARBALL}
  43. ${DROP_URL}/cacao/${CACAO_TARBALL} -> ${CACAO_GENTOO_TARBALL}
  44. ${DROP_URL}/jamvm/${JAMVM_TARBALL} -> ${JAMVM_GENTOO_TARBALL}"
  45. LICENSE="Apache-1.1 Apache-2.0 GPL-1 GPL-2 GPL-2-with-linking-exception LGPL-2 MPL-1.0 MPL-1.1 public-domain W3C"
  46. KEYWORDS="amd64 arm64"
  47. IUSE="+alsa cacao +cups debug doc examples +gtk headless-awt
  48. jamvm +jbootstrap kerberos nss pax_kernel
  49. sctp selinux smartcard source test zero"
  50. REQUIRED_USE="gtk? ( !headless-awt )"
  51. # Ideally the following were optional at build time.
  52. ALSA_COMMON_DEP="
  53. >=media-libs/alsa-lib-1.0"
  54. CUPS_COMMON_DEP="
  55. >=net-print/cups-1.2.12"
  56. X_COMMON_DEP="
  57. >=media-libs/giflib-4.1.6:=
  58. >=media-libs/libpng-1.2:0=
  59. >=x11-libs/libX11-1.1.3
  60. >=x11-libs/libXext-1.1.1
  61. >=x11-libs/libXi-1.1.3
  62. >=x11-libs/libXrender-0.9.4
  63. >=x11-libs/libXtst-1.0.3
  64. x11-libs/libXt
  65. x11-libs/libXcomposite"
  66. X_DEPEND="
  67. >=x11-libs/libXau-1.0.3
  68. >=x11-libs/libXdmcp-1.0.2
  69. >=x11-libs/libXinerama-1.0.2
  70. x11-base/xorg-proto"
  71. COMMON_DEP="
  72. app-misc/mime-types
  73. >=dev-libs/glib-2.26:2
  74. media-libs/fontconfig
  75. >=media-libs/freetype-2.10.1:2=
  76. >=media-libs/lcms-2.5
  77. >=sys-libs/zlib-1.2.3:=
  78. virtual/jpeg:0=
  79. gtk? (
  80. >=dev-libs/atk-1.30.0
  81. >=x11-libs/cairo-1.8.8:=
  82. x11-libs/gdk-pixbuf:2
  83. >=x11-libs/gtk+-2.8:2=
  84. >=x11-libs/pango-1.24.5
  85. )
  86. kerberos? ( virtual/krb5 )
  87. nss? ( >=dev-libs/nss-3.12.5-r1 )
  88. sctp? ( net-misc/lksctp-tools )
  89. smartcard? ( sys-apps/pcsc-lite )"
  90. # gsettings-desktop-schemas is needed for native proxy support. #431972
  91. RDEPEND="${COMMON_DEP}
  92. !dev-java/icedtea:0
  93. !dev-java/icedtea-web:7
  94. >=gnome-base/gsettings-desktop-schemas-3.12.2
  95. media-fonts/dejavu
  96. alsa? ( ${ALSA_COMMON_DEP} )
  97. cups? ( ${CUPS_COMMON_DEP} )
  98. !headless-awt? ( ${X_COMMON_DEP} )
  99. selinux? ( sec-policy/selinux-java )"
  100. # Only ant-core-1.8.1 has fixed ant -diagnostics when xerces+xalan are not present.
  101. # ca-certificates, perl and openssl are used for the cacerts keystore generation
  102. DEPEND="${COMMON_DEP} ${ALSA_COMMON_DEP} ${CUPS_COMMON_DEP} ${X_COMMON_DEP} ${X_DEPEND}
  103. || (
  104. dev-java/jamvm:2.0-3
  105. dev-java/icedtea:7
  106. )
  107. sys-devel/automake:1.16
  108. app-arch/cpio
  109. app-arch/unzip
  110. app-arch/zip
  111. app-misc/ca-certificates
  112. dev-java/ant-core:bootstrap
  113. dev-lang/perl
  114. >=dev-libs/libxslt-1.1.26
  115. dev-libs/openssl
  116. sys-apps/attr
  117. sys-apps/lsb-release
  118. virtual/pkgconfig
  119. pax_kernel? ( sys-apps/elfix )"
  120. S="${WORKDIR}"/${ICEDTEA_PKG}
  121. icedtea_check_requirements() {
  122. local CHECKREQS_DISK_BUILD
  123. if use doc; then
  124. CHECKREQS_DISK_BUILD="9000M"
  125. else
  126. CHECKREQS_DISK_BUILD="8500M"
  127. fi
  128. check-reqs_pkg_${EBUILD_PHASE}
  129. }
  130. pkg_pretend() {
  131. icedtea_check_requirements
  132. }
  133. pkg_setup() {
  134. icedtea_check_requirements
  135. JAVA_PKG_WANT_BUILD_VM="jamvm-2.0-3 icedtea-7"
  136. JAVA_PKG_WANT_SOURCE="1.5"
  137. JAVA_PKG_WANT_TARGET="1.5"
  138. java-vm-2_pkg_setup
  139. java-pkg-2_pkg_setup
  140. }
  141. src_unpack() {
  142. unpack ${SRC_PKG}
  143. ln -s "${FILESDIR}/jamvm-1.6.0-aarch64-support.patch" "${S}/patches/jamvm" || die
  144. ln -s "${FILESDIR}/jamvm-1.6.0-opcode-guard.patch" "${S}/patches/jamvm" || die
  145. ln -s "${FILESDIR}/${PN}-jdk-musl.patch" "${S}/patches" || die
  146. ln -s "${FILESDIR}/${PN}-jdk-no-soname.patch" "${S}/patches" || die
  147. ln -s "${FILESDIR}/${PN}-jdk-fix-build.patch" "${S}/patches" || die
  148. ln -s "${FILESDIR}/${PN}-jdk-execinfo.patch" "${S}/patches" || die
  149. ln -s "${FILESDIR}/${PN}-hotspot-stop-using-obsolete-isnanf.patch" "${S}/patches" || die
  150. ln -s "${FILESDIR}/${PN}${SLOT}-jdk-freetype.patch" "${S}/patches" || die
  151. ln -s "${FILESDIR}/${PN}${SLOT}-hotspot-pointer-comparison.patch" "${S}/patches" || die
  152. ln -s "${FILESDIR}/${PN}${SLOT}-jdk-fcommon.patch" "${S}/patches" || die
  153. ln -s "${FILESDIR}/${PN}${SLOT}-hotspot-miscompile.patch" "${S}/patches" || die
  154. ln -s "${FILESDIR}/${PN}-hotspot-musl.patch" "${S}/patches" || die
  155. ln -s "${FILESDIR}/${PN}-os_linux-remove-glibc-dependencies.patch" "${S}/patches" || die
  156. }
  157. src_prepare() {
  158. default
  159. sed -i 's/REQUIRED_FREETYPE_VERSION = 2.2.1/REQUIRED_FREETYPE_VERSION = 2.10.1/' patches/boot/revert-6973616.patch
  160. #eapply "${FILESDIR}/${PN}${SLOT}-disable-systemtap.patch"
  161. eapply "${FILESDIR}/icedtea-2.6.28_remove_brace_expansion.diff"
  162. eautoreconf
  163. }
  164. src_configure() {
  165. export ANT_HOME="${EPREFIX}/usr/share/ant"
  166. # For bootstrap builds as the sandbox control file might not yet exist.
  167. addpredict /proc/self/coredump_filter
  168. # icedtea doesn't like some locales. #330433 #389717
  169. export LANG="C" LC_ALL="C"
  170. local cacao_config config hotspot_port jamvm_config use_cacao use_jamvm use_zero zero_config
  171. local vm=$(java-pkg_get-current-vm)
  172. # Export patches for configure
  173. DISTRIBUTION_PATCHES=""
  174. if use jamvm; then
  175. DISTRIBUTION_PATCHES+="patches/jamvm/jamvm-1.6.0-aarch64-support.patch "
  176. DISTRIBUTION_PATCHES+="patches/jamvm/jamvm-1.6.0-opcode-guard.patch "
  177. fi
  178. DISTRIBUTION_PATCHES+="patches/${PN}-jdk-musl.patch "
  179. DISTRIBUTION_PATCHES+="patches/${PN}-jdk-no-soname.patch "
  180. DISTRIBUTION_PATCHES+="patches/${PN}-jdk-fix-build.patch "
  181. DISTRIBUTION_PATCHES+="patches/${PN}-jdk-execinfo.patch "
  182. DISTRIBUTION_PATCHES+="patches/${PN}-hotspot-stop-using-obsolete-isnanf.patch "
  183. DISTRIBUTION_PATCHES+="patches/${PN}${SLOT}-jdk-freetype.patch "
  184. DISTRIBUTION_PATCHES+="patches/${PN}${SLOT}-jdk-fcommon.patch "
  185. DISTRIBUTION_PATCHES+="patches/${PN}${SLOT}-hotspot-pointer-comparison.patch "
  186. DISTRIBUTION_PATCHES+="patches/${PN}${SLOT}-hotspot-miscompile.patch "
  187. DISTRIBUTION_PATCHES+="patches/${PN}-hotspot-musl.patch "
  188. DISTRIBUTION_PATCHES+="patches/${PN}-os_linux-remove-glibc-dependencies.patch "
  189. export DISTRIBUTION_PATCHES
  190. # gcj-jdk ensures ecj is present.
  191. if use jbootstrap || has "${vm}" jamvm-2.0-3; then
  192. use jbootstrap || einfo "bootstrap is necessary when building with ${vm}, ignoring USE=\"-jbootstrap\""
  193. config+=" --enable-bootstrap"
  194. else
  195. config+=" --disable-bootstrap"
  196. fi
  197. # Use Zero if requested
  198. if use zero; then
  199. use_zero="yes"
  200. fi
  201. # Use JamVM if requested
  202. if use jamvm; then
  203. use_jamvm="yes"
  204. fi
  205. # Use CACAO if requested
  206. if use cacao; then
  207. use_cacao="yes"
  208. fi
  209. # Are we on a architecture with a HotSpot port?
  210. # In-tree JIT ports are available for amd64, arm, arm64, ppc64 (be&le), SPARC and x86.
  211. if { use amd64 || use arm || use ppc64 || use sparc || use x86; }; then
  212. hotspot_port="yes"
  213. fi
  214. # Always use HotSpot as the primary VM if available. #389521 #368669 #357633 ...
  215. # Otherwise use CACAO on ppc and Zero on anything else
  216. if test "x${hotspot_port}" != "xyes"; then
  217. if use ppc; then
  218. use_cacao="yes"
  219. else
  220. use_zero="yes"
  221. fi
  222. fi
  223. if test "x${use_jamvm}" = "xyes"; then
  224. jamvm_config="--enable-jamvm"
  225. fi
  226. # Turn on CACAO if needed (non-HS archs) or requested
  227. if test "x${use_cacao}" = "xyes"; then
  228. if test "x${hotspot_port}" = "xyes"; then
  229. ewarn 'Enabling CACAO on an architecture with HotSpot support; issues may result.'
  230. ewarn 'If so, please rebuild with USE="-cacao"'
  231. fi
  232. cacao_config="--enable-cacao"
  233. fi
  234. # Turn on Zero if needed (non-HS/CACAO archs) or requested
  235. if test "x${use_zero}" = "xyes"; then
  236. if test "x${hotspot_port}" = "xyes"; then
  237. ewarn 'Enabling Zero on an architecture with HotSpot support; performance will be significantly reduced.'
  238. fi
  239. zero_config="--enable-zero"
  240. fi
  241. config+=" --with-parallel-jobs=$(makeopts_jobs)"
  242. config+=" --without-rhino"
  243. unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS
  244. econf ${config} \
  245. --with-openjdk-src-zip="${DISTDIR}/${OPENJDK_GENTOO_TARBALL}" \
  246. --with-corba-src-zip="${DISTDIR}/${CORBA_GENTOO_TARBALL}" \
  247. --with-jaxp-src-zip="${DISTDIR}/${JAXP_GENTOO_TARBALL}" \
  248. --with-jaxws-src-zip="${DISTDIR}/${JAXWS_GENTOO_TARBALL}" \
  249. --with-jdk-src-zip="${DISTDIR}/${JDK_GENTOO_TARBALL}" \
  250. --with-hotspot-src-zip="${DISTDIR}/${HOTSPOT_GENTOO_TARBALL}" \
  251. --with-langtools-src-zip="${DISTDIR}/${LANGTOOLS_GENTOO_TARBALL}" \
  252. --with-cacao-src-zip="${DISTDIR}/${CACAO_GENTOO_TARBALL}" \
  253. --with-jamvm-src-zip="${DISTDIR}/${JAMVM_GENTOO_TARBALL}" \
  254. --with-jdk-home="$(java-config -O)" \
  255. --prefix="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}" \
  256. --mandir="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}/man" \
  257. --docdir="${EPREFIX}/usr/share/doc/${PF}" \
  258. --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
  259. --with-pkgversion="Gentoo ${PF}" \
  260. --disable-downloading --disable-Werror --disable-tests \
  261. --enable-system-lcms --enable-system-jpeg \
  262. --enable-system-zlib --disable-systemtap-tests \
  263. --enable-improved-font-rendering \
  264. $(use_enable !headless-awt system-gif) \
  265. $(use_enable !headless-awt system-png) \
  266. $(use_enable !debug optimizations) \
  267. $(use_enable cups system-cups) \
  268. $(use_enable doc docs) \
  269. $(use_enable gtk system-gtk) \
  270. $(use_enable kerberos system-kerberos) \
  271. $(use_enable nss) \
  272. $(use_with pax_kernel pax "${EPREFIX}/usr/sbin/paxmark.sh") \
  273. $(use_enable sctp system-sctp) \
  274. $(use_enable smartcard system-pcsc) \
  275. ${zero_config} ${cacao_config} ${jamvm_config}
  276. }
  277. src_compile() {
  278. # Would use GENTOO_VM otherwise.
  279. export ANT_RESPECT_JAVA_HOME=TRUE
  280. # With ant >=1.8.2 all required tasks are part of ant-core
  281. export ANT_TASKS="none"
  282. export DISABLE_HOTSPOT_OS_VERSION_CHECK=ok
  283. emake
  284. }
  285. src_test() {
  286. # Use Xvfb for tests
  287. unset DISPLAY
  288. Xemake check
  289. }
  290. src_install() {
  291. default
  292. local dest="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}"
  293. local ddest="${ED}${dest#/}"
  294. if ! use alsa; then
  295. rm -v "${ddest}"/jre/lib/$(get_system_arch)/libjsoundalsa.* || die
  296. fi
  297. if use headless-awt; then
  298. rm -vr "${ddest}"/jre/lib/$(get_system_arch)/{xawt,libsplashscreen.*,libjavagtk.*} \
  299. "${ddest}"/{,jre/}bin/policytool "${ddest}"/bin/appletviewer || die
  300. fi
  301. if ! use examples; then
  302. rm -r "${ddest}"/demo "${ddest}"/sample || die
  303. fi
  304. if ! use source; then
  305. rm -v "${ddest}"/src.zip || die
  306. fi
  307. dosym /usr/share/doc/${PF} /usr/share/doc/${PN}${SLOT}
  308. # Fix the permissions.
  309. find "${ddest}" \! -type l \( -perm /111 -exec chmod 755 {} \; -o -exec chmod 644 {} \; \) || die
  310. # We need to generate keystore - bug #273306
  311. einfo "Generating cacerts file from certificates in ${EPREFIX}/usr/share/ca-certificates/"
  312. mkdir "${T}/certgen" && cd "${T}/certgen" || die
  313. cp "${FILESDIR}/generate-cacerts.pl" . && chmod +x generate-cacerts.pl || die
  314. for c in "${EPREFIX}"/usr/share/ca-certificates/*/*.crt; do
  315. openssl x509 -text -in "${c}" >> all.crt || die
  316. done
  317. ./generate-cacerts.pl "${ddest}/bin/keytool" all.crt || die
  318. cp -vRP cacerts "${ddest}/jre/lib/security/" || die
  319. chmod 644 "${ddest}/jre/lib/security/cacerts" || die
  320. java-vm_install-env "${FILESDIR}/icedtea.env.sh"
  321. java-vm_sandbox-predict /proc/self/coredump_filter
  322. }
  323. pkg_preinst() {
  324. if has_version "<=dev-java/icedtea-7.2.0:7"; then
  325. # portage would preserve the symlink otherwise, related to bug #384397
  326. rm -f "${EROOT}/usr/lib/jvm/icedtea7"
  327. elog "To unify the layout and simplify scripts, the identifier of Icedtea-7*"
  328. elog "has changed from 'icedtea7' to 'icedtea-7' starting from version 7.2.0-r1"
  329. elog "If you had icedtea7 as system VM, the change should be automatic, however"
  330. elog "build VM settings in /etc/java-config-2/build/jdk.conf are not changed"
  331. elog "and the same holds for any user VM settings. Sorry for the inconvenience."
  332. fi
  333. gnome2_icon_savelist;
  334. }
  335. pkg_postinst() { gnome2_icon_cache_update; }
  336. pkg_postrm() { gnome2_icon_cache_update; }