dev-util/yuicompressor: Fix several problems with 2.4.8-r1
authorJames Le Cuirot <chewi@gentoo.org>
Tue, 9 Feb 2016 22:46:53 +0000 (22:46 +0000)
committerJames Le Cuirot <chewi@gentoo.org>
Tue, 9 Feb 2016 22:47:28 +0000 (22:47 +0000)
2.4.8-r1 was a bit of a lemon.

Rhino can't be unbundled because apart from the custom modifications,
yuicompressor uses 1.7R2, which is substantially different to the
1.7.7 we have in the tree.

This also restores the launcher script, fixes the version number, and
adds the doc and source USE flags.

Package-Manager: portage-2.2.27

dev-util/yuicompressor/yuicompressor-2.4.8-r2.ebuild [moved from dev-util/yuicompressor/yuicompressor-2.4.8-r1.ebuild with 50% similarity]
dev-util/yuicompressor/yuicompressor-2.4.8.ebuild [deleted file]

similarity index 50%
rename from dev-util/yuicompressor/yuicompressor-2.4.8-r1.ebuild
rename to dev-util/yuicompressor/yuicompressor-2.4.8-r2.ebuild
index 0a14be33bbcb832f4842244f070c05cd7e073427..dbc74962d3322475ccf577506a198b8eec106275 100644 (file)
@@ -4,19 +4,20 @@
 
 EAPI=5
 
+RHINO_JAR="lib/rhino-1.7R2.jar"
+JAVA_PKG_IUSE="doc source"
+
 inherit java-pkg-2 java-pkg-simple
 
 DESCRIPTION="JavaScript and CSS compressor"
 HOMEPAGE="http://yui.github.io/yuicompressor/"
 SRC_URI="https://github.com/yui/yuicompressor/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
 CDEPEND="
-       dev-java/jargs:0
-       dev-java/rhino:1.6"
+       dev-java/jargs:0"
 
 DEPEND="
        ${CDEPEND}
@@ -27,14 +28,21 @@ RDEPEND="
        >=virtual/jre-1.6"
 
 S="${WORKDIR}/${P}"
-
-JAVA_GENTOO_CLASSPATH="
-       jargs
-       rhino-1.6
-"
-
+JAVA_GENTOO_CLASSPATH="jargs"
+JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${RHINO_JAR}"
 JAVA_SRC_DIR="src"
 
 java_prepare() {
-       java-pkg_clean
+       # Rhino must stay bundled for now.
+       rm -v lib/jargs*.jar || die
+
+       # Normally build.xml does this.
+       sed -i "s/@VERSION@/${PV}/g" \
+               src/com/yahoo/platform/yui/compressor/YUICompressor.java || die
+}
+
+src_install() {
+       java-pkg-simple_src_install
+       java-pkg_newjar ${RHINO_JAR} rhino.jar # Install this last!!
+       java-pkg_dolauncher ${PN} --main com.yahoo.platform.yui.compressor.Bootstrap
 }
diff --git a/dev-util/yuicompressor/yuicompressor-2.4.8.ebuild b/dev-util/yuicompressor/yuicompressor-2.4.8.ebuild
deleted file mode 100644 (file)
index 6ee725b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit java-pkg-2 java-ant-2
-
-DESCRIPTION="JavaScript and CSS compressor"
-HOMEPAGE="http://yui.github.io/yuicompressor/"
-SRC_URI="https://github.com/yui/yuicompressor/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-
-DEPEND=">=virtual/jdk-1.6"
-RDEPEND=">=virtual/jre-1.6"
-
-src_compile(){
-       eant
-}
-
-src_install() {
-       java-pkg_newjar "build/${P}.jar" "${PN}.jar"
-       java-pkg_dolauncher "${PN}"
-}