Merge dc806fee7e
into 1aa720a7fd
This commit is contained in:
commit
f600654a04
|
@ -42,10 +42,10 @@ class NeutralEnv:
|
||||||
def detect_platform(self):
|
def detect_platform(self):
|
||||||
_platform = platform.system()
|
_platform = platform.system()
|
||||||
self.distname = _platform
|
self.distname = _platform
|
||||||
|
self.codename = ""
|
||||||
if _platform == "Linux":
|
if _platform == "Linux":
|
||||||
self.distname = distro.id()
|
self.distname = distro.id()
|
||||||
if self.distname == "ubuntu":
|
self.codename = distro.codename()
|
||||||
self.distname = "debian"
|
|
||||||
|
|
||||||
def download(self, what, where=None):
|
def download(self, what, where=None):
|
||||||
where = where or self.archive_dir
|
where = where or self.archive_dir
|
||||||
|
|
|
@ -124,30 +124,33 @@ class Builder:
|
||||||
|
|
||||||
def _get_packages(self):
|
def _get_packages(self):
|
||||||
packages_list = []
|
packages_list = []
|
||||||
for config in ConfigInfo.all_running_configs.values():
|
for runningConfig in ConfigInfo.all_running_configs.values():
|
||||||
mapper_name = "{host}_{config}".format(
|
for mapper_name in self._get_mapper_names_for_config(runningConfig):
|
||||||
host=neutralEnv("distname"), config=config
|
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
|
||||||
)
|
packages_list += package_name_mapper.get("COMMON", [])
|
||||||
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
|
|
||||||
packages_list += package_name_mapper.get("COMMON", [])
|
|
||||||
|
|
||||||
to_drop = []
|
to_drop = []
|
||||||
for builderDef in self._targets:
|
for builderDef in self._targets:
|
||||||
configName, builderName = builderDef
|
builderConfig, builderName = builderDef
|
||||||
mapper_name = "{host}_{config}".format(
|
|
||||||
host=neutralEnv("distname"), config=configName
|
for mapper_name in self._get_mapper_names_for_config(builderConfig):
|
||||||
)
|
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
|
||||||
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
|
packages = package_name_mapper.get(builderName)
|
||||||
packages = package_name_mapper.get(builderName)
|
if packages:
|
||||||
if packages:
|
to_drop.append(builderDef)
|
||||||
to_drop.append(builderDef)
|
if packages is not True:
|
||||||
if packages is not True:
|
# True means "assume the dependency is install but do not try to install anything for it"
|
||||||
# True means "assume the dependency is install but do not try to install anything for it"
|
packages_list += packages
|
||||||
packages_list += packages
|
|
||||||
for dep in to_drop:
|
for dep in to_drop:
|
||||||
del self._targets[dep]
|
del self._targets[dep]
|
||||||
return packages_list
|
return packages_list
|
||||||
|
|
||||||
|
def _get_mapper_names_for_config(self, config):
|
||||||
|
host = neutralEnv("distname")
|
||||||
|
codename = neutralEnv("codename")
|
||||||
|
return ( f"{host}_{config}", f"{host}_{codename}_{config}" )
|
||||||
|
|
||||||
def install_packages(self):
|
def install_packages(self):
|
||||||
packages_to_have = self._get_packages()
|
packages_to_have = self._get_packages()
|
||||||
packages_to_have = remove_duplicates(packages_to_have)
|
packages_to_have = remove_duplicates(packages_to_have)
|
||||||
|
@ -160,7 +163,7 @@ class Builder:
|
||||||
if distname in ("fedora", "redhat", "centos"):
|
if distname in ("fedora", "redhat", "centos"):
|
||||||
package_installer = "sudo dnf install {}"
|
package_installer = "sudo dnf install {}"
|
||||||
package_checker = "rpm -q --quiet {}"
|
package_checker = "rpm -q --quiet {}"
|
||||||
elif distname in ("debian", "Ubuntu"):
|
elif distname in ("debian", "ubuntu"):
|
||||||
package_installer = "sudo apt-get install {}"
|
package_installer = "sudo apt-get install {}"
|
||||||
package_checker = 'LANG=C dpkg -s {} 2>&1 | grep Status | grep "ok installed" 1>/dev/null 2>&1'
|
package_checker = 'LANG=C dpkg -s {} 2>&1 | grep Status | grep "ok installed" 1>/dev/null 2>&1'
|
||||||
elif distname == "Darwin":
|
elif distname == "Darwin":
|
||||||
|
|
|
@ -7,7 +7,7 @@ class AndroidConfigInfo(ConfigInfo):
|
||||||
build = "android"
|
build = "android"
|
||||||
static = True
|
static = True
|
||||||
toolchain_names = ["android-ndk"]
|
toolchain_names = ["android-ndk"]
|
||||||
compatible_hosts = ["fedora", "debian"]
|
compatible_hosts = ["fedora", "debian", "ubuntu"]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "android"
|
return "android"
|
||||||
|
|
|
@ -6,7 +6,7 @@ from kiwixbuild._global import get_target_step
|
||||||
|
|
||||||
# Base config for arm
|
# Base config for arm
|
||||||
class ArmConfigInfo(ConfigInfo):
|
class ArmConfigInfo(ConfigInfo):
|
||||||
compatible_hosts = ["fedora", "debian", "almalinux"]
|
compatible_hosts = ["fedora", "debian", "ubuntu", "almalinux"]
|
||||||
|
|
||||||
def get_cross_config(self):
|
def get_cross_config(self):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -8,7 +8,7 @@ class FlatpakConfigInfo(ConfigInfo):
|
||||||
build = "flatpak"
|
build = "flatpak"
|
||||||
static = ""
|
static = ""
|
||||||
toolchain_names = ["org.kde", "io.qt.qtwebengine"]
|
toolchain_names = ["org.kde", "io.qt.qtwebengine"]
|
||||||
compatible_hosts = ["debian", "fedora"]
|
compatible_hosts = ["debian", "ubuntu", "fedora"]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "flatpak"
|
return "flatpak"
|
||||||
|
|
|
@ -7,7 +7,7 @@ from kiwixbuild.utils import which, pj
|
||||||
class I586ConfigInfo(ConfigInfo):
|
class I586ConfigInfo(ConfigInfo):
|
||||||
build = "i586"
|
build = "i586"
|
||||||
arch_full = "i586-linux-gnu"
|
arch_full = "i586-linux-gnu"
|
||||||
compatible_hosts = ["fedora", "debian"]
|
compatible_hosts = ["fedora", "debian", "ubuntu"]
|
||||||
|
|
||||||
def get_cross_config(self):
|
def get_cross_config(self):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -5,7 +5,7 @@ from kiwixbuild._global import get_target_step
|
||||||
|
|
||||||
|
|
||||||
class MuslConfigInfo(ConfigInfo):
|
class MuslConfigInfo(ConfigInfo):
|
||||||
compatible_hosts = ["fedora", "debian"]
|
compatible_hosts = ["fedora", "debian", "ubuntu"]
|
||||||
|
|
||||||
def get_cross_config(self):
|
def get_cross_config(self):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -29,16 +29,16 @@ class NativeConfigInfo(ConfigInfo):
|
||||||
class NativeDyn(NativeConfigInfo):
|
class NativeDyn(NativeConfigInfo):
|
||||||
name = "native_dyn"
|
name = "native_dyn"
|
||||||
static = False
|
static = False
|
||||||
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
|
compatible_hosts = ["fedora", "debian", "ubuntu", "Darwin", "almalinux", "Windows"]
|
||||||
|
|
||||||
|
|
||||||
class NativeStatic(NativeConfigInfo):
|
class NativeStatic(NativeConfigInfo):
|
||||||
name = "native_static"
|
name = "native_static"
|
||||||
static = True
|
static = True
|
||||||
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
|
compatible_hosts = ["fedora", "debian", "ubuntu", "Darwin", "almalinux", "Windows"]
|
||||||
|
|
||||||
|
|
||||||
class NativeMixed(MixedMixin("native_static"), NativeConfigInfo):
|
class NativeMixed(MixedMixin("native_static"), NativeConfigInfo):
|
||||||
name = "native_mixed"
|
name = "native_mixed"
|
||||||
static = False
|
static = False
|
||||||
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
|
compatible_hosts = ["fedora", "debian", "ubuntu", "Darwin", "almalinux", "Windows"]
|
||||||
|
|
|
@ -5,7 +5,7 @@ class NeutralConfigInfo(ConfigInfo):
|
||||||
name = "neutral"
|
name = "neutral"
|
||||||
arch_name = "neutral"
|
arch_name = "neutral"
|
||||||
static = ""
|
static = ""
|
||||||
compatible_hosts = ["fedora", "debian", "Darwin"]
|
compatible_hosts = ["fedora", "debian", "ubuntu", "Darwin"]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "neutral"
|
return "neutral"
|
||||||
|
|
|
@ -12,7 +12,7 @@ class WasmConfigInfo(ConfigInfo):
|
||||||
libdir = "lib"
|
libdir = "lib"
|
||||||
# arch_full = 'wasm64-linux'
|
# arch_full = 'wasm64-linux'
|
||||||
toolchain_names = ["emsdk"]
|
toolchain_names = ["emsdk"]
|
||||||
compatible_hosts = ["fedora", "debian"]
|
compatible_hosts = ["fedora", "debian", "ubuntu"]
|
||||||
exe_wrapper_def = ""
|
exe_wrapper_def = ""
|
||||||
|
|
||||||
def get_cross_config(self):
|
def get_cross_config(self):
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Win64ConfigInfo(ConfigInfo):
|
||||||
"-lkernel32",
|
"-lkernel32",
|
||||||
]
|
]
|
||||||
build = "win64"
|
build = "win64"
|
||||||
compatible_hosts = ["fedora", "debian"]
|
compatible_hosts = ["fedora", "debian", "ubuntu"]
|
||||||
arch_full = "x86_64-w64-mingw32"
|
arch_full = "x86_64-w64-mingw32"
|
||||||
|
|
||||||
def get_cross_config(self):
|
def get_cross_config(self):
|
||||||
|
|
|
@ -91,6 +91,36 @@ PACKAGE_NAME_MAPPERS = {
|
||||||
"debian_android": {
|
"debian_android": {
|
||||||
"COMMON": _debian_common,
|
"COMMON": _debian_common,
|
||||||
},
|
},
|
||||||
|
"ubuntu_jammy_native_dyn": {
|
||||||
|
"COMMON": _debian_common,
|
||||||
|
"zlib": ["zlib1g-dev"],
|
||||||
|
"uuid": ["uuid-dev"],
|
||||||
|
"libmicrohttpd": ["libmicrohttpd-dev", "ccache"],
|
||||||
|
"qt": ["qt6-base-dev", "qt6-base-dev-tools", "libqt6webenginecore6-bin", "libqt6svg6", "qtchooser"],
|
||||||
|
"qtwebengine": ["qt6-webengine-dev"],
|
||||||
|
"aria2": ["aria2"],
|
||||||
|
},
|
||||||
|
"ubuntu_noble_native_dyn": {
|
||||||
|
"COMMON": _debian_common,
|
||||||
|
"zlib": ["zlib1g-dev"],
|
||||||
|
"uuid": ["uuid-dev"],
|
||||||
|
"libmicrohttpd": ["libmicrohttpd-dev", "ccache"],
|
||||||
|
"qt": ["qt6-base-dev", "qt6-base-dev-tools", "libqt6webenginecore6-bin", "libqt6svg6", "qtchooser"],
|
||||||
|
"qtwebengine": ["qt6-webengine-dev"],
|
||||||
|
"aria2": ["aria2"],
|
||||||
|
},
|
||||||
|
"ubuntu_oracular_native_dyn": {
|
||||||
|
"COMMON": _debian_common,
|
||||||
|
"zlib": ["zlib1g-dev"],
|
||||||
|
"uuid": ["uuid-dev"],
|
||||||
|
"libmicrohttpd": ["libmicrohttpd-dev", "ccache"],
|
||||||
|
"qt": ["qt6-base-dev", "qt6-base-dev-tools", "libqt6webenginecore6-bin", "libqt6svg6", "qtchooser"],
|
||||||
|
"qtwebengine": ["qt6-webengine-dev"],
|
||||||
|
"aria2": ["aria2"],
|
||||||
|
},
|
||||||
|
"ubuntu_native_static": {
|
||||||
|
"COMMON": _debian_common + ["libbz2-dev", "libmagic-dev"],
|
||||||
|
},
|
||||||
"Darwin_native_dyn": {
|
"Darwin_native_dyn": {
|
||||||
"COMMON": ["autoconf", "automake", "libtool", "cmake", "pkg-config"],
|
"COMMON": ["autoconf", "automake", "libtool", "cmake", "pkg-config"],
|
||||||
"file": ["libmagic"],
|
"file": ["libmagic"],
|
||||||
|
|
Loading…
Reference in New Issue