Make sure we use python3 (another patch from Fedora)
[jack2.git] / compat / wscript
blob25eb2a3f6c57e0697ef1883db42f9c5f4908439a
1 #!/usr/bin/python3
2 # encoding: utf-8
4 # Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 import os
22 def get_subdirs(ctx):
23     """
24     Get the compatibility module subirectories.
26     The compat modules are found dynamically so that this script does
27     not have to be modified if more modules are added.
29     :param ctx: the waf context
30     :type ctx: waflib.Context.Context
31     :returns: list of str -- the subdirectories
32     """
33     subdirs = []
34     for entry in ctx.path.listdir():
35         path = os.path.join(ctx.path.abspath(), entry)
36         if os.path.isdir(path) and not entry.startswith('.'):
37             subdirs.append(entry)
38     return subdirs
40 def recurse_into_subdirs(ctx):
41     """
42     Recurse into compatibility module subdirectories.
44     :param ctx: the waf context
45     :type ctx: waflib.Context.Context
46     """
47     for x in get_subdirs(ctx):
48         ctx.recurse(x)
50 def options(opt):
51     recurse_into_subdirs(opt)
53 def configure(conf):
54     recurse_into_subdirs(conf)
56 def build(bld):
57     recurse_into_subdirs(bld)