Message ID | 1348600115-27059-1-git-send-email-gustavo@zacarias.com.ar |
---|---|
State | Superseded |
Headers | show |
On 09/25/12 21:08, 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 instead rely 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 nits below. [snip] > +HOST_PKGCONF_CONF_OPT = \ > + --with-pkg-config-dir="$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig" Since we anyway need a wrapper, wouldn't it be more consistent to set PKG_CONFIG_PATH there instead? > + > +define PKGCONF_LINK_PKGCONFIG > + ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config > +endef As long as pkg-config exists, I would wrap this in a ifeq ($(BR2_PACKAGE_PKG_CONFIG),) > + > +define HOST_PKGCONF_INSTALL_WRAPPER > + $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ > + $(HOST_DIR)/usr/bin/pkg-config > + $(SED) 's,@HOST_DIR@,$(HOST_DIR),' $(HOST_DIR)/usr/bin/pkg-config > + $(SED) 's,@STAGING_DIR@,$(STAGING_DIR),' $(HOST_DIR)/usr/bin/pkg-config > +endef If for whatever reason, host-pkg-config is also built, the script will be overwritten. So to be safe, I'd remove host-pkg-config as well (as a third patch). > + > +PKGCONF_POST_INSTALL_TARGET_HOOKS += PKGCONF_LINK_PKGCONFIG > +HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_INSTALL_WRAPPER > + > +$(eval $(autotools-package)) > +$(eval $(host-autotools-package)) > + > +PKG_CONFIG_HOST_BINARY:=$(HOST_DIR)/usr/bin/pkg-config Although this is just copy-pasted from pkg-config.mk, that's no reason to break the buildroot conventions :-) PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/usr/bin/pkg-config Regards, Arnout
On 09/25/12 17:53, Arnout Vandecappelle wrote: > Since we anyway need a wrapper, wouldn't it be more consistent > to set PKG_CONFIG_PATH there instead? Yes, it's possible, i can't think of any gain by doing so, but then i can't think of any loss either. > As long as pkg-config exists, I would wrap this in a > ifeq ($(BR2_PACKAGE_PKG_CONFIG),) See next point... > If for whatever reason, host-pkg-config is also built, the script > will be overwritten. So to be safe, I'd remove host-pkg-config as well > (as a third patch). Yes, the idea is to remove pkg-config, but i don't think this is a final patch yet, it's more like a "let people test it and see if nothing breaks" (things didn't break for a couple of projects i've run with the patchset, but that may not be the case for everyone else). > Although this is just copy-pasted from pkg-config.mk, that's no reason > to break the buildroot conventions :-) > > PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/usr/bin/pkg-config Yeah, it was a copy, again, not a final patchset :) Regards.
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..79cd8d8 --- /dev/null +++ b/package/pkgconf/pkg-config.in @@ -0,0 +1,2 @@ +#!/bin/sh +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..5c51735 --- /dev/null +++ b/package/pkgconf/pkgconf.mk @@ -0,0 +1,31 @@ +############################################################# +# +# pkgconf +# +############################################################# + +PKGCONF_VERSION = 0.8.9 +PKGCONF_SITE = http://tortois.es/~nenolod/distfiles +PKGCONF_SOURCE = pkgconf-$(PKGCONF_VERSION).tar.bz2 + +HOST_PKGCONF_CONF_OPT = \ + --with-pkg-config-dir="$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig" + +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,@HOST_DIR@,$(HOST_DIR),' $(HOST_DIR)/usr/bin/pkg-config + $(SED) '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)) + +PKG_CONFIG_HOST_BINARY:=$(HOST_DIR)/usr/bin/pkg-config
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 instead rely 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 | 31 +++++++++++++++++++++++++++++++ 4 files changed, 43 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