[oe] [meta-openwrt][PATCH 6/9] Juci: replace yui-compressor with minify

Stanley Phoong stanley.cheong.kwan.phoong at intel.com
Mon Jul 17 02:48:08 UTC 2017


From: "Stanley Cheong Kwan, Phoong" <stanley.cheong.kwan.phoong at intel.com>

yui-compressor was missing and it relies on Java, so converted the
dependency of Juci on yui-compressor to minify-js

Signed-off-by: Stanley Cheong Kwan, Phoong <stanley.cheong.kwan.phoong at intel.com>
---
 recipes-core/juci/juci/0002-fix-bootstrap.patch    | 15 +++++++++++++++
 recipes-core/juci/juci/0003-fix-juci-compile.patch | 16 ++++++++++++++++
 recipes-core/juci/juci_git.bb                      |  5 ++++-
 3 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 recipes-core/juci/juci/0002-fix-bootstrap.patch
 create mode 100644 recipes-core/juci/juci/0003-fix-juci-compile.patch

diff --git a/recipes-core/juci/juci/0002-fix-bootstrap.patch b/recipes-core/juci/juci/0002-fix-bootstrap.patch
new file mode 100644
index 0000000..af58bd2
--- /dev/null
+++ b/recipes-core/juci/juci/0002-fix-bootstrap.patch
@@ -0,0 +1,15 @@
+Index: git/scripts/bootstrap.sh
+===================================================================
+--- git.orig/scripts/bootstrap.sh
++++ git/scripts/bootstrap.sh
+@@ -9,8 +9,8 @@ if [ "$(which npm)" == "" ]; then
+ 	ERR=1
+ fi 
+ 
+-if [ "$(which yui-compressor)" == "" ] && [ "$(which yuicompressor)" == "" ]; then
+-	perr "!!! yui-compressor is missing. Please install package yui-compressor or yuicompressor."; 
++if [ "$(which minify)" == "" ]; then
++	perr "!!! minify is missing. Please install package minify."; 
+ 	ERR=1
+ fi 
+ 
diff --git a/recipes-core/juci/juci/0003-fix-juci-compile.patch b/recipes-core/juci/juci/0003-fix-juci-compile.patch
new file mode 100644
index 0000000..005ae58
--- /dev/null
+++ b/recipes-core/juci/juci/0003-fix-juci-compile.patch
@@ -0,0 +1,16 @@
+Index: git/scripts/juci-compile
+===================================================================
+--- git.orig/scripts/juci-compile
++++ git/scripts/juci-compile
+@@ -14,10 +14,6 @@ done
+ 
+ for file in `find $BIN/www/css/ -name "*.css"`; do 
+ 	echo "Compiling CSS ${file}.."
+-	if [ "$(which yui-compressor)" != "" ]; then
+-		yui-compressor ${file} > ${file}.out
+-	else
+-		yuicompressor ${file} > ${file}.out
+-	fi
++	minify ${file} > ${file}.out
+ 	mv ${file}.out ${file}
+ done
diff --git a/recipes-core/juci/juci_git.bb b/recipes-core/juci/juci_git.bb
index dde8f73..e6977ca 100644
--- a/recipes-core/juci/juci_git.bb
+++ b/recipes-core/juci/juci_git.bb
@@ -10,12 +10,14 @@ SECTION = "apps"
 SRCREV = "b173dba22fbd9891bc5e3a55f8b40ba562f38e31"
 SRC_URI = "git://github.com/mkschreder/juci"
 SRC_URI += "file://0001-juci-pin-grunt-to-0.4.1-for-grunt-angular-gettext.patch"
+SRC_URI += "file://0002-fix-bootstrap.patch"
+SRC_URI += "file://0003-fix-juci-compile.patch"
 
 S = "${WORKDIR}/git"
 
 inherit npm-install
 
-NPM_INSTALL_append = " --save uglify-js less"
+NPM_INSTALL_append = " --save uglify-js less minify"
 DEPENDS += "jucid lua5.1 grunt-cli-native"
 
 do_compile() {
@@ -25,6 +27,7 @@ do_compile() {
 do_compile_append(){
         ln -sf ${WORKDIR}/git/node_modules/uglify-js/bin/uglifyjs ${WORKDIR}/recipe-sysroot-native/usr/bin/uglifyjs
         ln -sf ${WORKDIR}/git/node_modules/less/bin/lessc ${WORKDIR}/recipe-sysroot-native/usr/bin/lessc
+        ln -sf ${WORKDIR}/git/node_modules/.bin/minify ${WORKDIR}/recipe-sysroot-native/usr/bin/minify
 }
 
 do_install_append() {
-- 
2.7.4




More information about the Openembedded-devel mailing list