aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-11-03 23:28:47 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2014-11-03 23:28:47 +0200
commit0c86f30d4bd1fa53df139dd3a182381477a1fc12 (patch)
treec974c606dcf480d265e9e77e1a15490a407f95b7 /interpreter.py
parenta500c6cfa885ab9da7527d6f983f162f31e47710 (diff)
downloadmeson-0c86f30d4bd1fa53df139dd3a182381477a1fc12.zip
meson-0c86f30d4bd1fa53df139dd3a182381477a1fc12.tar.gz
meson-0c86f30d4bd1fa53df139dd3a182381477a1fc12.tar.bz2
Can install entire subtrees with one command. Closes #14.
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/interpreter.py b/interpreter.py
index d01ebc0..51043e1 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -326,6 +326,13 @@ class Data(InterpreterObject):
def get_custom_install_dir(self):
return self.custom_install_dir
+class InstallDir(InterpreterObject):
+ def __init__(self, source_subdir, installable_subdir, install_dir):
+ InterpreterObject.__init__(self)
+ self.source_subdir = source_subdir
+ self.installable_subdir = installable_subdir
+ self.install_dir = install_dir
+
class Man(InterpreterObject):
def __init__(self, source_subdir, sources, kwargs):
@@ -705,6 +712,7 @@ class Interpreter():
'install_man' : self.func_install_man,
'subdir' : self.func_subdir,
'install_data' : self.func_install_data,
+ 'install_subdir' : self.func_install_subdir,
'configure_file' : self.func_configure_file,
'include_directories' : self.func_include_directories,
'add_global_arguments' : self.func_add_global_arguments,
@@ -1218,6 +1226,21 @@ class Interpreter():
self.build.data.append(data)
return data
+ def func_install_subdir(self, node, args, kwargs):
+ if len(args ) != 1:
+ raise InvalidArguments('Install_subdir requires exactly one argument.')
+ for a in args:
+ if not isinstance(a, str):
+ raise InvalidArguments('Argument %s is not a string.' % str(a))
+ if not 'install_dir' in kwargs:
+ raise InvalidArguments('Missing keyword argument install_dir')
+ install_dir = kwargs['install_dir']
+ if not isinstance(install_dir, str):
+ raise InvalidArguments('Keyword argument install_dir not a string.')
+ idir = InstallDir(self.subdir, args[0], install_dir)
+ self.build.install_dirs.append(idir)
+ return idir
+
def func_configure_file(self, node, args, kwargs):
if len(args) > 0:
raise InterpreterException("configure_file takes only keyword arguments.")