|
Igor Gnatenko |
511817 |
From 4e8696fefcc2c4ce2c5d49b19ce5b4a8a9b9debb Mon Sep 17 00:00:00 2001
|
|
Igor Gnatenko |
57d01a |
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
Igor Gnatenko |
57d01a |
Date: Fri, 7 Oct 2016 23:15:55 +0200
|
|
Igor Gnatenko |
511817 |
Subject: [PATCH 09/10] allow libdir/includedir/etc. be absolute paths
|
|
Igor Gnatenko |
57d01a |
|
|
Igor Gnatenko |
57d01a |
In Fedora we don't care about prefix, we want to ensure that libdir
|
|
Igor Gnatenko |
57d01a |
is /usr/lib64, localedir is /usr/share/locale, and cetera.
|
|
Igor Gnatenko |
57d01a |
|
|
Igor Gnatenko |
57d01a |
Additionally, we don't need to ensure that prefix is absolute as we
|
|
Igor Gnatenko |
57d01a |
check it in main.
|
|
Igor Gnatenko |
57d01a |
|
|
Igor Gnatenko |
57d01a |
Fixes: cc19bf0f45f9 ("Move option validation in objects rather than doing it only in the conf script.")
|
|
Igor Gnatenko |
57d01a |
Closes: https://github.com/mesonbuild/meson/issues/869
|
|
Igor Gnatenko |
57d01a |
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
Igor Gnatenko |
57d01a |
(cherry picked from commit a513bcfde613f2a0403f7b0cd34d4bd62674c1d8)
|
|
Igor Gnatenko |
57d01a |
---
|
|
Igor Gnatenko |
57d01a |
mesonbuild/coredata.py | 5 -----
|
|
Igor Gnatenko |
57d01a |
mesonbuild/mesonmain.py | 2 +-
|
|
Igor Gnatenko |
57d01a |
2 files changed, 1 insertion(+), 6 deletions(-)
|
|
Igor Gnatenko |
57d01a |
|
|
Igor Gnatenko |
57d01a |
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
|
|
Igor Gnatenko |
511817 |
index 2ff3bc8..34bb6f1 100644
|
|
Igor Gnatenko |
57d01a |
--- a/mesonbuild/coredata.py
|
|
Igor Gnatenko |
57d01a |
+++ b/mesonbuild/coredata.py
|
|
Igor Gnatenko |
57d01a |
@@ -36,11 +36,6 @@ class UserStringOption(UserOption):
|
|
Igor Gnatenko |
57d01a |
def validate(self, value):
|
|
Igor Gnatenko |
57d01a |
if not isinstance(value, str):
|
|
Igor Gnatenko |
57d01a |
raise MesonException('Value "%s" for string option "%s" is not a string.' % (str(value), self.name))
|
|
Igor Gnatenko |
57d01a |
- if self.name == 'prefix' and not os.path.isabs(value):
|
|
Igor Gnatenko |
57d01a |
- raise MesonException('Prefix option value \'{0}\' must be an absolute path.'.format(value))
|
|
Igor Gnatenko |
57d01a |
- if self.name in ('libdir', 'bindir', 'includedir', 'datadir', 'mandir', 'localedir') \
|
|
Igor Gnatenko |
57d01a |
- and os.path.isabs(value):
|
|
Igor Gnatenko |
57d01a |
- raise MesonException('Option %s must not be an absolute path.' % self.name)
|
|
Igor Gnatenko |
57d01a |
|
|
Igor Gnatenko |
57d01a |
def set_value(self, newvalue):
|
|
Igor Gnatenko |
57d01a |
self.validate(newvalue)
|
|
Igor Gnatenko |
57d01a |
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
|
|
Igor Gnatenko |
57d01a |
index 6374c41..43e4eee 100644
|
|
Igor Gnatenko |
57d01a |
--- a/mesonbuild/mesonmain.py
|
|
Igor Gnatenko |
57d01a |
+++ b/mesonbuild/mesonmain.py
|
|
Igor Gnatenko |
57d01a |
@@ -70,7 +70,7 @@ class MesonApp():
|
|
Igor Gnatenko |
57d01a |
def __init__(self, dir1, dir2, script_file, handshake, options, original_cmd_line_args):
|
|
Igor Gnatenko |
57d01a |
(self.source_dir, self.build_dir) = self.validate_dirs(dir1, dir2, handshake)
|
|
Igor Gnatenko |
57d01a |
if not os.path.isabs(options.prefix):
|
|
Igor Gnatenko |
57d01a |
- raise RuntimeError('--prefix value \'{0}\' must be an absolute path: '.format(options.prefix))
|
|
Igor Gnatenko |
57d01a |
+ raise RuntimeError('--prefix value must be an absolute path: {!r}'.format(options.prefix))
|
|
Igor Gnatenko |
57d01a |
if options.prefix.endswith('/') or options.prefix.endswith('\\'):
|
|
Igor Gnatenko |
57d01a |
# On Windows we need to preserve the trailing slash if the
|
|
Igor Gnatenko |
57d01a |
# string is of type 'C:\' because 'C:' is not an absolute path.
|
|
Igor Gnatenko |
57d01a |
--
|
|
Igor Gnatenko |
57d01a |
2.10.1
|
|
Igor Gnatenko |
57d01a |
|