Commit 3ee3e3d2 authored by Gustavo Zacarias's avatar Gustavo Zacarias Committed by Peter Korsgaard
Browse files

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.

Signed-off-by: default avatarGustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 503452d7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+9 −0
Original line number Diff line number Diff line
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
+2 −0
Original line number Diff line number Diff line
#!/bin/sh
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf $@
+27 −0
Original line number Diff line number Diff line
[PATCH] prefix sysroot to include/libdir path variables

Prefix includedir / libdir variable values with sysroot if a variable is
requested (--variable=<name>), similar to how it's done for -I / -L flags.

This is sometimes used to find header files (E.G. in gst-plugins configure),
so ensure the sysroot'ed files are used.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

diff -Nura pkgconf-0.8.9.orig/main.c pkgconf-0.8.9/main.c
--- pkgconf-0.8.9.orig/main.c	2012-10-24 14:32:08.236508699 -0300
+++ pkgconf-0.8.9/main.c	2012-10-24 14:54:36.771070217 -0300
@@ -298,7 +298,12 @@
 	if (eflag != PKG_ERRF_OK)
 		return false;
 
-	printf("%s\n", req.buf);
+	if ( !strcmp(req.variable, "includedir") ||
+	  !strcmp(req.variable, "mapdir") ||
+	  !strcmp(req.variable, "libdir"))
+		printf("%s%s\n", sysroot_dir, req.buf);
+	else
+		printf("%s\n", req.buf);
 	return true;
 }
 
+31 −0
Original line number Diff line number Diff line
#############################################################
#
# 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

ifeq ($(BR2_PACKAGE_PKG_CONFIG),)
define PKGCONF_LINK_PKGCONFIG
	ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config
endef
endif

define HOST_PKGCONF_INSTALL_WRAPPER
	$(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \
		$(HOST_DIR)/usr/bin/pkg-config
	$(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \
		-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))