All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][meta-oe] php: fix native php when it is from sstate
@ 2015-06-10  8:44 rongqing.li
  2015-06-15 12:08 ` Martin Jansa
  0 siblings, 1 reply; 2+ messages in thread
From: rongqing.li @ 2015-06-10  8:44 UTC (permalink / raw)
  To: openembedded-devel

From: Roy Li <rongqing.li@windriver.com>

the native php is used to install the target pear, and native php
has hard-code path, so make wrapper to override the hard-code path

the configuration format of pear.conf for native php is like:
"type:path length:path", path will be replaced when populate sysroot
setscene, but the path length is not changed, and make php unable to
work, add a task to SSTATEPOSTINSTFUNCS to fix the path length

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 meta-oe/recipes-devtools/php/php_5.5.24.bb | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/meta-oe/recipes-devtools/php/php_5.5.24.bb b/meta-oe/recipes-devtools/php/php_5.5.24.bb
index 3e656af..ced3904 100644
--- a/meta-oe/recipes-devtools/php/php_5.5.24.bb
+++ b/meta-oe/recipes-devtools/php/php_5.5.24.bb
@@ -245,3 +245,21 @@ MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp',
 RPROVIDES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
 RREPLACES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
 RCONFLICTS_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
+
+do_install_append_virtclass-native() {
+    create_wrapper ${D}${bindir}/php \
+        PHP_PEAR_SYSCONF_DIR=${sysconfdir}/
+}
+
+SSTATEPOSTINSTFUNCS_append_virtclass-native += " php_sstate_postinst"
+
+php_sstate_postinst() {
+    if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+    then
+        head -n1 ${sysconfdir}/pear.conf > ${sysconfdir}/pear.tmp.conf
+        for p in `tail -n1  ${sysconfdir}/pear.conf | sed -s 's/;/ /g'`; do
+            echo $p | awk -F: 'BEGIN {OFS = ":"; ORS = ";"}{if(NF==3){print $1, length($3)-2*match($3, /^"/), $3} else {print $0}}';
+        done >> ${sysconfdir}/pear.tmp.conf
+        mv -f ${sysconfdir}/pear.tmp.conf ${sysconfdir}/pear.conf
+    fi
+}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][meta-oe] php: fix native php when it is from sstate
  2015-06-10  8:44 [PATCH][meta-oe] php: fix native php when it is from sstate rongqing.li
@ 2015-06-15 12:08 ` Martin Jansa
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2015-06-15 12:08 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Jun 10, 2015 at 04:44:44PM +0800, rongqing.li@windriver.com wrote:
> From: Roy Li <rongqing.li@windriver.com>
> 
> the native php is used to install the target pear, and native php
> has hard-code path, so make wrapper to override the hard-code path
> 
> the configuration format of pear.conf for native php is like:
> "type:path length:path", path will be replaced when populate sysroot
> setscene, but the path length is not changed, and make php unable to
> work, add a task to SSTATEPOSTINSTFUNCS to fix the path length

Use "class-native" instead of deprecated "virtclass-native".

> 
> Signed-off-by: Roy Li <rongqing.li@windriver.com>
> ---
>  meta-oe/recipes-devtools/php/php_5.5.24.bb | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/meta-oe/recipes-devtools/php/php_5.5.24.bb b/meta-oe/recipes-devtools/php/php_5.5.24.bb
> index 3e656af..ced3904 100644
> --- a/meta-oe/recipes-devtools/php/php_5.5.24.bb
> +++ b/meta-oe/recipes-devtools/php/php_5.5.24.bb
> @@ -245,3 +245,21 @@ MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp',
>  RPROVIDES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
>  RREPLACES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
>  RCONFLICTS_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
> +
> +do_install_append_virtclass-native() {
> +    create_wrapper ${D}${bindir}/php \
> +        PHP_PEAR_SYSCONF_DIR=${sysconfdir}/
> +}
> +
> +SSTATEPOSTINSTFUNCS_append_virtclass-native += " php_sstate_postinst"
> +
> +php_sstate_postinst() {
> +    if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
> +    then
> +        head -n1 ${sysconfdir}/pear.conf > ${sysconfdir}/pear.tmp.conf
> +        for p in `tail -n1  ${sysconfdir}/pear.conf | sed -s 's/;/ /g'`; do
> +            echo $p | awk -F: 'BEGIN {OFS = ":"; ORS = ";"}{if(NF==3){print $1, length($3)-2*match($3, /^"/), $3} else {print $0}}';
> +        done >> ${sysconfdir}/pear.tmp.conf
> +        mv -f ${sysconfdir}/pear.tmp.conf ${sysconfdir}/pear.conf
> +    fi
> +}
> -- 
> 1.9.1
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-15 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10  8:44 [PATCH][meta-oe] php: fix native php when it is from sstate rongqing.li
2015-06-15 12:08 ` Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.