core/openjdk/PKGBUILD

198 lines
8.1 KiB
Bash
Raw Normal View History

# Maintainer: AlmAck <almack[at]chakra-project[dot]org>
# Contributor: Daniele Cocca <jmc@chakra-project.org>
pkgname=('openjdk' 'openjdk-src')
pkgbase='openjdk'
_icedtea_release="2.4.5"
_icedtea_jdkver="7"
2013-11-24 08:20:25 +08:00
_openjdk_build="b31"
_pkgver="7u51"
pkgver="${_pkgver}_${_openjdk_build}_${_icedtea_release}"
2014-06-15 07:10:23 +08:00
pkgrel=2
pkgdesc="An open-source implementation of the seventh edition of the Java SE Platform."
2012-11-03 12:27:44 +08:00
arch=('x86_64')
url="http://icedtea.classpath.org/"
license=('GPL2 with Classpath exception')
2013-11-24 08:20:25 +08:00
makedepends=('java-environment=7' 'apache-ant>=1.8.1' 'zip' 'unzip'
'fastjar' 'cpio' 'cups' 'orbit2' 'gtk2' 'coreutils'
'wget' 'gzip' 'alsa-lib' 'libpulse' 'zlib' 'libjpeg-turbo'
'libpng' 'giflib' 'lcms2' 'freetype2' 'rhino' 'nss' 'libxt'
'libxtst' 'libxp' 'libxrender' 'ca-certificates-java' 'automake>=1.13')
_hg_url="http://icedtea.classpath.org/hg/release/icedtea7-forest-${_icedtea_release:0:3}"
_corba_changeset=3594dbde270d
_jaxp_changeset=8fe156ad49e2
_jaxws_changeset=32ea8b1ed91a
_jdk_changeset=9db88c18e114
_langtools_changeset=dabd37b7e295
_openjdk_changeset=410eb7fef869
_hotspot_changeset=2cb58882dac3
_jvmdir="/usr/lib/jvm/java-${_icedtea_jdkver}-openjdk"
source=("http://icedtea.classpath.org/download/source/icedtea-${_icedtea_release}.tar.gz"
"${_hg_url}/corba/archive/${_corba_changeset}.tar.gz"
"${_hg_url}/jaxp/archive/${_jaxp_changeset}.tar.gz"
"${_hg_url}/jaxws/archive/${_jaxws_changeset}.tar.gz"
"${_hg_url}/jdk/archive/${_jdk_changeset}.tar.gz"
"${_hg_url}/langtools/archive/${_langtools_changeset}.tar.gz"
"${_hg_url}/archive/${_openjdk_changeset}.tar.gz"
"${_hg_url}/hotspot/archive/${_hotspot_changeset}.tar.gz"
'archlinux-fontconfig-paths.diff'
'archlinux-fix_corba_cmds_path.diff'
'archlinux-openjdk7_fix_jdk_cmds_path.diff'
'archlinux-openjdk7_nonreparenting-wm.diff'
'openjdk.profile.sh'
'openjdk.profile.csh')
sha256sums=('10c08eeffaa0602b23cb957a2595a2ad3ab474cbe47b12743bbdd79037d5883d'
'd1f97e143fe94ae3a56b45bb5a90f8ab10ec2be4ff770a788f0a1ac677e27a7d'
'0a2a40186cedfbeb8f87b0bc86bea2830943943081d4289fc74f7a783b2e1af3'
'08a169b6b02883759ec7a412aa91aa3e37480761cb50b95d092dbcdb2fc9a3d0'
'285e5b8ccbb29f3f9f9ea9ea7856d1ed97465c57d091fbcd9b2e55a1ffbb543e'
'86cb370ce2084c4b699d8c002ebe6c026e86206ffa82a2f3d7906aadb94ed79f'
'2de151c7275d91ef082e63fcc0957c5f9290404ec6e20ecfa1e752e16bfab707'
'd8c1681ae76e660c1888065933cedbbc1309869c7a2fb98f07c424716d5ebaf9'
'9ad943ceb3dbcdf45d72974fc3667886a7ed65c69ab9abc17be5412827551a7f'
'd57754ff320475023688bd7c7af38a9ea37e27ed8c1edd3b1572e4d8b41b78d3'
2013-11-24 08:20:25 +08:00
'10465784f111b62c9543421fe0644f98f5eff16b00dcc78ed914ad68cdb7a13d'
'56b919ababb13bd6afdcdaceb112b529b6e82539255f2dae9a7e5eb91645164b'
'a6a083d4f3247a922c9d482f43341fa048ee4353d1cc42b54d1d0b5a6255bdd0'
'2120d72b19df6c46e35b87e0388afdfcb694843b55ef81ecaf104d78236e8c17')
noextract=("${_openjdk_changeset}.tar.gz"
"${_corba_changeset}.tar.gz"
"${_jaxp_changeset}.tar.gz"
"${_jaxws_changeset}.tar.gz"
"${_jdk_changeset}.tar.gz"
"${_langtools_changeset}.tar.gz"
"${_hotspot_changeset}.tar.gz")
build() {
cd "${srcdir}"
# Prepare the patches
2013-11-24 08:20:25 +08:00
cp ${srcdir}/*.diff ${srcdir}/icedtea-${_icedtea_release}/patches
export DISTRIBUTION_PATCHES="patches/archlinux-fontconfig-paths.diff \
patches/archlinux-fix_corba_cmds_path.diff \
patches/archlinux-openjdk7_fix_jdk_cmds_path.diff \
patches/archlinux-openjdk7_nonreparenting-wm.diff"
rm -rf build
cp -r "icedtea-${_icedtea_release}" \
"${srcdir}/build"
cd "${srcdir}/build"
[ -f /etc/profile.d/openjdk.sh ] && source /etc/profile.d/openjdk.sh
[ -f /etc/profile.d/apache-ant.sh ] && source /etc/profile.d/apache-ant.sh
# Preserve the value of JAVA_HOME before unsetting it from the environment
local _java_home="${JAVA_HOME}"
# Setup the needed environmental variables
export USER="chakra-buildbot"
export ALT_BOOTDIR="${_java_home}"
export ALT_PARALLEL_COMPILE_JOBS="${MAKEFLAGS/-j}"
export HOTSPOT_BUILD_JOBS="${ALT_PARALLEL_COMPILE_JOBS}"
export COMPILER_WARNINGS_FATAL="false"
# Unset harmful variables
#unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS
# Start the configuration and build step
./configure --prefix=/usr \
--with-parallel-jobs="${MAKEFLAGS/-j}" \
--host="${CARCH}-unknown-linux-gnu" \
--with-rhino \
--with-jdk-home="${_java_home}" \
--with-abs-install-dir="${_jvmdir}" \
--with-openjdk-src-zip="${srcdir}/${_openjdk_changeset}.tar.gz" \
--with-hotspot-src-zip="${srcdir}/${_hotspot_changeset}.tar.gz" \
--with-corba-src-zip="${srcdir}/${_corba_changeset}.tar.gz" \
--with-jaxp-src-zip="${srcdir}/${_jaxp_changeset}.tar.gz" \
--with-jaxws-src-zip="${srcdir}/${_jaxws_changeset}.tar.gz" \
--with-jdk-src-zip="${srcdir}/${_jdk_changeset}.tar.gz" \
--with-langtools-src-zip="${srcdir}/${_langtools_changeset}.tar.gz" \
--with-pkgversion="Chakra Linux build ${pkgver}-${pkgrel}-${CARCH}" \
--disable-tests \
--disable-bootstrap \
--disable-system-gtk \
2013-11-24 08:20:25 +08:00
--disable-downloading \
--disable-Werror \
--enable-nss \
2013-11-24 08:20:25 +08:00
--enable-pulse-java
make
}
package_openjdk() {
pkgdesc="An open-source implementation of the seventh edition of the Java SE Platform."
install="openjdk.install"
conflicts=('java-environment' 'java-runtime' 'openjdk6' 'openjdk7')
provides=("java-environment=${_icedtea_jdkver}" "java-runtime=${_icedtea_jdkver}")
replaces=('openjdk6' 'openjdk7')
depends=('alsa-lib' 'libpulse' 'giflib' 'libjpeg-turbo' 'libpng' 'freetype2'
2012-11-03 12:27:44 +08:00
'ca-certificates-java')
optdepends=('icedtea-web: web browser plugin and Java Web Start support'
'gtk2: for the GTK+ Look And Feel')
2013-11-24 08:20:25 +08:00
backup=(etc/profile.d/openjdk.sh
etc/profile.d/openjdk.csh)
cd "${srcdir}/build"
# Copy the built OpenJDK image to the target directory
install -d -m755 "${pkgdir}/${_jvmdir%/*}"
cp -r "openjdk.build/j2sdk-image" \
"${pkgdir}/${_jvmdir#/}"
# Remove the .zip file which is going to be inside openjdk-src
rm "${pkgdir}/${_jvmdir#/}/src.zip"
# Symlink the binaries into /usr/bin
install -d -m755 "${pkgdir}/usr/bin"
pushd "${pkgdir}/${_jvmdir#/}/bin" >/dev/null
for executable in *; do
ln -s "${_jvmdir}/bin/${executable}" \
"${pkgdir}/usr/bin"
done
popd >/dev/null
# Move the manual pages in the right place
install -d -m755 "${pkgdir}/usr/share"
mv "${pkgdir}/${_jvmdir#/}/man" \
"${pkgdir}/usr/share/man"
rm "${pkgdir}/usr/share/man/ja" # avoid conflicts with man-db
# link JKS keystore from ca-certificates-java
rm -f "${pkgdir}/${_jvmdir#/}/jre/lib/security/cacerts"
ln -s /etc/ssl/certs/java/cacerts \
"${pkgdir}/${_jvmdir#/}/jre/lib/security/cacerts"
# Setup the shell profile dropin configuration
install -D -m755 "${srcdir}/openjdk.profile.sh" \
"${pkgdir}/etc/profile.d/openjdk.sh"
install -D -m755 "${srcdir}/openjdk.profile.csh" \
"${pkgdir}/etc/profile.d/openjdk.csh"
# Install the license file
install -D -m644 "openjdk/LICENSE" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_openjdk-src() {
pkgdesc="An open-source implementation of the seventh edition of the Java SE Platform. (Source package)"
arch=('any')
depends=("openjdk=${pkgver}")
cd "${srcdir}/build"
# Install the source package
install -D -m644 "openjdk.build/j2sdk-image/src.zip" \
"${pkgdir}/${_jvmdir#/}/src.zip"
# Not installing the license file anymore, since we depend on openjdk,
# which already provides it.
#
# install -D -m644 "openjdk/LICENSE" \
# "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
# vim:set ts=2 sw=2 et: