blob: 68f624c80a306b090a898aaf9deaa2d2884ce2b6 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "Helper tool used when compiling"
2DESCRIPTION = "pkg-config is a helper tool used when compiling applications and libraries. It helps determined \
3the correct compiler/link options. It is also language-agnostic."
4HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/"
5BUGTRACKER = "http://bugs.freedesktop.org/buglist.cgi?product=pkg-config"
6SECTION = "console/utils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00008LICENSE = "GPL-2.0-or-later"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05009LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
10
Andrew Geisslereff27472021-10-29 15:35:00 -050011SRCREV = "d97db4fae4c1cd099b506970b285dc2afd818ea2"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012PV = "0.29.2+git${SRCPV}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013
William A. Kennington IIIac69b482021-06-02 12:28:27 -070014SRC_URI = "git://gitlab.freedesktop.org/pkg-config/pkg-config.git;branch=master;protocol=https \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015 file://pkg-config-esdk.in \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050016 file://pkg-config-native.in \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060017 file://0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018 "
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019
20S = "${WORKDIR}/git"
21
22inherit autotools
23
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024# Because of a faulty test, the current auto mode always evaluates to no,
25# so just continue that behaviour.
26#
27EXTRA_OECONF += "--disable-indirect-deps"
28
29PACKAGECONFIG ??= "glib"
Patrick Williams213cb262021-08-07 19:21:33 -050030PACKAGECONFIG:class-native = ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -050031
32PACKAGECONFIG[glib] = "--without-internal-glib,--with-internal-glib,glib-2.0 pkgconfig-native"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050033
34acpaths = "-I ."
35
36BBCLASSEXTEND = "native nativesdk"
37
38# Set an empty dev package to ensure the base PN package gets
39# the pkg.m4 macros, pkgconfig does not deliver any other -dev
40# files.
Patrick Williams213cb262021-08-07 19:21:33 -050041FILES:${PN}-dev = ""
42FILES:${PN} += "${datadir}/aclocal/pkg.m4"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050043
44# When using the RPM generated automatic package dependencies, some packages
45# will end up requiring 'pkgconfig(pkg-config)'. Allow this behavior by
46# specifying an appropriate provide.
Patrick Williams213cb262021-08-07 19:21:33 -050047RPROVIDES:${PN} += "pkgconfig(pkg-config)"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048
49# Install a pkg-config-native wrapper that will use the native sysroot instead
50# of the MACHINE sysroot, for using pkg-config when building native tools.
Patrick Williams213cb262021-08-07 19:21:33 -050051do_install:append:class-native () {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050052 sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
53 -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
54 < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native
55 install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
Brad Bishopd7bf8c12018-02-25 22:55:05 -050056 sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
57 -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
58 < ${WORKDIR}/pkg-config-esdk.in > ${B}/pkg-config-esdk
59 install -m755 ${B}/pkg-config-esdk ${D}${bindir}/pkg-config-esdk
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050060}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050061
62pkgconfig_sstate_fixup_esdk () {
63 if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" -a "${WITHIN_EXT_SDK}" = "1" ] ; then
64 pkgconfdir="${SSTATE_INSTDIR}/recipe-sysroot-native/${bindir_native}"
65 mv $pkgconfdir/pkg-config $pkgconfdir/pkg-config.real
Andrew Geissler595f6302022-01-24 19:11:47 +000066 ln -rs $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
Brad Bishopd7bf8c12018-02-25 22:55:05 -050067 sed -i -e "s|^pkg-config|pkg-config.real|" $pkgconfdir/pkg-config-native
68 fi
69}
70
Patrick Williams213cb262021-08-07 19:21:33 -050071SSTATEPOSTUNPACKFUNCS:append:class-native = " pkgconfig_sstate_fixup_esdk"