aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrindhold <grindhold@users.noreply.github.com>2016-09-10 23:20:49 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-09-11 00:20:49 +0300
commit167deda6658315a7bbc553757b130be70ba827e2 (patch)
treed8d271350e15b53c01083ab95534c21926146b8a
parent19ecad5b24a75c89a4fddf355849b1568766829e (diff)
downloadmeson-167deda6658315a7bbc553757b130be70ba827e2.zip
meson-167deda6658315a7bbc553757b130be70ba827e2.tar.gz
meson-167deda6658315a7bbc553757b130be70ba827e2.tar.bz2
module pkgconfig: added install_dir attribute (#776)
the pkgconfig module automatically specified to install the pkgconfig file to {libdir}/pkgconfig. Default settings in meson already include multiarch-directories like x86_64-gnu-linux into the libdir. pkgconfig usually does not check inside multiarch-dirs for any pkgconfig-files. to make this a bit more flexible, this commit introduces the install_dir attribute for pkgconfig.generate. if it is set, the default install path will be overridden by the users input
-rw-r--r--authors.txt1
-rw-r--r--mesonbuild/modules/pkgconfig.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/authors.txt b/authors.txt
index 0984c6d..fbac571 100644
--- a/authors.txt
+++ b/authors.txt
@@ -44,3 +44,4 @@ Matthias Klumpp
Elliott Sales de Andrade
Patrick Griffis
Iain Lane
+Daniel Brendle
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 9f6fc07..3bf7658 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -87,7 +87,11 @@ class PkgConfigModule:
priv_reqs = mesonlib.stringlistify(kwargs.get('requires_private', []))
priv_libs = mesonlib.stringlistify(kwargs.get('libraries_private', []))
pcfile = filebase + '.pc'
- pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'pkgconfig')
+ pkgroot = kwargs.get('install_dir',None)
+ if pkgroot is None:
+ pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'pkgconfig')
+ if not isinstance(pkgroot, str):
+ raise mesonlib.MesonException('Install_dir must be a string.')
self.generate_pkgconfig_file(state, libs, subdirs, name, description, version, filebase,
pub_reqs, priv_reqs, priv_libs)
return build.Data(False, state.environment.get_scratch_dir(), [pcfile], pkgroot)