Skip to contentSkip to conversation

pkgconf: new package

PATCH Superseded Gustavo Zacarias 3 participants 8 messages Sep 26, 2012 – Sep 29, 2012

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/4 pkgconf: new package

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.

---
 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
package/Config.in +1 -0
index 82c319e..0c17918 100644
@@ -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
package/pkgconf/Config.in new file +9 -0
new file mode 100644
index 0000000..f95847f
@@ -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
package/pkgconf/pkg-config.in new file +2 -0
new file mode 100644
index 0000000..4039d4d
@@ -0,0 +1,2 @@
+#!/bin/sh
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH:- at PKG_CONFIG_PATH@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:- at STAGING_DIR@} @HOST_DIR@/usr/bin/pkgconf $@
package/pkgconf/pkgconf.mk new file +30 -0
new file mode 100644
index 0000000..2d79f05
@@ -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, at PKG_CONFIG_PATH@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \
+		-e 's, at HOST_DIR@,$(HOST_DIR),' \
+		-e 's, at 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))
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH v3 1/4 pkgconf: new package

Quoted 8 lines · Gustavo Zacarias

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.

Minor comments below.

The v1 is now

(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]

package/pkgconf/pkg-config.in line 2

Quoted 8 lines
package/pkgconf/pkg-config.in new file +2 -0
new file mode 100644
index 0000000..4039d4d
@@ -0,0 +1,2 @@
+#!/bin/sh
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH:- at PKG_CONFIG_PATH@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:- at 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.

Quoted 11 lines
package/pkgconf/pkgconf.mk new file +5 -0
new file mode 100644
index 0000000..2d79f05
@@ -0,0 +1,30 @@
+#############################################################
+#
+# pkgconf
+#
+#############################################################

package/pkgconf/pkgconf.mk line 15

Quoted 10 lines
package/pkgconf/pkgconf.mk new file +10 -0
+
+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

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH v3 1/4 pkgconf: new package

Dear Arnout Vandecappelle,

Quoted 4 lines · Arnout Vandecappelle

(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

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH v3 1/4 pkgconf: new package

Quoted 10 lines · Thomas Petazzoni

Dear Arnout Vandecappelle,

Quoted 4 lines · Arnout Vandecappelle

(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.

Quoted 3 lines

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

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH v3 1/4 pkgconf: new package

Dear Arnout Vandecappelle,

Quoted 3 lines · Arnout Vandecappelle

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.

Quoted 20 lines
Quoted 3 lines

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

Quoted 8 lines

- 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

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH v3 1/4 pkgconf: new package

Quoted 5 lines · Thomas Petazzoni
Quoted 3 lines
Quoted 3 lines

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

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#6 lore raw

PATCH v3 1/4 pkgconf: new package

Dear Arnout Vandecappelle,

Quoted 5 lines · Arnout Vandecappelle

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

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH v3 1/4 pkgconf: new package

In reply to Arnout Vandecappelle
Quoted 6 lines · Arnout Vandecappelle
Quoted 3 lines

+PKG_CONFIG_PATH=${PKG_CONFIG_PATH:- at PKG_CONFIG_PATH@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:- at 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.