From 81ebe71089d802061c2c3cb03bfd548388d04cb8 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 23 Jul 2015 17:48:03 +0100 Subject: Remove support for Baserock definitions format versions 3, 4 and 5 Change-Id: Iad95af65bd5c528d2e72f5b2ffa80a01152f50ff --- morphlib/buildsystem.py | 86 +++---------------------------------------------- 1 file changed, 4 insertions(+), 82 deletions(-) (limited to 'morphlib/buildsystem.py') diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py index 4655f2ee..5096a7c4 100644 --- a/morphlib/buildsystem.py +++ b/morphlib/buildsystem.py @@ -44,15 +44,11 @@ _STRIP_COMMAND = r'''find "$DESTDIR" -type f \ class BuildSystem(object): - '''An abstraction of an upstream build system. + '''Predefined commands for common build systems. - Some build systems are well known: autotools, for example. - Others are purely manual: there's a set of commands to run that - are specific for that project, and (almost) no other project uses them. - The Linux kernel would be an example of that. - - This class provides an abstraction for these, including a method - to autodetect well known build systems. + 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. ''' @@ -86,15 +82,6 @@ class BuildSystem(object): 'build-system': self.name, }) - def used_by_project(self, file_list): - '''Does a project use this build system? - - ``exists`` is a function that returns a boolean telling if a - filename, relative to the project source directory, exists or not. - - ''' - raise NotImplementedError() # pragma: no cover - class ManualBuildSystem(BuildSystem): @@ -102,9 +89,6 @@ class ManualBuildSystem(BuildSystem): name = 'manual' - def used_by_project(self, file_list): - return False - class DummyBuildSystem(BuildSystem): @@ -120,9 +104,6 @@ class DummyBuildSystem(BuildSystem): self.install_commands = ['echo dummy install'] self.strip_commands = ['echo dummy strip'] - def used_by_project(self, file_list): - return False - class AutotoolsBuildSystem(BuildSystem): @@ -149,18 +130,6 @@ class AutotoolsBuildSystem(BuildSystem): ] self.strip_commands = [_STRIP_COMMAND] - def used_by_project(self, file_list): - indicators = [ - 'autogen', - 'autogen.sh', - 'configure', - 'configure.ac', - 'configure.in', - 'configure.in.in', - ] - - return any(x in file_list for x in indicators) - class PythonDistutilsBuildSystem(BuildSystem): @@ -182,13 +151,6 @@ class PythonDistutilsBuildSystem(BuildSystem): ] self.strip_commands = [_STRIP_COMMAND] - def used_by_project(self, file_list): - indicators = [ - 'setup.py', - ] - - return any(x in file_list for x in indicators) - class ExtUtilsMakeMakerBuildSystem(BuildSystem): @@ -228,12 +190,6 @@ class ExtUtilsMakeMakerBuildSystem(BuildSystem): ] self.strip_commands = [_STRIP_COMMAND] - def used_by_project(self, file_list): - indicators = [ - 'Makefile.PL', - ] - - return any(x in file_list for x in indicators) class ModuleBuildBuildSystem(BuildSystem): @@ -265,13 +221,6 @@ class ModuleBuildBuildSystem(BuildSystem): './Build install' ] - def used_by_project(self, file_list): - indicators = [ - 'Build.PL' - ] - - return any(x in file_list for x in indicators) - class CMakeBuildSystem(BuildSystem): @@ -294,12 +243,6 @@ class CMakeBuildSystem(BuildSystem): ] self.strip_commands = [_STRIP_COMMAND] - def used_by_project(self, file_list): - indicators = [ - 'CMakeLists.txt', - ] - - return any(x in file_list for x in indicators) class QMakeBuildSystem(BuildSystem): @@ -322,14 +265,6 @@ class QMakeBuildSystem(BuildSystem): ] self.strip_commands = [_STRIP_COMMAND] - def used_by_project(self, file_list): - indicator = '.pro' - - for x in file_list: - if x.endswith(indicator): - return True - - return False build_systems = [ ManualBuildSystem(), @@ -343,19 +278,6 @@ build_systems = [ ] -def detect_build_system(file_list): - '''Automatically detect the build system, if possible. - - If the build system cannot be detected automatically, return None. - For ``exists`` see the ``BuildSystem.exists`` method. - - ''' - for bs in build_systems: - if bs.used_by_project(file_list): - return bs - return None - - def lookup_build_system(name): '''Return build system that corresponds to the name. -- cgit v1.2.1