Make the neutralEnv global.
No need to pass the neutralEnv from instance to instance.
This commit is contained in:
parent
f44042f910
commit
816e06a512
|
@ -7,6 +7,7 @@ from .dependencies import Dependency
|
||||||
from .platforms import PlatformInfo
|
from .platforms import PlatformInfo
|
||||||
from .builder import Builder
|
from .builder import Builder
|
||||||
from .utils import setup_print_progress
|
from .utils import setup_print_progress
|
||||||
|
from . import _global
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -65,6 +66,8 @@ def main():
|
||||||
options = parse_args()
|
options = parse_args()
|
||||||
options.working_dir = os.path.abspath(options.working_dir)
|
options.working_dir = os.path.abspath(options.working_dir)
|
||||||
setup_print_progress(options.show_progress)
|
setup_print_progress(options.show_progress)
|
||||||
|
neutralEnv = buildenv.PlatformNeutralEnv(options)
|
||||||
|
_global.set_neutralEnv(neutralEnv)
|
||||||
builder = Builder(options)
|
builder = Builder(options)
|
||||||
builder.run()
|
builder.run()
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
_neutralEnv = None
|
||||||
|
|
||||||
|
def set_neutralEnv(env):
|
||||||
|
global _neutralEnv
|
||||||
|
_neutralEnv = env
|
||||||
|
|
||||||
|
def neutralEnv(what):
|
||||||
|
return getattr(_neutralEnv, what)
|
|
@ -6,10 +6,8 @@ import platform
|
||||||
from .platforms import PlatformInfo
|
from .platforms import PlatformInfo
|
||||||
from .toolchains import Toolchain
|
from .toolchains import Toolchain
|
||||||
from .packages import PACKAGE_NAME_MAPPERS
|
from .packages import PACKAGE_NAME_MAPPERS
|
||||||
from .utils import (
|
from .utils import pj, download_remote, Defaultdict
|
||||||
pj,
|
from . import _global
|
||||||
download_remote,
|
|
||||||
Defaultdict)
|
|
||||||
|
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
@ -115,9 +113,8 @@ class PlatformNeutralEnv:
|
||||||
|
|
||||||
|
|
||||||
class BuildEnv:
|
class BuildEnv:
|
||||||
def __init__(self, options, neutralEnv, targetsDict):
|
def __init__(self, options, targetsDict):
|
||||||
build_dir = "BUILD_{}".format(options.target_platform)
|
build_dir = "BUILD_{}".format(options.target_platform)
|
||||||
self.neutralEnv = neutralEnv
|
|
||||||
self.build_dir = pj(options.working_dir, build_dir)
|
self.build_dir = pj(options.working_dir, build_dir)
|
||||||
self.install_dir = pj(self.build_dir, "INSTALL")
|
self.install_dir = pj(self.build_dir, "INSTALL")
|
||||||
for d in (self.build_dir,
|
for d in (self.build_dir,
|
||||||
|
@ -156,7 +153,7 @@ class BuildEnv:
|
||||||
ToolchainClass = Toolchain.all_toolchains[toolchain_name]
|
ToolchainClass = Toolchain.all_toolchains[toolchain_name]
|
||||||
if ToolchainClass.neutral:
|
if ToolchainClass.neutral:
|
||||||
self.toolchains.append(
|
self.toolchains.append(
|
||||||
self.neutralEnv.add_toolchain(toolchain_name)
|
_global._neutralEnv.add_toolchain(toolchain_name)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.toolchains.append(ToolchainClass(self))
|
self.toolchains.append(ToolchainClass(self))
|
||||||
|
@ -202,7 +199,7 @@ class BuildEnv:
|
||||||
self.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
|
self.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self.neutralEnv, name)
|
return _global.neutralEnv(name)
|
||||||
|
|
||||||
def _is_debianlike(self):
|
def _is_debianlike(self):
|
||||||
return os.path.isfile('/etc/debian_version')
|
return os.path.isfile('/etc/debian_version')
|
||||||
|
|
|
@ -10,8 +10,7 @@ class Builder:
|
||||||
def __init__(self, options):
|
def __init__(self, options):
|
||||||
self.options = options
|
self.options = options
|
||||||
self.targets = OrderedDict()
|
self.targets = OrderedDict()
|
||||||
self.neutralEnv = PlatformNeutralEnv(options)
|
self.buildEnv = BuildEnv(options, self.targets)
|
||||||
self.buildEnv = BuildEnv(options, self.neutralEnv, self.targets)
|
|
||||||
|
|
||||||
_targets = {}
|
_targets = {}
|
||||||
targetDef = options.targets
|
targetDef = options.targets
|
||||||
|
@ -31,7 +30,7 @@ class Builder:
|
||||||
if targetName in targets:
|
if targetName in targets:
|
||||||
return
|
return
|
||||||
targetClass = Dependency.all_deps[targetName]
|
targetClass = Dependency.all_deps[targetName]
|
||||||
target = targetClass(self.neutralEnv, self.buildEnv)
|
target = targetClass(self.buildEnv)
|
||||||
targets[targetName] = target
|
targets[targetName] = target
|
||||||
for dep in target.dependencies:
|
for dep in target.dependencies:
|
||||||
self.add_targets(dep, targets)
|
self.add_targets(dep, targets)
|
||||||
|
|
|
@ -3,6 +3,8 @@ from .base import (
|
||||||
NoopSource,
|
NoopSource,
|
||||||
NoopBuilder)
|
NoopBuilder)
|
||||||
|
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
class AllBaseDependencies(Dependency):
|
class AllBaseDependencies(Dependency):
|
||||||
name = "alldependencies"
|
name = "alldependencies"
|
||||||
|
|
||||||
|
@ -16,7 +18,7 @@ class AllBaseDependencies(Dependency):
|
||||||
else:
|
else:
|
||||||
base_deps += ["icu4c", "libmagic"]
|
base_deps += ["icu4c", "libmagic"]
|
||||||
if ( self.buildEnv.platform_info.build != 'android'
|
if ( self.buildEnv.platform_info.build != 'android'
|
||||||
and self.buildEnv.distname != 'Darwin'):
|
and neutralEnv('distname') != 'Darwin'):
|
||||||
base_deps += ['ctpp2c', 'ctpp2']
|
base_deps += ['ctpp2c', 'ctpp2']
|
||||||
if self.buildEnv.platform_info.build == 'android':
|
if self.buildEnv.platform_info.build == 'android':
|
||||||
base_deps += ['Gradle']
|
base_deps += ['Gradle']
|
||||||
|
|
|
@ -4,6 +4,7 @@ import shutil
|
||||||
|
|
||||||
from kiwixbuild.utils import pj, Context, SkipCommand, extract_archive, Defaultdict, StopBuild
|
from kiwixbuild.utils import pj, Context, SkipCommand, extract_archive, Defaultdict, StopBuild
|
||||||
from kiwixbuild.versions import main_project_versions, base_deps_versions
|
from kiwixbuild.versions import main_project_versions, base_deps_versions
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
SCRIPT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||||
|
|
||||||
|
@ -22,8 +23,7 @@ class Dependency(metaclass=_MetaDependency):
|
||||||
dependencies = []
|
dependencies = []
|
||||||
force_native_build = False
|
force_native_build = False
|
||||||
|
|
||||||
def __init__(self, neutralEnv, buildEnv):
|
def __init__(self, buildEnv):
|
||||||
self.neutralEnv = neutralEnv
|
|
||||||
self.buildEnv = buildEnv
|
self.buildEnv = buildEnv
|
||||||
self.source = self.Source(self)
|
self.source = self.Source(self)
|
||||||
self.builder = self.Builder(self)
|
self.builder = self.Builder(self)
|
||||||
|
@ -41,7 +41,7 @@ class Dependency(metaclass=_MetaDependency):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_path(self):
|
def source_path(self):
|
||||||
return pj(self.neutralEnv.source_dir, self.source.source_dir)
|
return pj(neutralEnv('source_dir'), self.source.source_dir)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _log_dir(self):
|
def _log_dir(self):
|
||||||
|
@ -77,7 +77,6 @@ class Source:
|
||||||
inside the neutralEnv.source_dir."""
|
inside the neutralEnv.source_dir."""
|
||||||
def __init__(self, target):
|
def __init__(self, target):
|
||||||
self.target = target
|
self.target = target
|
||||||
self.neutralEnv = target.neutralEnv
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -88,12 +87,12 @@ class Source:
|
||||||
return self.target.full_name
|
return self.target.full_name
|
||||||
|
|
||||||
def _patch(self, context):
|
def _patch(self, context):
|
||||||
source_path = pj(self.neutralEnv.source_dir, self.source_dir)
|
source_path = pj(neutralEnv('source_dir'), self.source_dir)
|
||||||
context.try_skip(source_path)
|
context.try_skip(source_path)
|
||||||
context.force_native_build = True
|
context.force_native_build = True
|
||||||
for p in self.patches:
|
for p in self.patches:
|
||||||
with open(pj(SCRIPT_DIR, 'patches', p), 'r') as patch_input:
|
with open(pj(SCRIPT_DIR, 'patches', p), 'r') as patch_input:
|
||||||
self.neutralEnv.run_command("patch -p1", source_path, context, input=patch_input.read())
|
neutralEnv('run_command')("patch -p1", source_path, context, input=patch_input.read())
|
||||||
|
|
||||||
def command(self, *args, **kwargs):
|
def command(self, *args, **kwargs):
|
||||||
return self.target.command(*args, **kwargs)
|
return self.target.command(*args, **kwargs)
|
||||||
|
@ -109,18 +108,18 @@ class ReleaseDownload(Source):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extract_path(self):
|
def extract_path(self):
|
||||||
return pj(self.neutralEnv.source_dir, self.source_dir)
|
return pj(neutralEnv('source_dir'), self.source_dir)
|
||||||
|
|
||||||
def _download(self, context):
|
def _download(self, context):
|
||||||
context.try_skip(self.neutralEnv.archive_dir, self.name)
|
context.try_skip(neutralEnv('archive_dir'), self.name)
|
||||||
self.neutralEnv.download(self.archive)
|
neutralEnv('download')(self.archive)
|
||||||
|
|
||||||
def _extract(self, context):
|
def _extract(self, context):
|
||||||
context.try_skip(self.extract_path)
|
context.try_skip(self.extract_path)
|
||||||
if os.path.exists(self.extract_path):
|
if os.path.exists(self.extract_path):
|
||||||
shutil.rmtree(self.extract_path)
|
shutil.rmtree(self.extract_path)
|
||||||
extract_archive(pj(self.neutralEnv.archive_dir, self.archive.name),
|
extract_archive(pj(neutralEnv('archive_dir'), self.archive.name),
|
||||||
self.neutralEnv.source_dir,
|
neutralEnv('source_dir'),
|
||||||
topdir=self.archive_top_dir,
|
topdir=self.archive_top_dir,
|
||||||
name=self.source_dir)
|
name=self.source_dir)
|
||||||
|
|
||||||
|
@ -142,18 +141,18 @@ class GitClone(Source):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_dir(self):
|
def source_dir(self):
|
||||||
if self.neutralEnv.make_release:
|
if neutralEnv('make_release'):
|
||||||
return "{}_release".format(self.git_dir)
|
return "{}_release".format(self.git_dir)
|
||||||
else:
|
else:
|
||||||
return self.git_dir
|
return self.git_dir
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def git_path(self):
|
def git_path(self):
|
||||||
return pj(self.neutralEnv.source_dir, self.source_dir)
|
return pj(neutralEnv('source_dir'), self.source_dir)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def git_ref(self):
|
def git_ref(self):
|
||||||
if self.neutralEnv.make_release:
|
if neutralEnv('make_release'):
|
||||||
return self.release_git_ref
|
return self.release_git_ref
|
||||||
else:
|
else:
|
||||||
return self.base_git_ref
|
return self.base_git_ref
|
||||||
|
@ -163,13 +162,13 @@ class GitClone(Source):
|
||||||
raise SkipCommand()
|
raise SkipCommand()
|
||||||
command = "git clone --depth=1 --branch {} {} {}".format(
|
command = "git clone --depth=1 --branch {} {} {}".format(
|
||||||
self.git_ref, self.git_remote, self.source_dir)
|
self.git_ref, self.git_remote, self.source_dir)
|
||||||
self.neutralEnv.run_command(command, self.neutralEnv.source_dir, context)
|
neutralEnv('run_command')(command, neutralEnv('source_dir'), context)
|
||||||
|
|
||||||
def _git_update(self, context):
|
def _git_update(self, context):
|
||||||
command = "git fetch origin {}".format(
|
command = "git fetch origin {}".format(
|
||||||
self.git_ref)
|
self.git_ref)
|
||||||
self.neutralEnv.run_command(command, self.git_path, context)
|
neutralEnv('run_command')(command, self.git_path, context)
|
||||||
self.neutralEnv.run_command("git checkout "+self.git_ref, self.git_path, context)
|
neutralEnv('run_command')("git checkout "+self.git_ref, self.git_path, context)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
self.command('gitclone', self._git_clone)
|
self.command('gitclone', self._git_clone)
|
||||||
|
@ -185,17 +184,17 @@ class SvnClone(Source):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def svn_path(self):
|
def svn_path(self):
|
||||||
return pj(self.neutralEnv.source_dir, self.svn_dir)
|
return pj(neutralEnv('source_dir'), self.svn_dir)
|
||||||
|
|
||||||
def _svn_checkout(self, context):
|
def _svn_checkout(self, context):
|
||||||
if os.path.exists(self.svn_path):
|
if os.path.exists(self.svn_path):
|
||||||
raise SkipCommand()
|
raise SkipCommand()
|
||||||
command = "svn checkout {} {}".format(self.svn_remote, self.svn_dir)
|
command = "svn checkout {} {}".format(self.svn_remote, self.svn_dir)
|
||||||
self.neutralEnv.run_command(command, self.neutralEnv.source_dir, context)
|
neutralEnv('run_command')(command, neutralEnv('source_dir'), context)
|
||||||
|
|
||||||
def _svn_update(self, context):
|
def _svn_update(self, context):
|
||||||
context.try_skip(self.svn_path)
|
context.try_skip(self.svn_path)
|
||||||
self.neutralEnv.run_command("svn update", self.svn_path, context)
|
neutralEnv('run_command')("svn update", self.svn_path, context)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
self.command('svncheckout', self._svn_checkout)
|
self.command('svncheckout', self._svn_checkout)
|
||||||
|
@ -355,12 +354,6 @@ class MesonBuilder(Builder):
|
||||||
configure_option = ""
|
configure_option = ""
|
||||||
test_option = ""
|
test_option = ""
|
||||||
|
|
||||||
def __init__(self, target):
|
|
||||||
super().__init__(target)
|
|
||||||
self.meson_command = self.buildEnv.neutralEnv.meson_command
|
|
||||||
self.mesontest_command = self.buildEnv.neutralEnv.mesontest_command
|
|
||||||
self.ninja_command = self.buildEnv.neutralEnv.ninja_command
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def library_type(self):
|
def library_type(self):
|
||||||
return 'static' if self.buildEnv.platform_info.static else 'shared'
|
return 'static' if self.buildEnv.platform_info.static else 'shared'
|
||||||
|
@ -382,7 +375,7 @@ class MesonBuilder(Builder):
|
||||||
" --libdir={buildEnv.libprefix}"
|
" --libdir={buildEnv.libprefix}"
|
||||||
" {cross_option}")
|
" {cross_option}")
|
||||||
command = command.format(
|
command = command.format(
|
||||||
command=self.meson_command,
|
command=neutralEnv('meson_command'),
|
||||||
library_type=self.library_type,
|
library_type=self.library_type,
|
||||||
configure_option=configure_option,
|
configure_option=configure_option,
|
||||||
build_path=self.build_path,
|
build_path=self.build_path,
|
||||||
|
@ -392,7 +385,7 @@ class MesonBuilder(Builder):
|
||||||
self.buildEnv.run_command(command, self.source_path, context, cross_env_only=True)
|
self.buildEnv.run_command(command, self.source_path, context, cross_env_only=True)
|
||||||
|
|
||||||
def _compile(self, context):
|
def _compile(self, context):
|
||||||
command = "{} -v".format(self.ninja_command)
|
command = "{} -v".format(neutralEnv('ninja_command'))
|
||||||
self.buildEnv.run_command(command, self.build_path, context)
|
self.buildEnv.run_command(command, self.build_path, context)
|
||||||
|
|
||||||
def _test(self, context):
|
def _test(self, context):
|
||||||
|
@ -401,15 +394,15 @@ class MesonBuilder(Builder):
|
||||||
and not self.buildEnv.platform_info.static)
|
and not self.buildEnv.platform_info.static)
|
||||||
):
|
):
|
||||||
raise SkipCommand()
|
raise SkipCommand()
|
||||||
command = "{} --verbose {}".format(self.mesontest_command, self.test_option)
|
command = "{} --verbose {}".format(neutralEnv('mesontest_command'), self.test_option)
|
||||||
self.buildEnv.run_command(command, self.build_path, context)
|
self.buildEnv.run_command(command, self.build_path, context)
|
||||||
|
|
||||||
def _install(self, context):
|
def _install(self, context):
|
||||||
command = "{} -v install".format(self.ninja_command)
|
command = "{} -v install".format(neutralEnv('ninja_command'))
|
||||||
self.buildEnv.run_command(command, self.build_path, context)
|
self.buildEnv.run_command(command, self.build_path, context)
|
||||||
|
|
||||||
def _make_dist(self, context):
|
def _make_dist(self, context):
|
||||||
command = "{} -v dist".format(self.ninja_command)
|
command = "{} -v dist".format(neutralEnv('ninja_command'))
|
||||||
self.buildEnv.run_command(command, self.build_path, context)
|
self.buildEnv.run_command(command, self.build_path, context)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ from .base import (
|
||||||
Dependency,
|
Dependency,
|
||||||
GitClone,
|
GitClone,
|
||||||
MesonBuilder)
|
MesonBuilder)
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
class Kiwixlib(Dependency):
|
class Kiwixlib(Dependency):
|
||||||
name = "kiwix-lib"
|
name = "kiwix-lib"
|
||||||
|
@ -10,7 +11,7 @@ class Kiwixlib(Dependency):
|
||||||
def dependencies(self):
|
def dependencies(self):
|
||||||
base_dependencies = ["pugixml", "libzim", "zlib", "lzma", "libaria2"]
|
base_dependencies = ["pugixml", "libzim", "zlib", "lzma", "libaria2"]
|
||||||
if ( self.buildEnv.platform_info.build != 'android'
|
if ( self.buildEnv.platform_info.build != 'android'
|
||||||
and self.buildEnv.distname != 'Darwin'):
|
and neutralEnv('distname') != 'Darwin'):
|
||||||
base_dependencies += ['ctpp2c', 'ctpp2']
|
base_dependencies += ['ctpp2c', 'ctpp2']
|
||||||
if self.buildEnv.platform_info.build != 'native':
|
if self.buildEnv.platform_info.build != 'native':
|
||||||
return base_dependencies + ["icu4c_cross-compile"]
|
return base_dependencies + ["icu4c_cross-compile"]
|
||||||
|
|
|
@ -5,6 +5,7 @@ from .base import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from kiwixbuild.utils import Remotefile
|
from kiwixbuild.utils import Remotefile
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
class Aria2(Dependency):
|
class Aria2(Dependency):
|
||||||
name = "libaria2"
|
name = "libaria2"
|
||||||
|
@ -20,7 +21,7 @@ class Aria2(Dependency):
|
||||||
def _post_prepare_script(self, context):
|
def _post_prepare_script(self, context):
|
||||||
context.try_skip(self.extract_path)
|
context.try_skip(self.extract_path)
|
||||||
command = "autoreconf -i"
|
command = "autoreconf -i"
|
||||||
self.neutralEnv.run_command(command, self.extract_path, context)
|
neutralEnv('run_command')(command, self.extract_path, context)
|
||||||
|
|
||||||
class Builder(MakeBuilder):
|
class Builder(MakeBuilder):
|
||||||
configure_option = "--enable-libaria2 --disable-ssl --disable-bittorent --disable-metalink --without-sqlite3 --without-libxml2 --without-libexpat"
|
configure_option = "--enable-libaria2 --disable-ssl --disable-bittorent --disable-metalink --without-sqlite3 --without-libxml2 --without-libexpat"
|
||||||
|
|
|
@ -5,6 +5,7 @@ from .base import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from kiwixbuild.utils import Remotefile
|
from kiwixbuild.utils import Remotefile
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
|
|
||||||
class Xapian(Dependency):
|
class Xapian(Dependency):
|
||||||
|
@ -23,6 +24,6 @@ class Xapian(Dependency):
|
||||||
def dependencies(self):
|
def dependencies(self):
|
||||||
deps = ['zlib', 'lzma']
|
deps = ['zlib', 'lzma']
|
||||||
if (self.buildEnv.platform_info.build == 'win32'
|
if (self.buildEnv.platform_info.build == 'win32'
|
||||||
or self.buildEnv.distname == 'Darwin'):
|
or neutralEnv('distname') == 'Darwin'):
|
||||||
return deps
|
return deps
|
||||||
return deps + ['uuid']
|
return deps + ['uuid']
|
||||||
|
|
|
@ -4,6 +4,7 @@ import subprocess
|
||||||
pj = os.path.join
|
pj = os.path.join
|
||||||
|
|
||||||
from kiwixbuild.utils import Context, SkipCommand, StopBuild
|
from kiwixbuild.utils import Context, SkipCommand, StopBuild
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
class _MetaToolchain(type):
|
class _MetaToolchain(type):
|
||||||
def __new__(cls, name, bases, dct):
|
def __new__(cls, name, bases, dct):
|
||||||
|
@ -22,9 +23,7 @@ class Toolchain(metaclass=_MetaToolchain):
|
||||||
Builder = None
|
Builder = None
|
||||||
Source = None
|
Source = None
|
||||||
|
|
||||||
def __init__(self, neutralEnv):
|
def __init__(self):
|
||||||
self.neutralEnv = neutralEnv
|
|
||||||
self.buildEnv = neutralEnv
|
|
||||||
self.source = self.Source(self) if self.Source else None
|
self.source = self.Source(self) if self.Source else None
|
||||||
self.builder = self.Builder(self) if self.Builder else None
|
self.builder = self.Builder(self) if self.Builder else None
|
||||||
|
|
||||||
|
@ -36,11 +35,11 @@ class Toolchain(metaclass=_MetaToolchain):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_path(self):
|
def source_path(self):
|
||||||
return pj(self.neutralEnv.source_dir, self.source.source_dir)
|
return pj(neutralEnv('source_dir'), self.source.source_dir)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _log_dir(self):
|
def _log_dir(self):
|
||||||
return self.neutralEnv.log_dir
|
return neutralEnv('log_dir')
|
||||||
|
|
||||||
def set_env(self, env):
|
def set_env(self, env):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -3,6 +3,7 @@ import subprocess
|
||||||
|
|
||||||
from .base_toolchain import Toolchain
|
from .base_toolchain import Toolchain
|
||||||
from kiwixbuild.utils import which
|
from kiwixbuild.utils import which
|
||||||
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
pj = os.path.join
|
pj = os.path.join
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ class mingw32_toolchain(Toolchain):
|
||||||
'fedora': '/usr/i686-w64-mingw32/sys-root/mingw',
|
'fedora': '/usr/i686-w64-mingw32/sys-root/mingw',
|
||||||
'debian': '/usr/i686-w64-mingw32'
|
'debian': '/usr/i686-w64-mingw32'
|
||||||
}
|
}
|
||||||
return root_paths[self.neutralEnv.distname]
|
return root_paths[neutralEnv('distname')]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def binaries(self):
|
def binaries(self):
|
||||||
|
|
Loading…
Reference in New Issue