Patchwork ncurses: enforce creation of pkg-config files

login
register
mail settings
Submitter Enrico Scholz
Date July 25, 2011, 2:18 p.m.
Message ID <1311603506-14101-1-git-send-email-enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/8447/
State New, archived
Headers show

Comments

Enrico Scholz - July 25, 2011, 2:18 p.m.
ncurses does not create its .pc files when the /usr/lib/pkg-config
directory does not exist in the sysroot.  Because ncurses will be built
very early, this directory might be missing and .pc files will not be
installed.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 .../ncurses/ncurses-5.9/pkgconfig-initial.patch    |   30 ++++++++++++++++++++
 meta/recipes-core/ncurses/ncurses_5.9.bb           |    3 +-
 2 files changed, 32 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch
Saul Wold - July 25, 2011, 4:32 p.m.
On 07/25/2011 07:18 AM, Enrico Scholz wrote:
> ncurses does not create its .pc files when the /usr/lib/pkg-config
> directory does not exist in the sysroot.  Because ncurses will be built
> very early, this directory might be missing and .pc files will not be
> installed.
>
> Signed-off-by: Enrico Scholz<enrico.scholz@sigma-chemnitz.de>
> ---
>   .../ncurses/ncurses-5.9/pkgconfig-initial.patch    |   30 ++++++++++++++++++++
>   meta/recipes-core/ncurses/ncurses_5.9.bb           |    3 +-
>   2 files changed, 32 insertions(+), 1 deletions(-)
>   create mode 100644 meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch
>
> diff --git a/meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch b/meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch
> new file mode 100644
> index 0000000..e0cc9b0
> --- /dev/null
> +++ b/meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch
> @@ -0,0 +1,30 @@
> +Do not check for the existence of /usr/lib/pkg-config directory
> +
> +directory might not exist yet when building oe from scratch.
> +
Enrico,

Please add a Signed-off-by line and also review the Patch guidelines:

http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines

If possible, please also add the optional Upstream-Status: info.

Thanks
	Sau!


> +Index: ncurses-5.9/configure
> +===================================================================
> +--- ncurses-5.9.orig/configure
> ++++ ncurses-5.9/configure
> +@@ -3626,7 +3626,7 @@ echo $ECHO_N "checking if we should inst
> +		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
> +	fi
> +	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
> +-	if test -n "$PKG_CONFIG_LIBDIR"&&  test -d "$PKG_CONFIG_LIBDIR" ; then
> ++	if test -n "$PKG_CONFIG_LIBDIR" ; then
> +
> + # Check whether --enable-pc-files or --disable-pc-files was given.
> + if test "${enable_pc_files+set}" = set; then
> +Index: ncurses-5.9/configure.in
> +===================================================================
> +--- ncurses-5.9.orig/configure.in
> ++++ ncurses-5.9/configure.in
> +@@ -177,7 +177,7 @@ if test "$PKG_CONFIG" != no ; then
> +		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig
> +	fi
> +	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
> +-	if test -n "$PKG_CONFIG_LIBDIR"&&  test -d "$PKG_CONFIG_LIBDIR" ; then
> ++	if test -n "$PKG_CONFIG_LIBDIR" ; then
> +		AC_ARG_ENABLE(pc-files,
> +			[  --enable-pc-files       generate and install .pc files for pkg-config],
> +			[enable_pc_files=$enableval],
> diff --git a/meta/recipes-core/ncurses/ncurses_5.9.bb b/meta/recipes-core/ncurses/ncurses_5.9.bb
> index 6d23c0c..c980b73 100644
> --- a/meta/recipes-core/ncurses/ncurses_5.9.bb
> +++ b/meta/recipes-core/ncurses/ncurses_5.9.bb
> @@ -1,9 +1,10 @@
>   require ncurses.inc
>
> -PR = "${INC_PR}.1"
> +PR = "${INC_PR}.2"
>
>   SRC_URI += "file://tic-hang.patch \
>               file://config.cache \
> +            file://pkgconfig-initial.patch \
>   "
>
>   SRC_URI[md5sum] = "8cb9c412e5f2d96bc6f459aa8c6282a1"
Phil Blundell - July 25, 2011, 4:49 p.m.
On Mon, 2011-07-25 at 16:18 +0200, Enrico Scholz wrote:
> +	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
> +-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
> ++	if test -n "$PKG_CONFIG_LIBDIR" ; then

I wonder if it would be easier to just create the directory in
do_configure() so that the test always succeeds, rather than patching
configure like this.

p.
Enrico Scholz - July 25, 2011, 5:10 p.m.
Phil Blundell <philb-mXXj517/zsQ@public.gmane.org> writes:

>> +-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
>> ++	if test -n "$PKG_CONFIG_LIBDIR" ; then
>
> I wonder if it would be easier to just create the directory in
> do_configure() 

This directory is in the staged sysroot
(e.g. ${TMPDIR}/sysroots/kk-trizeps6//usr/lib/pkgconfig). Is it really
permitted to touch this area outside of the normal staging?


Enrico
Phil Blundell - July 25, 2011, 5:31 p.m.
On Mon, 2011-07-25 at 19:10 +0200, Enrico Scholz wrote:
> Phil Blundell <philb-mXXj517/zsQ@public.gmane.org> writes:
> 
> >> +-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
> >> ++	if test -n "$PKG_CONFIG_LIBDIR" ; then
> >
> > I wonder if it would be easier to just create the directory in
> > do_configure() 
> 
> This directory is in the staged sysroot
> (e.g. ${TMPDIR}/sysroots/kk-trizeps6//usr/lib/pkgconfig). Is it really
> permitted to touch this area outside of the normal staging?

Oh, yeah, maybe not.  In that case I guess your patch probably is the
best answer.

p.

Patch

diff --git a/meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch b/meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch
new file mode 100644
index 0000000..e0cc9b0
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses-5.9/pkgconfig-initial.patch
@@ -0,0 +1,30 @@ 
+Do not check for the existence of /usr/lib/pkg-config directory
+
+directory might not exist yet when building oe from scratch.
+
+Index: ncurses-5.9/configure
+===================================================================
+--- ncurses-5.9.orig/configure
++++ ncurses-5.9/configure
+@@ -3626,7 +3626,7 @@ echo $ECHO_N "checking if we should inst
+		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
+	fi
+	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
++	if test -n "$PKG_CONFIG_LIBDIR" ; then
+
+ # Check whether --enable-pc-files or --disable-pc-files was given.
+ if test "${enable_pc_files+set}" = set; then
+Index: ncurses-5.9/configure.in
+===================================================================
+--- ncurses-5.9.orig/configure.in
++++ ncurses-5.9/configure.in
+@@ -177,7 +177,7 @@ if test "$PKG_CONFIG" != no ; then
+		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig
+	fi
+	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
++	if test -n "$PKG_CONFIG_LIBDIR" ; then
+		AC_ARG_ENABLE(pc-files,
+			[  --enable-pc-files       generate and install .pc files for pkg-config],
+			[enable_pc_files=$enableval],
diff --git a/meta/recipes-core/ncurses/ncurses_5.9.bb b/meta/recipes-core/ncurses/ncurses_5.9.bb
index 6d23c0c..c980b73 100644
--- a/meta/recipes-core/ncurses/ncurses_5.9.bb
+++ b/meta/recipes-core/ncurses/ncurses_5.9.bb
@@ -1,9 +1,10 @@ 
 require ncurses.inc
 
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
 
 SRC_URI += "file://tic-hang.patch \
             file://config.cache \
+            file://pkgconfig-initial.patch \
 "
 
 SRC_URI[md5sum] = "8cb9c412e5f2d96bc6f459aa8c6282a1"