pkg-config variant to use internal glib (#2104)

Pkg-config depends on glib which depends on pkg-config. As a result,
pkg-config used to build glib internally. However, this fails on Mac.
Building pkg-config with an internal glib is now a variant, turned on
by default, and required to build glib.
This commit is contained in:
Mayeul d'Avezac 2016-10-25 19:08:32 +01:00 committed by Todd Gamblin
parent a250792202
commit 65c250699f
2 changed files with 12 additions and 8 deletions

View file

@ -42,7 +42,7 @@ class Glib(Package):
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('pkg-config', type='build')
depends_on('pkg-config+internal_glib', type='build')
depends_on('libffi')
depends_on('zlib')
depends_on('gettext')

View file

@ -36,17 +36,21 @@ class PkgConfig(Package):
version('0.28', 'aa3c86e67551adc3ac865160e34a2a0d')
parallel = False
variant('internal_glib', default=True,
description='Builds with internal glib')
# The following patch is needed for gcc-6.1
patch('g_date_strftime.patch')
def install(self, spec, prefix):
configure("--prefix={0}".format(prefix),
"--enable-shared",
args = ["--prefix={0}".format(prefix),
"--enable-shared"]
if "+internal_glib" in spec:
# There's a bootstrapping problem here;
# glib uses pkg-config as well, so break
# the cycle by using the internal glib.
"--with-internal-glib")
args.append("--with-internal-glib")
configure(*args)
make()
make("install")