summaryrefslogtreecommitdiff
path: root/morphlib/buildsystem.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/buildsystem.py')
-rw-r--r--morphlib/buildsystem.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py
index d7fbaf73..29d35627 100644
--- a/morphlib/buildsystem.py
+++ b/morphlib/buildsystem.py
@@ -44,11 +44,10 @@ _STRIP_COMMAND = r'''find "$DESTDIR" -type f \
class BuildSystem(object):
- '''Predefined commands for common build systems.
+ '''Predefined command sequences for a given build system.
- Some build systems are well known: autotools, for example. We provide
- pre-defined build commands for these so that they don't need to be copied
- and pasted many times in the build instructions.
+ For example, you can have an 'autotools' build system, which runs
+ 'configure', 'make' and 'make install'.
'''
@@ -69,6 +68,14 @@ class BuildSystem(object):
self.strip_commands = []
self.post_strip_commands = []
+ def from_dict(self, name, commands):
+ self.name = name
+
+ self.configure_commands = commands.get('configure-commands', [])
+ self.build_commands = commands.get('build-commands', [])
+ self.install_commands = commands.get('install-commands', [])
+ self.strip_commands = commands.get('strip-commands', [])
+
def __getitem__(self, key):
key = '_'.join(key.split('-'))
return getattr(self, key)