Move all toolchain installation in TOOLCHAIN directory.
This is a clearer install and it simplify the base_deps archive creation.
This commit is contained in:
parent
11d829bfff
commit
0f60549215
|
@ -27,6 +27,7 @@ HOME = Path(os.path.expanduser("~"))
|
||||||
BASE_DIR = HOME / "BUILD_{}".format(PLATFORM_TARGET)
|
BASE_DIR = HOME / "BUILD_{}".format(PLATFORM_TARGET)
|
||||||
SOURCE_DIR = HOME / "SOURCE"
|
SOURCE_DIR = HOME / "SOURCE"
|
||||||
ARCHIVE_DIR = HOME / "ARCHIVE"
|
ARCHIVE_DIR = HOME / "ARCHIVE"
|
||||||
|
TOOLCHAIN_DIR = HOME / "TOOLCHAINS"
|
||||||
INSTALL_DIR = BASE_DIR / "INSTALL"
|
INSTALL_DIR = BASE_DIR / "INSTALL"
|
||||||
TMP_DIR = Path("/tmp")
|
TMP_DIR = Path("/tmp")
|
||||||
KBUILD_SOURCE_DIR = HOME / "kiwix-build"
|
KBUILD_SOURCE_DIR = HOME / "kiwix-build"
|
||||||
|
@ -278,13 +279,8 @@ def make_deps_archive(target=None, name=None, full=False):
|
||||||
base_dir = HOME / "BUILD_{}".format(PLATFORM_TARGET)
|
base_dir = HOME / "BUILD_{}".format(PLATFORM_TARGET)
|
||||||
if (base_dir / "meson_cross_file.txt").exists():
|
if (base_dir / "meson_cross_file.txt").exists():
|
||||||
files_to_archive.append(base_dir / "meson_cross_file.txt")
|
files_to_archive.append(base_dir / "meson_cross_file.txt")
|
||||||
# Add ndk/sdk/toolchains to allow project's CI to find them and compile
|
# Copy any toolchain
|
||||||
files_to_archive += HOME.glob("BUILD_*/android-ndk*")
|
files_to_archive += [TOOLCHAIN_DIR]
|
||||||
files_to_archive += HOME.glob("BUILD_*/emsdk*")
|
|
||||||
if PLATFORM_TARGET.startswith("aarch64"):
|
|
||||||
files_to_archive += SOURCE_DIR.glob("aarch64*/*")
|
|
||||||
if PLATFORM_TARGET.startswith("armv"):
|
|
||||||
files_to_archive += SOURCE_DIR.glob("armv*/*")
|
|
||||||
if (BASE_DIR / "meson_cross_file.txt").exists():
|
if (BASE_DIR / "meson_cross_file.txt").exists():
|
||||||
files_to_archive.append(BASE_DIR / "meson_cross_file.txt")
|
files_to_archive.append(BASE_DIR / "meson_cross_file.txt")
|
||||||
|
|
||||||
|
@ -307,11 +303,6 @@ def make_deps_archive(target=None, name=None, full=False):
|
||||||
files_to_archive += SOURCE_DIR.glob("*/.*_ok")
|
files_to_archive += SOURCE_DIR.glob("*/.*_ok")
|
||||||
files_to_archive += SOURCE_DIR.glob("zim-testing-suite-*/*")
|
files_to_archive += SOURCE_DIR.glob("zim-testing-suite-*/*")
|
||||||
|
|
||||||
toolchains_subdirs = HOME.glob("BUILD_*/TOOLCHAINS/*/*")
|
|
||||||
for subdir in toolchains_subdirs:
|
|
||||||
if not subdir.match("tools"):
|
|
||||||
files_to_archive.append(subdir)
|
|
||||||
|
|
||||||
archive_file = TMP_DIR / archive_name
|
archive_file = TMP_DIR / archive_name
|
||||||
with tarfile.open(str(archive_file), "w:xz") as tar:
|
with tarfile.open(str(archive_file), "w:xz") as tar:
|
||||||
for name in set(files_to_archive):
|
for name in set(files_to_archive):
|
||||||
|
|
|
@ -3,7 +3,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from kiwixbuild.utils import pj, Context, SkipCommand, WarningMessage, extract_archive, Defaultdict, StopBuild, run_command, colorize
|
from kiwixbuild.utils import pj, Context, SkipCommand, WarningMessage, extract_archive, Defaultdict, StopBuild, run_command, colorize, copy_tree
|
||||||
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, option, get_target_step
|
from kiwixbuild._global import neutralEnv, option, get_target_step
|
||||||
|
|
||||||
|
@ -323,6 +323,28 @@ class NoopBuilder(Builder):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class TcCopyBuilder(Builder):
|
||||||
|
src_subdir = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def build_path(self):
|
||||||
|
return pj(self.buildEnv.toolchain_dir, self.target.full_name())
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
self.command('copy', self._copy)
|
||||||
|
|
||||||
|
def _copy(self, context):
|
||||||
|
context.try_skip(self.build_path)
|
||||||
|
if self.src_subdir:
|
||||||
|
source_path = pj(self.source_path, self.src_subdir)
|
||||||
|
else:
|
||||||
|
source_path = self.source_path
|
||||||
|
copy_tree(source_path, self.build_path)
|
||||||
|
|
||||||
|
def make_dist(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class MakeBuilder(Builder):
|
class MakeBuilder(Builder):
|
||||||
configure_option_template = "{dep_options} {static_option} {env_option} --prefix {install_dir} --libdir {libdir}"
|
configure_option_template = "{dep_options} {static_option} {env_option} --prefix {install_dir} --libdir {libdir}"
|
||||||
configure_option = ""
|
configure_option = ""
|
||||||
|
|
|
@ -25,7 +25,7 @@ class android_ndk(Dependency):
|
||||||
class Builder(Builder):
|
class Builder(Builder):
|
||||||
@property
|
@property
|
||||||
def install_path(self):
|
def install_path(self):
|
||||||
return self.build_path
|
return pj(self.buildEnv.toolchain_dir, self.target.full_name())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def api(self):
|
def api(self):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from .base import Dependency, ReleaseDownload, NoopBuilder
|
from .base import Dependency, ReleaseDownload, TcCopyBuilder
|
||||||
from kiwixbuild.utils import Remotefile
|
from kiwixbuild.utils import Remotefile
|
||||||
|
|
||||||
# The arm toolchains
|
# The arm toolchains
|
||||||
|
@ -19,7 +19,9 @@ class armv6_toolchain(Dependency):
|
||||||
'4c371c4c5b55ebd1f3d7dd26b14703632d9ba47423f901bcd9303d83ad444434',
|
'4c371c4c5b55ebd1f3d7dd26b14703632d9ba47423f901bcd9303d83ad444434',
|
||||||
base_url + 'x-tools-armv6-rpi-linux-gnueabihf.tar.xz')
|
base_url + 'x-tools-armv6-rpi-linux-gnueabihf.tar.xz')
|
||||||
|
|
||||||
Builder = NoopBuilder
|
|
||||||
|
class Builder(TcCopyBuilder):
|
||||||
|
src_subdir = "armv6-rpi-linux-gnueabihf"
|
||||||
|
|
||||||
|
|
||||||
class armv8_toolchain(Dependency):
|
class armv8_toolchain(Dependency):
|
||||||
|
@ -32,7 +34,8 @@ class armv8_toolchain(Dependency):
|
||||||
'cc28f5c3f6a3e7d9985f98779c4e72224b4eb5a7e4dc2bcdefd90cb241fb94a5',
|
'cc28f5c3f6a3e7d9985f98779c4e72224b4eb5a7e4dc2bcdefd90cb241fb94a5',
|
||||||
base_url + 'x-tools-armv8-rpi3-linux-gnueabihf.tar.xz')
|
base_url + 'x-tools-armv8-rpi3-linux-gnueabihf.tar.xz')
|
||||||
|
|
||||||
Builder = NoopBuilder
|
class Builder(TcCopyBuilder):
|
||||||
|
src_subdir = "armv8-rpi3-linux-gnueabihf"
|
||||||
|
|
||||||
class aarch64_toolchain(Dependency):
|
class aarch64_toolchain(Dependency):
|
||||||
dont_skip = True
|
dont_skip = True
|
||||||
|
@ -44,4 +47,4 @@ class aarch64_toolchain(Dependency):
|
||||||
'1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320',
|
'1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320',
|
||||||
aarch_base_url + 'cross-gcc-6.3.0-pi_64.tar.gz')
|
aarch_base_url + 'cross-gcc-6.3.0-pi_64.tar.gz')
|
||||||
|
|
||||||
Builder = NoopBuilder
|
Builder = TcCopyBuilder
|
||||||
|
|
|
@ -23,21 +23,21 @@ class emsdk(Dependency):
|
||||||
class Builder(Builder):
|
class Builder(Builder):
|
||||||
@property
|
@property
|
||||||
def install_path(self):
|
def install_path(self):
|
||||||
return self.build_path
|
return pj(self.buildEnv.toolchain_dir, self.target.full_name())
|
||||||
|
|
||||||
def _copy_source(self, context):
|
def _copy_source(self, context):
|
||||||
context.try_skip(self.build_path)
|
context.try_skip(self.build_path)
|
||||||
copy_tree(self.source_path, self.build_path)
|
copy_tree(self.source_path, self.install_path)
|
||||||
|
|
||||||
def _install(self, context):
|
def _install(self, context):
|
||||||
context.try_skip(self.build_path)
|
context.try_skip(self.build_path)
|
||||||
command = "./emsdk install 3.1.24"
|
command = "./emsdk install 3.1.24"
|
||||||
run_command(command, self.build_path, context)
|
run_command(command, self.install_path, context)
|
||||||
|
|
||||||
def _activate(self, context):
|
def _activate(self, context):
|
||||||
context.try_skip(self.build_path)
|
context.try_skip(self.build_path)
|
||||||
command = "./emsdk activate 3.1.24"
|
command = "./emsdk activate 3.1.24"
|
||||||
run_command(command, self.build_path, context)
|
run_command(command, self.install_path, context)
|
||||||
|
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from .base import Dependency, ReleaseDownload, NoopBuilder
|
from .base import Dependency, ReleaseDownload, TcCopyBuilder
|
||||||
from kiwixbuild.utils import Remotefile
|
from kiwixbuild.utils import Remotefile
|
||||||
|
|
||||||
class aarch64_musl_toolchain(Dependency):
|
class aarch64_musl_toolchain(Dependency):
|
||||||
|
@ -11,7 +11,7 @@ class aarch64_musl_toolchain(Dependency):
|
||||||
'0f18a885b161815520bbb5757a4b4ab40d0898c29bebee58d0cddd6112e59cc6',
|
'0f18a885b161815520bbb5757a4b4ab40d0898c29bebee58d0cddd6112e59cc6',
|
||||||
'https://more.musl.cc/10/x86_64-linux-musl/aarch64-linux-musl-cross.tgz')
|
'https://more.musl.cc/10/x86_64-linux-musl/aarch64-linux-musl-cross.tgz')
|
||||||
|
|
||||||
Builder = NoopBuilder
|
Builder = TcCopyBuilder
|
||||||
|
|
||||||
|
|
||||||
class x86_64_musl_toolchain(Dependency):
|
class x86_64_musl_toolchain(Dependency):
|
||||||
|
@ -24,4 +24,4 @@ class x86_64_musl_toolchain(Dependency):
|
||||||
'a3d55de8105739fcfb8b10eaa72cdb5d779319726bacff24149388d7608d1ed8',
|
'a3d55de8105739fcfb8b10eaa72cdb5d779319726bacff24149388d7608d1ed8',
|
||||||
'https://more.musl.cc/10/x86_64-linux-musl/x86_64-linux-musl-cross.tgz')
|
'https://more.musl.cc/10/x86_64-linux-musl/x86_64-linux-musl-cross.tgz')
|
||||||
|
|
||||||
Builder = NoopBuilder
|
Builder = TcCopyBuilder
|
||||||
|
|
|
@ -30,12 +30,12 @@ class ArmPlatformInfo(PlatformInfo):
|
||||||
return "lib/{}".format(self.arch_full)
|
return "lib/{}".format(self.arch_full)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tlc_source(self):
|
def toolchain(self):
|
||||||
return get_target_step(self.build, 'source')
|
return get_target_step(self.build, 'neutral')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def root_path(self):
|
def root_path(self):
|
||||||
return pj(self.tlc_source.source_path, self.arch_full)
|
return pj(self.toolchain.build_path, self.arch_full)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def binaries(self):
|
def binaries(self):
|
||||||
|
@ -150,7 +150,7 @@ class Aarch64(ArmPlatformInfo):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def root_path(self):
|
def root_path(self):
|
||||||
return self.tlc_source.source_path
|
return self.toolchain.build_path
|
||||||
|
|
||||||
class Aarch64Dyn(Aarch64):
|
class Aarch64Dyn(Aarch64):
|
||||||
name = 'aarch64_dyn'
|
name = 'aarch64_dyn'
|
||||||
|
|
|
@ -25,12 +25,12 @@ class MuslPlatformInfo(PlatformInfo):
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tlc_source(self):
|
def toolchain(self):
|
||||||
return get_target_step(self.build, 'source')
|
return get_target_step(self.build, 'neutral')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def root_path(self):
|
def root_path(self):
|
||||||
return self.tlc_source.source_path
|
return self.toolchain.build_path
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def binaries(self):
|
def binaries(self):
|
||||||
|
|
|
@ -39,7 +39,7 @@ release_versions = {
|
||||||
|
|
||||||
# This is the "version" of the whole base_deps_versions dict.
|
# This is the "version" of the whole base_deps_versions dict.
|
||||||
# Change this when you change base_deps_versions.
|
# Change this when you change base_deps_versions.
|
||||||
base_deps_meta_version = '92'
|
base_deps_meta_version = '92_dev'
|
||||||
|
|
||||||
base_deps_versions = {
|
base_deps_versions = {
|
||||||
'zlib' : '1.2.12',
|
'zlib' : '1.2.12',
|
||||||
|
|
Loading…
Reference in New Issue