commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (C) 2011 Igalia S.L. |
| 3 | # Copyright (C) 2012 Intel Corporation |
| 4 | # |
| 5 | # This library is free software; you can redistribute it and/or |
| 6 | # modify it under the terms of the GNU Lesser General Public |
| 7 | # License as published by the Free Software Foundation; either |
| 8 | # version 2 of the License, or (at your option) any later version. |
| 9 | # |
| 10 | # This library 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 GNU |
| 13 | # Lesser General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU Lesser General Public |
| 16 | # License along with this library; if not, write to the Free Software |
| 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | |
| 19 | import multiprocessing |
| 20 | import sys |
| 21 | import os |
ossy@webkit.org | 6e91f9b | 2015-11-20 11:38:10 +0000 | [diff] [blame] | 22 | import platform |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 23 | |
| 24 | |
| 25 | script_dir = None |
| 26 | |
| 27 | |
| 28 | def script_path(*args): |
| 29 | global script_dir |
| 30 | if not script_dir: |
| 31 | script_dir = os.path.join(os.path.dirname(__file__), '..', 'Scripts') |
| 32 | return os.path.join(*(script_dir,) + args) |
| 33 | |
| 34 | |
| 35 | def top_level_path(*args): |
| 36 | return os.path.join(*((os.path.join(os.path.dirname(__file__), '..', '..'),) + args)) |
| 37 | |
| 38 | |
ossy@webkit.org | 6e91f9b | 2015-11-20 11:38:10 +0000 | [diff] [blame] | 39 | def init(jhbuildrc_globals, jhbuild_platform): |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 40 | |
ossy@webkit.org | 6e91f9b | 2015-11-20 11:38:10 +0000 | [diff] [blame] | 41 | __tools_directory = os.path.join(os.path.dirname(__file__), "../", jhbuild_platform) |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 42 | sys.path.insert(0, __tools_directory) |
| 43 | |
| 44 | jhbuildrc_globals["build_policy"] = 'updated' |
| 45 | |
clopez@igalia.com | c307d3e | 2020-07-08 10:41:54 +0000 | [diff] [blame] | 46 | __moduleset_file_name = 'jhbuild.modules' |
| 47 | if 'WEBKIT_JHBUILD_MODULESET' in os.environ: |
| 48 | __moduleset_file_name = 'jhbuild-%s.modules' % os.environ['WEBKIT_JHBUILD_MODULESET'] |
| 49 | __moduleset_file_path = os.path.join(__tools_directory, __moduleset_file_name) |
| 50 | if not os.path.isfile(__moduleset_file_path): |
| 51 | raise RuntimeError("Can't find the moduleset in path %s" % __moduleset_file_path) |
| 52 | __moduleset_file_uri = 'file://' + __moduleset_file_path |
| 53 | |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 54 | __extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",") |
| 55 | jhbuildrc_globals["moduleset"] = [__moduleset_file_uri, ] |
| 56 | if __extra_modulesets != ['']: |
| 57 | jhbuildrc_globals["moduleset"].extend(__extra_modulesets) |
| 58 | |
| 59 | __extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",") |
clopez@igalia.com | c307d3e | 2020-07-08 10:41:54 +0000 | [diff] [blame] | 60 | |
| 61 | base_dependency_suffix = 'testing' |
| 62 | if 'WEBKIT_JHBUILD_MODULESET' in os.environ: |
| 63 | base_dependency_suffix = os.environ['WEBKIT_JHBUILD_MODULESET'] |
| 64 | |
| 65 | jhbuildrc_globals["modules"] = ['webkit' + jhbuild_platform + '-' + base_dependency_suffix + '-dependencies', ] |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 66 | if __extra_modules != ['']: |
| 67 | jhbuildrc_globals["modules"].extend(__extra_modules) |
| 68 | |
| 69 | if 'WEBKIT_OUTPUTDIR' in os.environ: |
ossy@webkit.org | 6e91f9b | 2015-11-20 11:38:10 +0000 | [diff] [blame] | 70 | jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies' + jhbuild_platform.upper(), 'Source')) |
| 71 | jhbuildrc_globals["prefix"] = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies' + jhbuild_platform.upper(), 'Root')) |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 72 | else: |
ossy@webkit.org | 6e91f9b | 2015-11-20 11:38:10 +0000 | [diff] [blame] | 73 | jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies' + jhbuild_platform.upper(), 'Source')) |
| 74 | jhbuildrc_globals["prefix"] = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies' + jhbuild_platform.upper(), 'Root')) |
commit-queue@webkit.org | 28fe840 | 2014-02-24 15:45:27 +0000 | [diff] [blame] | 75 | |
| 76 | jhbuildrc_globals["nonotify"] = True |
| 77 | jhbuildrc_globals["notrayicon"] = True |
mrobinson@webkit.org | bd8267b | 2014-03-11 15:09:12 +0000 | [diff] [blame] | 78 | |
| 79 | if 'NUMBER_OF_PROCESSORS' in os.environ: |
| 80 | jhbuildrc_globals['jobs'] = os.environ['NUMBER_OF_PROCESSORS'] |
| 81 | |
commit-queue@webkit.org | 7eeaafd | 2020-07-20 21:24:41 +0000 | [diff] [blame] | 82 | if os.environ.get("WEBKIT_JHBUILD_MODULESET") != "minimal": |
| 83 | # Avoid runtime conflicts with GStreamer system-wide plugins. We want |
| 84 | # to use only the plugins we build in JHBuild. |
| 85 | os.environ['GST_PLUGIN_SYSTEM_PATH'] = '' |
mrobinson@webkit.org | bd8267b | 2014-03-11 15:09:12 +0000 | [diff] [blame] | 86 | |
mrobinson@webkit.org | bd8267b | 2014-03-11 15:09:12 +0000 | [diff] [blame] | 87 | addpath = jhbuildrc_globals['addpath'] |
mrobinson@webkit.org | bd8267b | 2014-03-11 15:09:12 +0000 | [diff] [blame] | 88 | |
| 89 | prefix = jhbuildrc_globals['prefix'] |
| 90 | addpath('CMAKE_PREFIX_PATH', prefix) |
mcatanzaro@igalia.com | 4310500 | 2015-12-07 18:54:33 +0000 | [diff] [blame] | 91 | addpath('CMAKE_LIBRARY_PATH', os.path.join(prefix, 'lib')) |
commit-queue@webkit.org | 9c559a2 | 2014-03-21 14:44:10 +0000 | [diff] [blame] | 92 | |
| 93 | if 'JHBUILD_MIRROR' in os.environ: |
| 94 | jhbuildrc_globals['dvcs_mirror_dir'] = os.environ['JHBUILD_MIRROR'] |
| 95 | jhbuildrc_globals['tarballdir'] = os.environ['JHBUILD_MIRROR'] |
ossy@webkit.org | 6e91f9b | 2015-11-20 11:38:10 +0000 | [diff] [blame] | 96 | |
| 97 | if 'x86_64' in platform.machine(): |
| 98 | jhbuildrc_globals['conditions'].add('x86_64') |
calvaris@igalia.com | 3215a5c | 2020-07-10 14:57:57 +0000 | [diff] [blame] | 99 | |
| 100 | if 'JHBUILD_ENABLE_THUNDER' in os.environ: |
| 101 | jhbuild_enable_thunder = os.environ['JHBUILD_ENABLE_THUNDER'].lower() |
| 102 | if jhbuild_enable_thunder == 'yes' or jhbuild_enable_thunder == '1' or jhbuild_enable_thunder == 'true': |
| 103 | jhbuildrc_globals['conditions'].add('Thunder') |