diff options
author | Andrew Bartlett <abartlet@samba.org> | 2018-09-05 09:58:21 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-09-05 09:29:39 +0200 |
commit | 8de348e9d025d336a7985a9025fe08b7096c0394 (patch) | |
tree | 5e7134cfd5a62fdb72d1c5204b14d8d6c587da7b | |
parent | 8f022a0be81333fcaa7ac20147028eef73e2179e (diff) | |
download | samba-8de348e9d025d336a7985a9025fe08b7096c0394.tar.gz |
third_party: Import exact files from waf-2.0.8/waflib
wget https://waf.io/waf-2.0.8.tar.bz2
tar -xf waf-2.0.8.tar.bz2
rsync -a waf-2.0.8/waflib/ third_party/waf/waflib/
The previous import was damaged by auto-strip/correct of whitespace
and had other small corrections.
Check with git show -w.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 5 09:29:39 CEST 2018 on sn-devel-144
-rw-r--r-- | third_party/waf/waflib/Tools/python.py | 6 | ||||
-rw-r--r-- | third_party/waf/waflib/Tools/qt5.py | 4 | ||||
-rw-r--r-- | third_party/waf/waflib/extras/cabal.py | 304 | ||||
-rw-r--r-- | third_party/waf/waflib/extras/codelite.py | 20 | ||||
-rw-r--r-- | third_party/waf/waflib/extras/doxygen.py | 4 |
5 files changed, 169 insertions, 169 deletions
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py index 25841d03cf8..52a05c668e3 100644 --- a/third_party/waf/waflib/Tools/python.py +++ b/third_party/waf/waflib/Tools/python.py @@ -446,9 +446,9 @@ def check_python_version(conf, minver=None): Check if the python interpreter is found matching a given minimum version. minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver. - If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' (eg. '2.4') - of the actual python version found, and PYTHONDIR and PYTHONARCHDIR - are defined, pointing to the site-packages directories appropriate for + If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' + (eg. '2.4') of the actual python version found, and PYTHONDIR is + defined, pointing to the site-packages directory appropriate for this python version, where modules/packages/extensions should be installed. diff --git a/third_party/waf/waflib/Tools/qt5.py b/third_party/waf/waflib/Tools/qt5.py index 709dd5161e3..4f9c6908fc5 100644 --- a/third_party/waf/waflib/Tools/qt5.py +++ b/third_party/waf/waflib/Tools/qt5.py @@ -262,8 +262,8 @@ def create_uic_task(self, node): """ If UIC file is used in more than one bld, we would have a conflict in parallel execution - It is not possible to change the file names (like .self.idx. as for objects) as they have - to be referenced by the source file, but we can assume that the transformation will be identical + It is not possible to change the file names (like .self.idx. as for objects) as they have + to be referenced by the source file, but we can assume that the transformation will be identical and the tasks can be shared in a global cache. """ try: diff --git a/third_party/waf/waflib/extras/cabal.py b/third_party/waf/waflib/extras/cabal.py index a5acce77375..e10a0d1129e 100644 --- a/third_party/waf/waflib/extras/cabal.py +++ b/third_party/waf/waflib/extras/cabal.py @@ -1,152 +1,152 @@ -#!/usr/bin/env python -# encoding: utf-8 -# Anton Feldmann, 2012 -# "Base for cabal" - -from waflib import Task, Utils -from waflib.TaskGen import extension -from waflib.Utils import threading -from shutil import rmtree - -lock = threading.Lock() -registering = False - -def configure(self): - self.find_program('cabal', var='CABAL') - self.find_program('ghc-pkg', var='GHCPKG') - pkgconfd = self.bldnode.abspath() + '/package.conf.d' - self.env.PREFIX = self.bldnode.abspath() + '/dist' - self.env.PKGCONFD = pkgconfd - if self.root.find_node(pkgconfd + '/package.cache'): - self.msg('Using existing package database', pkgconfd, color='CYAN') - else: - pkgdir = self.root.find_dir(pkgconfd) - if pkgdir: - self.msg('Deleting corrupt package database', pkgdir.abspath(), color ='RED') - rmtree(pkgdir.abspath()) - pkgdir = None - - self.cmd_and_log(self.env.GHCPKG + ['init', pkgconfd]) - self.msg('Created package database', pkgconfd, color = 'YELLOW' if pkgdir else 'GREEN') - -@extension('.cabal') -def process_cabal(self, node): - out_dir_node = self.bld.root.find_dir(self.bld.out_dir) - package_node = node.change_ext('.package') - package_node = out_dir_node.find_or_declare(package_node.name) - build_node = node.parent.get_bld() - build_path = build_node.abspath() - config_node = build_node.find_or_declare('setup-config') - inplace_node = build_node.find_or_declare('package.conf.inplace') - - config_task = self.create_task('cabal_configure', node) - config_task.cwd = node.parent.abspath() - config_task.depends_on = getattr(self, 'depends_on', '') - config_task.build_path = build_path - config_task.set_outputs(config_node) - - build_task = self.create_task('cabal_build', config_node) - build_task.cwd = node.parent.abspath() - build_task.build_path = build_path - build_task.set_outputs(inplace_node) - - copy_task = self.create_task('cabal_copy', inplace_node) - copy_task.cwd = node.parent.abspath() - copy_task.depends_on = getattr(self, 'depends_on', '') - copy_task.build_path = build_path - - last_task = copy_task - task_list = [config_task, build_task, copy_task] - - if (getattr(self, 'register', False)): - register_task = self.create_task('cabal_register', inplace_node) - register_task.cwd = node.parent.abspath() - register_task.set_run_after(copy_task) - register_task.build_path = build_path - - pkgreg_task = self.create_task('ghcpkg_register', inplace_node) - pkgreg_task.cwd = node.parent.abspath() - pkgreg_task.set_run_after(register_task) - pkgreg_task.build_path = build_path - - last_task = pkgreg_task - task_list += [register_task, pkgreg_task] - - touch_task = self.create_task('cabal_touch', inplace_node) - touch_task.set_run_after(last_task) - touch_task.set_outputs(package_node) - touch_task.build_path = build_path - - task_list += [touch_task] - - return task_list - -def get_all_src_deps(node): - hs_deps = node.ant_glob('**/*.hs') - hsc_deps = node.ant_glob('**/*.hsc') - lhs_deps = node.ant_glob('**/*.lhs') - c_deps = node.ant_glob('**/*.c') - cpp_deps = node.ant_glob('**/*.cpp') - proto_deps = node.ant_glob('**/*.proto') - return sum([hs_deps, hsc_deps, lhs_deps, c_deps, cpp_deps, proto_deps], []) - -class Cabal(Task.Task): - def scan(self): - return (get_all_src_deps(self.generator.path), ()) - -class cabal_configure(Cabal): - run_str = '${CABAL} configure -v0 --prefix=${PREFIX} --global --user --package-db=${PKGCONFD} --builddir=${tsk.build_path}' - shell = True - - def scan(self): - out_node = self.generator.bld.root.find_dir(self.generator.bld.out_dir) - deps = [out_node.find_or_declare(dep).change_ext('.package') for dep in Utils.to_list(self.depends_on)] - return (deps, ()) - -class cabal_build(Cabal): - run_str = '${CABAL} build -v1 --builddir=${tsk.build_path}/' - shell = True - -class cabal_copy(Cabal): - run_str = '${CABAL} copy -v0 --builddir=${tsk.build_path}' - shell = True - -class cabal_register(Cabal): - run_str = '${CABAL} register -v0 --gen-pkg-config=${tsk.build_path}/pkg.config --builddir=${tsk.build_path}' - shell = True - -class ghcpkg_register(Cabal): - run_str = '${GHCPKG} update -v0 --global --user --package-conf=${PKGCONFD} ${tsk.build_path}/pkg.config' - shell = True - - def runnable_status(self): - global lock, registering - - val = False - lock.acquire() - val = registering - lock.release() - - if val: - return Task.ASK_LATER - - ret = Task.Task.runnable_status(self) - if ret == Task.RUN_ME: - lock.acquire() - registering = True - lock.release() - - return ret - - def post_run(self): - global lock, registering - - lock.acquire() - registering = False - lock.release() - - return Task.Task.post_run(self) - -class cabal_touch(Cabal): - run_str = 'touch ${TGT}' - +#!/usr/bin/env python
+# encoding: utf-8
+# Anton Feldmann, 2012
+# "Base for cabal"
+
+from waflib import Task, Utils
+from waflib.TaskGen import extension
+from waflib.Utils import threading
+from shutil import rmtree
+
+lock = threading.Lock()
+registering = False
+
+def configure(self):
+ self.find_program('cabal', var='CABAL')
+ self.find_program('ghc-pkg', var='GHCPKG')
+ pkgconfd = self.bldnode.abspath() + '/package.conf.d'
+ self.env.PREFIX = self.bldnode.abspath() + '/dist'
+ self.env.PKGCONFD = pkgconfd
+ if self.root.find_node(pkgconfd + '/package.cache'):
+ self.msg('Using existing package database', pkgconfd, color='CYAN')
+ else:
+ pkgdir = self.root.find_dir(pkgconfd)
+ if pkgdir:
+ self.msg('Deleting corrupt package database', pkgdir.abspath(), color ='RED')
+ rmtree(pkgdir.abspath())
+ pkgdir = None
+
+ self.cmd_and_log(self.env.GHCPKG + ['init', pkgconfd])
+ self.msg('Created package database', pkgconfd, color = 'YELLOW' if pkgdir else 'GREEN')
+
+@extension('.cabal')
+def process_cabal(self, node):
+ out_dir_node = self.bld.root.find_dir(self.bld.out_dir)
+ package_node = node.change_ext('.package')
+ package_node = out_dir_node.find_or_declare(package_node.name)
+ build_node = node.parent.get_bld()
+ build_path = build_node.abspath()
+ config_node = build_node.find_or_declare('setup-config')
+ inplace_node = build_node.find_or_declare('package.conf.inplace')
+
+ config_task = self.create_task('cabal_configure', node)
+ config_task.cwd = node.parent.abspath()
+ config_task.depends_on = getattr(self, 'depends_on', '')
+ config_task.build_path = build_path
+ config_task.set_outputs(config_node)
+
+ build_task = self.create_task('cabal_build', config_node)
+ build_task.cwd = node.parent.abspath()
+ build_task.build_path = build_path
+ build_task.set_outputs(inplace_node)
+
+ copy_task = self.create_task('cabal_copy', inplace_node)
+ copy_task.cwd = node.parent.abspath()
+ copy_task.depends_on = getattr(self, 'depends_on', '')
+ copy_task.build_path = build_path
+
+ last_task = copy_task
+ task_list = [config_task, build_task, copy_task]
+
+ if (getattr(self, 'register', False)):
+ register_task = self.create_task('cabal_register', inplace_node)
+ register_task.cwd = node.parent.abspath()
+ register_task.set_run_after(copy_task)
+ register_task.build_path = build_path
+
+ pkgreg_task = self.create_task('ghcpkg_register', inplace_node)
+ pkgreg_task.cwd = node.parent.abspath()
+ pkgreg_task.set_run_after(register_task)
+ pkgreg_task.build_path = build_path
+
+ last_task = pkgreg_task
+ task_list += [register_task, pkgreg_task]
+
+ touch_task = self.create_task('cabal_touch', inplace_node)
+ touch_task.set_run_after(last_task)
+ touch_task.set_outputs(package_node)
+ touch_task.build_path = build_path
+
+ task_list += [touch_task]
+
+ return task_list
+
+def get_all_src_deps(node):
+ hs_deps = node.ant_glob('**/*.hs')
+ hsc_deps = node.ant_glob('**/*.hsc')
+ lhs_deps = node.ant_glob('**/*.lhs')
+ c_deps = node.ant_glob('**/*.c')
+ cpp_deps = node.ant_glob('**/*.cpp')
+ proto_deps = node.ant_glob('**/*.proto')
+ return sum([hs_deps, hsc_deps, lhs_deps, c_deps, cpp_deps, proto_deps], [])
+
+class Cabal(Task.Task):
+ def scan(self):
+ return (get_all_src_deps(self.generator.path), ())
+
+class cabal_configure(Cabal):
+ run_str = '${CABAL} configure -v0 --prefix=${PREFIX} --global --user --package-db=${PKGCONFD} --builddir=${tsk.build_path}'
+ shell = True
+
+ def scan(self):
+ out_node = self.generator.bld.root.find_dir(self.generator.bld.out_dir)
+ deps = [out_node.find_or_declare(dep).change_ext('.package') for dep in Utils.to_list(self.depends_on)]
+ return (deps, ())
+
+class cabal_build(Cabal):
+ run_str = '${CABAL} build -v1 --builddir=${tsk.build_path}/'
+ shell = True
+
+class cabal_copy(Cabal):
+ run_str = '${CABAL} copy -v0 --builddir=${tsk.build_path}'
+ shell = True
+
+class cabal_register(Cabal):
+ run_str = '${CABAL} register -v0 --gen-pkg-config=${tsk.build_path}/pkg.config --builddir=${tsk.build_path}'
+ shell = True
+
+class ghcpkg_register(Cabal):
+ run_str = '${GHCPKG} update -v0 --global --user --package-conf=${PKGCONFD} ${tsk.build_path}/pkg.config'
+ shell = True
+
+ def runnable_status(self):
+ global lock, registering
+
+ val = False
+ lock.acquire()
+ val = registering
+ lock.release()
+
+ if val:
+ return Task.ASK_LATER
+
+ ret = Task.Task.runnable_status(self)
+ if ret == Task.RUN_ME:
+ lock.acquire()
+ registering = True
+ lock.release()
+
+ return ret
+
+ def post_run(self):
+ global lock, registering
+
+ lock.acquire()
+ registering = False
+ lock.release()
+
+ return Task.Task.post_run(self)
+
+class cabal_touch(Cabal):
+ run_str = 'touch ${TGT}'
+
diff --git a/third_party/waf/waflib/extras/codelite.py b/third_party/waf/waflib/extras/codelite.py index fd04a91d94b..523302c05cf 100644 --- a/third_party/waf/waflib/extras/codelite.py +++ b/third_party/waf/waflib/extras/codelite.py @@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE. """ """ - + To add this tool to your project: def options(conf): @@ -93,19 +93,19 @@ PROJECT_TEMPLATE = r'''<?xml version="1.0" encoding="utf-8"?> <Description/> <Dependencies/> <VirtualDirectory Name="src"> - ${for x in project.source} + ${for x in project.source} ${if (project.get_key(x)=="sourcefile")} <File Name="${x.abspath()}"/> ${endif} ${endfor} </VirtualDirectory> - <VirtualDirectory Name="include"> + <VirtualDirectory Name="include"> ${for x in project.source} ${if (project.get_key(x)=="headerfile")} <File Name="${x.abspath()}"/> ${endif} ${endfor} - </VirtualDirectory> + </VirtualDirectory> <Settings Type="Dynamic Library"> <GlobalSettings> <Compiler Options="" C_Options=""> @@ -141,7 +141,7 @@ PROJECT_TEMPLATE = r'''<?xml version="1.0" encoding="utf-8"?> <CleanCommand>${xml:project.get_clean_command(project.build_properties[0])}</CleanCommand> <BuildCommand>${xml:project.get_build_command(project.build_properties[0])}</BuildCommand> <Target Name="Install">${xml:project.get_install_command(project.build_properties[0])}</Target> - <Target Name="Build and Install">${xml:project.get_build_and_install_command(project.build_properties[0])}</Target> + <Target Name="Build and Install">${xml:project.get_build_and_install_command(project.build_properties[0])}</Target> <Target Name="Build All">${xml:project.get_build_all_command(project.build_properties[0])}</Target> <Target Name="Rebuild All">${xml:project.get_rebuild_all_command(project.build_properties[0])}</Target> <Target Name="Clean All">${xml:project.get_clean_all_command(project.build_properties[0])}</Target> @@ -171,9 +171,9 @@ PROJECT_TEMPLATE = r'''<?xml version="1.0" encoding="utf-8"?> <General OutputFile="" IntermediateDirectory="./Release" Command="" CommandArguments="" UseSeparateReleaseArgs="no" ReleaseArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> <![CDATA[ - - - + + + ]]> </Environment> <Releaseger IsRemote="no" RemoteHostName="" RemoteHostPort="" ReleasegerPath=""> @@ -216,9 +216,9 @@ ${endfor} <BuildMatrix> <WorkspaceConfiguration Name="Release" Selected="yes"> ${for p in project.all_projects} - <Project Name="${p.name}" ConfigName="Release"/> + <Project Name="${p.name}" ConfigName="Release"/> ${endfor} - </WorkspaceConfiguration> + </WorkspaceConfiguration> </BuildMatrix> </CodeLite_Workspace>''' diff --git a/third_party/waf/waflib/extras/doxygen.py b/third_party/waf/waflib/extras/doxygen.py index 28f56e9c7d7..3eae22fe179 100644 --- a/third_party/waf/waflib/extras/doxygen.py +++ b/third_party/waf/waflib/extras/doxygen.py @@ -190,13 +190,13 @@ class tar(Task.Task): @feature('doxygen') def process_doxy(self): if not getattr(self, 'doxyfile', None): - self.bld.fatal('no doxyfile variable specified??') + self.generator.bld.fatal('no doxyfile??') node = self.doxyfile if not isinstance(node, Node.Node): node = self.path.find_resource(node) if not node: - self.bld.fatal('doxygen file %s not found' % self.doxyfile) + raise ValueError('doxygen file not found') # the task instance dsk = self.create_task('doxygen', node) |