diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2023-06-08 17:13:55 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2023-06-08 21:07:35 +0200 |
commit | 0688d4c1fca302c5f61f0ee6354eb5413d7adee8 (patch) | |
tree | f6fb4cf061dbb30f8f3b8ab1906e11115b2f5577 | |
parent | 3fcf7d8143b4591e3c9b33d22067fb5cca3802c9 (diff) | |
download | ptxdist-0688d4c1fca302c5f61f0ee6354eb5413d7adee8.tar.gz ptxdist-0688d4c1fca302c5f61f0ee6354eb5413d7adee8.tar.xz |
host-pkgconf: replace host-pkg-config
It's maintained, builds faster and works as drop-in replacement for
pkg-config.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | rules/cross-pkg-config-wrapper.in | 2 | ||||
-rw-r--r-- | rules/host-pkg-config.make | 57 | ||||
-rw-r--r-- | rules/host-pkgconf.in (renamed from rules/host-pkg-config.in) | 2 | ||||
-rw-r--r-- | rules/host-pkgconf.make | 54 | ||||
-rw-r--r-- | rules/post/virtual.make | 4 | ||||
-rw-r--r-- | scripts/lib/ptxd_lib_dgen.awk | 2 | ||||
-rwxr-xr-x | scripts/pkg-config-wrapper | 25 |
7 files changed, 82 insertions, 64 deletions
diff --git a/rules/cross-pkg-config-wrapper.in b/rules/cross-pkg-config-wrapper.in index 573b9e899..ffe8120e8 100644 --- a/rules/cross-pkg-config-wrapper.in +++ b/rules/cross-pkg-config-wrapper.in @@ -3,7 +3,7 @@ config CROSS_PKG_CONFIG_WRAPPER bool default y - select HOST_PKG_CONFIG + select HOST_PKGCONF help This is a wrapper for pkg-config which has at least a bit of support for sysroot/destdir. diff --git a/rules/host-pkg-config.make b/rules/host-pkg-config.make deleted file mode 100644 index d834193f6..000000000 --- a/rules/host-pkg-config.make +++ /dev/null @@ -1,57 +0,0 @@ -# -*-makefile-*- -# -# Copyright (C) 2006-2010 by Marc Kleine-Budde <mkl@pengutronix.de> -# -# For further information about the PTXdist project and license conditions -# see the README file. -# - -# -# We provide this package -# -HOST_PACKAGES-$(PTXCONF_HOST_PKG_CONFIG) += host-pkg-config - -# -# Paths and names -# -HOST_PKG_CONFIG_VERSION := 0.29.2 -HOST_PKG_CONFIG_MD5 := f6e931e319531b736fadc017f470e68a -HOST_PKG_CONFIG := pkg-config-$(HOST_PKG_CONFIG_VERSION) -HOST_PKG_CONFIG_SUFFIX := tar.gz -HOST_PKG_CONFIG_URL := http://pkgconfig.freedesktop.org/releases/$(HOST_PKG_CONFIG).$(HOST_PKG_CONFIG_SUFFIX) -HOST_PKG_CONFIG_SOURCE := $(SRCDIR)/$(HOST_PKG_CONFIG).$(HOST_PKG_CONFIG_SUFFIX) -HOST_PKG_CONFIG_DIR := $(HOST_BUILDDIR)/$(HOST_PKG_CONFIG) -HOST_PKG_CONFIG_LICENSE := GPL-2.0-only - -# ---------------------------------------------------------------------------- -# Prepare -# ---------------------------------------------------------------------------- - -# -# autoconf -# -HOST_PKG_CONFIG_CONF_TOOL := autoconf -HOST_PKG_CONFIG_CONF_OPT := \ - $(HOST_AUTOCONF) \ - --disable-host-tool \ - --with-internal-glib - -# ---------------------------------------------------------------------------- -# Install -# ---------------------------------------------------------------------------- - -PKG_CONFIG_SCRIPT = \ - $(shell ptxd_get_alternative scripts pkg-config-wrapper && echo $$ptxd_reply) - -HOST_PKG_CONFIG_BINCONFIG_GLOB := does-not-exist - -$(STATEDIR)/host-pkg-config.install: - @$(call targetinfo) - @$(call world/install, HOST_PKG_CONFIG) - @mv $(HOST_PKG_CONFIG_PKGDIR)/usr/bin/pkg-config \ - $(HOST_PKG_CONFIG_PKGDIR)/usr/bin/pkg-config.real - @ln -sv $(PKG_CONFIG_SCRIPT) \ - $(HOST_PKG_CONFIG_PKGDIR)/usr/bin/pkg-config - @$(call touch) - -# vim: syntax=make diff --git a/rules/host-pkg-config.in b/rules/host-pkgconf.in index 20c3674a8..886e75c25 100644 --- a/rules/host-pkg-config.in +++ b/rules/host-pkgconf.in @@ -1,6 +1,6 @@ ## SECTION=hosttools_noprompt -config HOST_PKG_CONFIG +config HOST_PKGCONF tristate default y if ALLYES diff --git a/rules/host-pkgconf.make b/rules/host-pkgconf.make new file mode 100644 index 000000000..72e9dccf6 --- /dev/null +++ b/rules/host-pkgconf.make @@ -0,0 +1,54 @@ +# -*-makefile-*- +# +# Copyright (C) 2023 by Michael Olbrich <m.olbrich@pengutronix.de> +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +HOST_PACKAGES-$(PTXCONF_HOST_PKGCONF) += host-pkgconf + +# +# Paths and names +# +HOST_PKGCONF_VERSION := 1.9.5 +HOST_PKGCONF_MD5 := 0a8b69723bef4ebad83e9c8b43a75cc7 +HOST_PKGCONF := pkgconf-$(HOST_PKGCONF_VERSION) +HOST_PKGCONF_SUFFIX := tar.xz +HOST_PKGCONF_URL := https://distfiles.dereferenced.org/pkgconf/$(HOST_PKGCONF).$(HOST_PKGCONF_SUFFIX) +HOST_PKGCONF_SOURCE := $(SRCDIR)/$(HOST_PKGCONF).$(HOST_PKGCONF_SUFFIX) +HOST_PKGCONF_DIR := $(HOST_BUILDDIR)/$(HOST_PKGCONF) +HOST_PKGCONF_LICENSE := custom +HOST_PKGCONF_LICENSE_FILES := file://COPYING;md5=2214222ec1a820bd6cc75167a56925e0 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +# +# autoconf +# +HOST_PKGCONF_CONF_TOOL := autoconf +HOST_PKGCONF_CONF_OPT := \ + $(HOST_AUTOCONF) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +PKG_CONFIG_SCRIPT = \ + $(shell ptxd_get_alternative scripts pkg-config-wrapper && echo $$ptxd_reply) + +HOST_PKGCONF_BINCONFIG_GLOB := does-not-exist + +$(STATEDIR)/host-pkgconf.install: + @$(call targetinfo) + @$(call world/install, HOST_PKGCONF) + @ln -sv $(PKG_CONFIG_SCRIPT) \ + $(HOST_PKGCONF_PKGDIR)/usr/bin/pkg-config + @$(call touch) + +# vim: syntax=make diff --git a/rules/post/virtual.make b/rules/post/virtual.make index 609fd700d..a27371e95 100644 --- a/rules/post/virtual.make +++ b/rules/post/virtual.make @@ -29,8 +29,8 @@ ifdef PTXCONF_HOST_DUMMY_INSTALL_INFO $(STATEDIR)/virtual-host-tools.install: $(STATEDIR)/host-dummy-install-info.install.post endif -ifdef PTXCONF_HOST_PKG_CONFIG -$(STATEDIR)/virtual-host-tools.install: $(STATEDIR)/host-pkg-config.install.post +ifdef PTXCONF_HOST_PKGCONF +$(STATEDIR)/virtual-host-tools.install: $(STATEDIR)/host-pkgconf.install.post endif ifdef PTXCONF_HOST_CHRPATH diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index 0e36b5e35..700ed18c0 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -597,7 +597,7 @@ function write_deps_pkg_active(this_PKG, this_pkg, prefix) { function write_deps_pkg_active_virtual(this_PKG, this_pkg, prefix) { if (this_pkg ~ /^host-dummy-install-info$/) return; - if (this_pkg ~ /^host-pkg-config$/) + if (this_pkg ~ /^host-pkgconf$/) return; if (this_pkg ~ /^host-chrpath$/) return; diff --git a/scripts/pkg-config-wrapper b/scripts/pkg-config-wrapper index be2c72e60..dca2c58a9 100755 --- a/scripts/pkg-config-wrapper +++ b/scripts/pkg-config-wrapper @@ -83,6 +83,27 @@ check_pipe_status() { done } +print_pkg() { + args=() + while [ $# -gt 0 ]; do + case "${1}" in + --variable|--define-variable|--atleast-pkgconfig-version|--*-version) + shift + ;; + --*) + ;; + *) + args[${#args[@]}]="${1}" + ;; + esac + shift + done + if [ ${#args[*]} -ne 0 ]; then + pkgconf --print-provides "${args[@]}" 2> "${error}" | awk '{print $1}' && + check_pipe_status + fi +} + # # meson suppresses any pkg-config output, so dump it into the logfile instead # @@ -94,7 +115,7 @@ fi if [ -n "${PKGCONFIG_WHITELIST_SRC}" -a "${1}" != "--version" -a "${1}" != "--help" ]; then error="$(mktemp "${PTXDIST_TEMPDIR}/pkg-config.XXXXXX")" - pkgs="$(pkg-config.real --print-provides "${@}" 2> "${error}" | awk '{print $1}' && check_pipe_status)" + pkgs="$(print_pkg "${@}")" if [ $? -ne 0 ]; then if [ "${ERROR_FD}" != "2" ]; then echo "$(basename ${0}) $*" >&${PTXDIST_FD_LOGFILE} @@ -111,5 +132,5 @@ if [ -n "${PKGCONFIG_WHITELIST_SRC}" -a "${1}" != "--version" -a "${1}" != "--he fi done fi -pkg-config.real "${@}" | sed "${args[@]}" +pkgconf "${@}" | sed "${args[@]}" check_pipe_status |