diff mbox

[PATCHv3,1/4] pkgconf: new package

Message ID 1348656857-27725-1-git-send-email-gustavo@zacarias.com.ar
State Superseded
Headers show

Commit Message

Gustavo Zacarias Sept. 26, 2012, 10:54 a.m. UTC
pkgconf is a drop-in replacement for pkg-config that doesn't need
itself to build and just requires a C89 compiler.

Instead of using a patch for hardcoded sysroot support (as the patch to
pkg-config does) we rely instead on a wrapper script that takes the
appropiate action.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/Config.in             |    1 +
 package/pkgconf/Config.in     |    9 +++++++++
 package/pkgconf/pkg-config.in |    2 ++
 package/pkgconf/pkgconf.mk    |   30 ++++++++++++++++++++++++++++++
 4 files changed, 42 insertions(+), 0 deletions(-)
 create mode 100644 package/pkgconf/Config.in
 create mode 100644 package/pkgconf/pkg-config.in
 create mode 100644 package/pkgconf/pkgconf.mk

Comments

Arnout Vandecappelle Sept. 27, 2012, 7:54 a.m. UTC | #1
On 09/26/12 12:54, Gustavo Zacarias wrote:
> pkgconf is a drop-in replacement for pkg-config that doesn't need
> itself to build and just requires a C89 compiler.
>
> Instead of using a patch for hardcoded sysroot support (as the patch to
> pkg-config does) we rely instead on a wrapper script that takes the
> appropiate action.
>
> Signed-off-by: Gustavo Zacarias<gustavo@zacarias.com.ar>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Minor comments below.

  The v1 is now
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(on 750 packages, with the external sourcery toolchain for x86_64, excluding the
30-ish packages that didn't build before; took a bit of time to find a working
allpackageyesconfig). I don't suppose I have to retest with this series?

[snip]
> diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in
> new file mode 100644
> index 0000000..4039d4d
> --- /dev/null
> +++ b/package/pkgconf/pkg-config.in
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-@PKG_CONFIG_PATH@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} @HOST_DIR@/usr/bin/pkgconf $@

  Actually, instead of @HOST_DIR@/usr/bin, it's better to use $(dirname $0).
That way it's relocatable.

> diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk
> new file mode 100644
> index 0000000..2d79f05
> --- /dev/null
> +++ b/package/pkgconf/pkgconf.mk
> @@ -0,0 +1,30 @@
> +#############################################################
> +#
> +# pkgconf
> +#
> +#############################################################
> +
> +PKGCONF_VERSION = 0.8.9
> +PKGCONF_SITE = http://tortois.es/~nenolod/distfiles
> +PKGCONF_SOURCE = pkgconf-$(PKGCONF_VERSION).tar.bz2
> +
> +PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/usr/bin/pkg-config
> +
> +define PKGCONF_LINK_PKGCONFIG
> +	ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config
> +endef

  I wouldn't remove the pkg-config package on the target, just host-pkg-config.
Unless pkg-config is really deprecated?  Anyway, even if it is, it should be
marked as deprecated first and only removed later.

  That said, this hook should still be in
ifeq ($(BR2_PACKAGE_PKG_CONFIG),)



  Regards,
  Arnout
Thomas Petazzoni Sept. 27, 2012, 8:09 a.m. UTC | #2
Dear Arnout Vandecappelle,

On Thu, 27 Sep 2012 09:54:42 +0200, Arnout Vandecappelle wrote:

> (on 750 packages, with the external sourcery toolchain for x86_64,
> excluding the 30-ish packages that didn't build before; took a bit of
> time to find a working allpackageyesconfig). I don't suppose I have
> to retest with this series?

Just curious, how long does it take to build the whole thing?

Would be good to fix those 30-ish packages that don't build, but I
guess some of them are due to the host tuple not being different
(waiting for your <arch>-buildroot-linux... to be merged).

Thomas
Arnout Vandecappelle Sept. 27, 2012, 8:20 a.m. UTC | #3
On 09/27/12 10:09, Thomas Petazzoni wrote:
> Dear Arnout Vandecappelle,
>
> On Thu, 27 Sep 2012 09:54:42 +0200, Arnout Vandecappelle wrote:
>
>> (on 750 packages, with the external sourcery toolchain for x86_64,
>> excluding the 30-ish packages that didn't build before; took a bit of
>> time to find a working allpackageyesconfig). I don't suppose I have
>> to retest with this series?
>
> Just curious, how long does it take to build the whole thing?

  I haven't checked...  I just do a make -k during the night and see what
I need to fix in the morning.  I normally keep a log file but that's
already wiped.


> Would be good to fix those 30-ish packages that don't build, but I
> guess some of them are due to the host tuple not being different
> (waiting for your<arch>-buildroot-linux... to be merged).

  The cross-build problem I patched first, otherwise there would be many more
failures (and probably all of them packages that use pkg-config).  The
remaining problems are:

- The LD_LIBRARY_PATH problem I mentioned, worked around by setting
   XMLTO=/dev/null

- CMake doesn't find libraries in $(STAGING_DIR)/usr/lib64, worked around
   by setting CMAKE_LIBRARY_PATH

- Similar for scons, no workaround (gpsd fails to build)

- xapp_* needs to be upgraded due to Xorg upgrade

- linux-pam, sdl-gfx: not analysed why they fail

- packages from avr32linux fail to download

- there are a few packages that I disabled before for some reason, and I
   didn't enable them again.


  I'm planning to do a more thorough analysis + fixes at some point.
When I have time :-P

  Regards,
  Arnout
Thomas Petazzoni Sept. 27, 2012, 8:25 a.m. UTC | #4
Dear Arnout Vandecappelle,

On Thu, 27 Sep 2012 10:20:37 +0200, Arnout Vandecappelle wrote:

>   I haven't checked...  I just do a make -k during the night and see
> what I need to fix in the morning.  I normally keep a log file but
> that's already wiped.

Ok. I'm wondering if we should be running allyespackageconfig builds in
a regular fashion on the autobuild machines as well.

> > Would be good to fix those 30-ish packages that don't build, but I
> > guess some of them are due to the host tuple not being different
> > (waiting for your<arch>-buildroot-linux... to be merged).
> 
>   The cross-build problem I patched first, otherwise there would be
> many more failures (and probably all of them packages that use
> pkg-config).  The remaining problems are:
> 
> - The LD_LIBRARY_PATH problem I mentioned, worked around by setting
>    XMLTO=/dev/null
> 
> - CMake doesn't find libraries in $(STAGING_DIR)/usr/lib64, worked
> around by setting CMAKE_LIBRARY_PATH
> 
> - Similar for scons, no workaround (gpsd fails to build)
> 
> - xapp_* needs to be upgraded due to Xorg upgrade
> 
> - linux-pam, sdl-gfx: not analysed why they fail
> 
> - packages from avr32linux fail to download
> 
> - there are a few packages that I disabled before for some reason,
> and I didn't enable them again.
> 
> 
>   I'm planning to do a more thorough analysis + fixes at some point.
> When I have time :-P

Great, nice analysis. Looking forward to the corresponding fixes :-)

Thomas
Arnout Vandecappelle Sept. 27, 2012, 8:30 a.m. UTC | #5
On 09/27/12 10:25, Thomas Petazzoni wrote:
>> >     I haven't checked...  I just do a make -k during the night and see
>> >  what I need to fix in the morning.  I normally keep a log file but
>> >  that's already wiped.
> Ok. I'm wondering if we should be running allyespackageconfig builds in
> a regular fashion on the autobuild machines as well.

  No, I don't think it's worth it.  Random builds should trigger all packages
a couple of times per week, and they will capture dependency problems that
an allyespackageconfig doesn't.

  It would be useful if a report existed somewhere that lists each package and
gives the last time it was built successfully and failed.  That should tell us
if some packages are missed by the autobuilders.  Even better would be if this
is reported per autobuilder config, but that's probably too large to view.

  Regards,
  Arnout
Thomas Petazzoni Sept. 27, 2012, 1:24 p.m. UTC | #6
Dear Arnout Vandecappelle,

On Thu, 27 Sep 2012 10:30:32 +0200, Arnout Vandecappelle wrote:

>   It would be useful if a report existed somewhere that lists each
> package and gives the last time it was built successfully and
> failed.  That should tell us if some packages are missed by the
> autobuilders.  Even better would be if this is reported per
> autobuilder config, but that's probably too large to view.

I have started working on a rework of the autobuilder Web interface,
which will add a database for the test results and their configuration.
But I don't have anything to show yet, it's not even working at the
moment.

The goal is to be able to make queries such as the one you're
describing. For now, it is more or less impossible because there is no
database, just a bunch of directories, and the website is generated by
doing finds, greps and other funky stuff :)

Best regards,

Thomas
Gustavo Zacarias Sept. 29, 2012, 12:53 p.m. UTC | #7
On 09/27/12 04:54, Arnout Vandecappelle wrote:
>> +PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-@PKG_CONFIG_PATH@}
>> PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@}
>> @HOST_DIR@/usr/bin/pkgconf $@
> 
>  Actually, instead of @HOST_DIR@/usr/bin, it's better to use $(dirname $0).
> That way it's relocatable.

Yes, that's cool.
I'm rolling back to not allowing overrides to PKG_CONFIG_PATH and
PKG_CONFIG_SYSROOT_DIR since at least one package (sshfs) behaves badly.
Case in point is it does export
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH which you can
guess where it goes.
I could append instead of replace, but again, in general for the time
being i see no real benefit in allowing it, so we'd end with:

PKG_CONFIG_PATH=@PKG_CONFIG_PATH@ PKG_CONFIG_SYSROOT_DIR=@STAGING_DIR@
$(dirname $0)/pkgconf $@

Like in v1 but with your dirname recommendation.
The other fix scenario would be to make all the packages use
$(TARGET_MAKE_ENV) and fill the PKG_CONFIG* variables there.
Regards.
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 82c319e..0c17918 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -84,6 +84,7 @@  if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/patch/Config.in"
 endif
 source "package/pkg-config/Config.in"
+source "package/pkgconf/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/sed/Config.in"
 endif
diff --git a/package/pkgconf/Config.in b/package/pkgconf/Config.in
new file mode 100644
index 0000000..f95847f
--- /dev/null
+++ b/package/pkgconf/Config.in
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_PKGCONF
+	bool "pkgconf"
+	help
+	  pkgconf is a program which helps to configure compiler and linker
+	  flags for development frameworks. It is similar to pkg-config,
+	  but was written from scratch in the summer of 2011 to replace
+	  pkg-config, which now needs itself to build itself
+
+	  https://github.com/nenolod/pkgconf
diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in
new file mode 100644
index 0000000..4039d4d
--- /dev/null
+++ b/package/pkgconf/pkg-config.in
@@ -0,0 +1,2 @@ 
+#!/bin/sh
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-@PKG_CONFIG_PATH@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} @HOST_DIR@/usr/bin/pkgconf $@
diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk
new file mode 100644
index 0000000..2d79f05
--- /dev/null
+++ b/package/pkgconf/pkgconf.mk
@@ -0,0 +1,30 @@ 
+#############################################################
+#
+# pkgconf
+#
+#############################################################
+
+PKGCONF_VERSION = 0.8.9
+PKGCONF_SITE = http://tortois.es/~nenolod/distfiles
+PKGCONF_SOURCE = pkgconf-$(PKGCONF_VERSION).tar.bz2
+
+PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/usr/bin/pkg-config
+
+define PKGCONF_LINK_PKGCONFIG
+	ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config
+endef
+
+define HOST_PKGCONF_INSTALL_WRAPPER
+	$(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \
+		$(HOST_DIR)/usr/bin/pkg-config
+	$(SED) 's,@PKG_CONFIG_PATH@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \
+		-e 's,@HOST_DIR@,$(HOST_DIR),' \
+		-e 's,@STAGING_DIR@,$(STAGING_DIR),' \
+		$(HOST_DIR)/usr/bin/pkg-config
+endef
+
+PKGCONF_POST_INSTALL_TARGET_HOOKS += PKGCONF_LINK_PKGCONFIG
+HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_INSTALL_WRAPPER
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))