mirror of
https://github.com/kiwix/kiwix-build.git
synced 2025-06-26 10:11:27 +00:00
Merge pull request #837 from kiwix/macos-workflow
Fix case in Apple CI/CD workflows
This commit is contained in:
12
.github/scripts/build_definition.py
vendored
12
.github/scripts/build_definition.py
vendored
@ -30,12 +30,12 @@ BUILD_DEF = """
|
||||
| macos | native_dyn | d | d | dB | B | | | macos-x86_64-dyn |
|
||||
| macos | native_static | | | BP | BP | | macos-x86_64 | |
|
||||
| macos | native_mixed | BP | BP | | | | macos-x86_64 | |
|
||||
| macos | iOS_arm64 | dB | dB | | | | | ios-arm64-dyn |
|
||||
| macos | iOSSimulator_x86_64| dB | dB | | | | | ios-x86_64-dyn |
|
||||
| macos | iOSSimulator_arm64 | B | B | | | | | |
|
||||
| macos | macOS_arm64_static | | | BP | BP | | macos-arm64 | |
|
||||
| macos | macOS_arm64_mixed | dBP | dBP | d | | | macos-arm64 | macos-aarch64-dyn |
|
||||
| macos | macOS_x86_64 | B | B | | | | | |
|
||||
| macos | ios_arm64 | dB | dB | | | | | ios-arm64-dyn |
|
||||
| macos | iossimulator_x86_64| dB | dB | | | | | ios-x86_64-dyn |
|
||||
| macos | iossimulator_arm64 | B | B | | | | | |
|
||||
| macos | macos_arm64_static | | | BP | BP | | macos-arm64 | |
|
||||
| macos | macos_arm64_mixed | dBP | dBP | d | | | macos-arm64 | macos-aarch64-dyn |
|
||||
| macos | macos_x86_64 | B | B | | | | | |
|
||||
| macos | apple_all_static | | BP | | | | xcframework | |
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
| jammy | flatpak | | | | | BP | | |
|
||||
|
6
.github/workflows/cd.yml
vendored
6
.github/workflows/cd.yml
vendored
@ -222,7 +222,7 @@ jobs:
|
||||
if: failure()
|
||||
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
|
||||
|
||||
Macos:
|
||||
macOS:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -230,8 +230,8 @@ jobs:
|
||||
- native_dyn
|
||||
- native_static
|
||||
- native_mixed
|
||||
- macOS_arm64_static
|
||||
- macOS_arm64_mixed
|
||||
- macos_arm64_static
|
||||
- macos_arm64_mixed
|
||||
- apple_all_static
|
||||
runs-on: macos-14
|
||||
env:
|
||||
|
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@ -211,7 +211,7 @@ jobs:
|
||||
if: failure()
|
||||
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
|
||||
|
||||
Macos:
|
||||
macOS:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -219,12 +219,12 @@ jobs:
|
||||
- native_dyn
|
||||
- native_static
|
||||
- native_mixed
|
||||
- iOS_arm64
|
||||
- iOSSimulator_x86_64
|
||||
- iOSSimulator_arm64
|
||||
- macOS_arm64_static
|
||||
- macOS_arm64_mixed
|
||||
- macOS_x86_64
|
||||
- ios_arm64
|
||||
- iossimulator_x86_64
|
||||
- iossimulator_arm64
|
||||
- macos_arm64_static
|
||||
- macos_arm64_mixed
|
||||
- macos_x86_64
|
||||
- apple_all_static
|
||||
runs-on: macos-14
|
||||
env:
|
||||
|
@ -135,13 +135,13 @@ To do so, you should directly use the target-platfrom `ios_multi`.
|
||||
As for `android`, `kiwix-build` will build the library several times
|
||||
(once for each platform) and then create the fat library.
|
||||
```bash
|
||||
kiwix-build --config iOS_multi libkiwix
|
||||
kiwix-build --config ios_multi libkiwix
|
||||
```
|
||||
|
||||
You can specify the supported architectures with the option `--ios-arch`:
|
||||
```bash
|
||||
kiwix-build --config iOS_multi libkiwix # all architetures
|
||||
kiwix-build --config iOS_multi --ios-arch arm --ios-arch arm64 # arm and arm64 arch only
|
||||
kiwix-build --config ios_multi libkiwix # all architetures
|
||||
kiwix-build --config ios_multi --ios-arch arm --ios-arch arm64 # arm and arm64 arch only
|
||||
```
|
||||
|
||||
Outputs
|
||||
|
@ -10,7 +10,7 @@ MIN_MACOS_VERSION = "12.0"
|
||||
|
||||
|
||||
class AppleConfigInfo(ConfigInfo):
|
||||
build = "iOS"
|
||||
build = "ios"
|
||||
static = True
|
||||
compatible_hosts = ["Darwin"]
|
||||
arch = None
|
||||
@ -36,7 +36,7 @@ class AppleConfigInfo(ConfigInfo):
|
||||
return self._root_path
|
||||
|
||||
def __str__(self):
|
||||
return "iOS"
|
||||
return "ios"
|
||||
|
||||
def finalize_setup(self):
|
||||
super().finalize_setup()
|
||||
@ -153,7 +153,7 @@ class AppleConfigInfo(ConfigInfo):
|
||||
|
||||
|
||||
class iOSArm64(AppleConfigInfo):
|
||||
name = "iOS_arm64"
|
||||
name = "ios_arm64"
|
||||
arch = cpu = "arm64"
|
||||
host = "arm-apple-darwin"
|
||||
target = "aarch64-apple-ios"
|
||||
@ -162,7 +162,7 @@ class iOSArm64(AppleConfigInfo):
|
||||
|
||||
|
||||
class iOSx64Simulator(AppleConfigInfo):
|
||||
name = "iOSSimulator_x86_64"
|
||||
name = "iossimulator_x86_64"
|
||||
arch = cpu = "x86_64"
|
||||
host = "x86_64-apple-darwin"
|
||||
target = "x86-apple-ios-simulator"
|
||||
@ -171,7 +171,7 @@ class iOSx64Simulator(AppleConfigInfo):
|
||||
|
||||
|
||||
class iOSArm64Simulator(AppleConfigInfo):
|
||||
name = "iOSSimulator_arm64"
|
||||
name = "iossimulator_arm64"
|
||||
arch = cpu = "arm64"
|
||||
host = "arm-apple-darwin"
|
||||
target = "aarch64-apple-ios-simulator"
|
||||
@ -180,7 +180,7 @@ class iOSArm64Simulator(AppleConfigInfo):
|
||||
|
||||
|
||||
class macOSArm64(AppleConfigInfo):
|
||||
name = "macOS_arm64_static"
|
||||
name = "macos_arm64_static"
|
||||
arch = cpu = "arm64"
|
||||
host = "aarch64-apple-darwin"
|
||||
target = "arm64-apple-macos"
|
||||
@ -189,8 +189,8 @@ class macOSArm64(AppleConfigInfo):
|
||||
min_macos_version = MIN_MACOS_VERSION
|
||||
|
||||
|
||||
class macOSArm64Mixed(MixedMixin("macOS_arm64_static"), AppleConfigInfo):
|
||||
name = "macOS_arm64_mixed"
|
||||
class macOSArm64Mixed(MixedMixin("macos_arm64_static"), AppleConfigInfo):
|
||||
name = "macos_arm64_mixed"
|
||||
arch = cpu = "arm64"
|
||||
host = "aarch64-apple-darwin"
|
||||
target = "arm64-apple-macos"
|
||||
@ -200,7 +200,7 @@ class macOSArm64Mixed(MixedMixin("macOS_arm64_static"), AppleConfigInfo):
|
||||
|
||||
|
||||
class macOSx64(AppleConfigInfo):
|
||||
name = "macOS_x86_64"
|
||||
name = "macos_x86_64"
|
||||
arch = cpu = "x86_64"
|
||||
host = "x86_64-apple-darwin"
|
||||
target = "x86_64-apple-macos"
|
||||
@ -210,7 +210,7 @@ class macOSx64(AppleConfigInfo):
|
||||
|
||||
|
||||
class IOS(MetaConfigInfo):
|
||||
name = "iOS_multi"
|
||||
name = "ios_multi"
|
||||
compatible_hosts = ["Darwin"]
|
||||
|
||||
@property
|
||||
@ -219,7 +219,7 @@ class IOS(MetaConfigInfo):
|
||||
|
||||
@property
|
||||
def subConfigNames(self):
|
||||
return ["iOS_{}".format(arch) for arch in option("ios_arch")]
|
||||
return ["ios_{}".format(arch) for arch in option("ios_arch")]
|
||||
|
||||
def add_targets(self, targetName, targets):
|
||||
super().add_targets(targetName, targets)
|
||||
|
@ -48,7 +48,7 @@ class AllBaseDependencies(Dependency):
|
||||
"zim-testing-suite",
|
||||
]
|
||||
# Add specific dependencies depending of the config
|
||||
if configInfo.build not in ("android", "iOS"):
|
||||
if configInfo.build not in ("android", "ios"):
|
||||
# For zimtools
|
||||
base_deps += ["docoptcpp", "libmagic", "gumbo"]
|
||||
if (
|
||||
|
@ -10,11 +10,11 @@ from .base import Dependency, NoopSource, Builder as BaseBuilder
|
||||
class AppleXCFramework(Dependency):
|
||||
name = "apple_xcframework"
|
||||
subConfigNames = [
|
||||
"macOS_x86_64",
|
||||
"macOS_arm64_static",
|
||||
"iOS_arm64",
|
||||
"iOSSimulator_x86_64",
|
||||
"iOSSimulator_arm64",
|
||||
"macos_x86_64",
|
||||
"macos_arm64_static",
|
||||
"ios_arm64",
|
||||
"iossimulator_x86_64",
|
||||
"iossimulator_arm64",
|
||||
]
|
||||
Source = NoopSource
|
||||
|
||||
@ -26,7 +26,7 @@ class AppleXCFramework(Dependency):
|
||||
@property
|
||||
def macos_subconfigs(self):
|
||||
return [
|
||||
target for target in self.all_subconfigs if target.startswith("macOS")
|
||||
target for target in self.all_subconfigs if target.startswith("macos")
|
||||
]
|
||||
|
||||
@property
|
||||
@ -34,13 +34,13 @@ class AppleXCFramework(Dependency):
|
||||
return [
|
||||
target
|
||||
for target in self.all_subconfigs
|
||||
if target.startswith("iOSSimulator")
|
||||
if target.startswith("iossimulator")
|
||||
]
|
||||
|
||||
@property
|
||||
def ios_subconfigs(self):
|
||||
return [
|
||||
target for target in self.all_subconfigs if target.startswith("iOS_")
|
||||
target for target in self.all_subconfigs if target.startswith("ios_")
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@ -115,12 +115,12 @@ class AppleXCFramework(Dependency):
|
||||
"make_macos_fat",
|
||||
self.make_fat_with,
|
||||
self.macos_subconfigs,
|
||||
"macOS_fat",
|
||||
"macos_fat",
|
||||
)
|
||||
xcf_libs += self.command(
|
||||
"make_simulator_fat",
|
||||
self.make_fat_with,
|
||||
self.iossimulator_subconfigs,
|
||||
"iOS-simulator_fat",
|
||||
"ios-simulator_fat",
|
||||
)
|
||||
self.command("build_xcframework", self._build_xcframework, xcf_libs)
|
||||
|
@ -392,7 +392,7 @@ class MakeBuilder(Builder):
|
||||
|
||||
@property
|
||||
def make_install_targets(self):
|
||||
if self.buildEnv.configInfo.build in ("iOS", "wasm"):
|
||||
if self.buildEnv.configInfo.build in ("ios", "wasm"):
|
||||
yield "install"
|
||||
else:
|
||||
yield "install-strip"
|
||||
|
@ -15,10 +15,10 @@ class IOSFatLib(Dependency):
|
||||
@classmethod
|
||||
def get_dependencies(self, platfomInfo, alldeps):
|
||||
base_target = option("target")
|
||||
return [("iOS_{}".format(arch), base_target) for arch in option("ios_arch")]
|
||||
return [("ios_{}".format(arch), base_target) for arch in option("ios_arch")]
|
||||
|
||||
def _copy_headers(self, context):
|
||||
plt = ConfigInfo.get_config("iOS_{}".format(option("ios_arch")[0]))
|
||||
plt = ConfigInfo.get_config("ios_{}".format(option("ios_arch")[0]))
|
||||
include_src = pj(plt.buildEnv.install_dir, "include")
|
||||
include_dst = pj(self.buildEnv.install_dir, "include")
|
||||
copy_tree(include_src, include_dst)
|
||||
@ -26,7 +26,7 @@ class IOSFatLib(Dependency):
|
||||
def _merge_libs(self, context):
|
||||
lib_dirs = []
|
||||
for arch in option("ios_arch"):
|
||||
plt = ConfigInfo.get_config("iOS_{}".format(arch))
|
||||
plt = ConfigInfo.get_config("ios_{}".format(arch))
|
||||
lib_dirs.append(pj(plt.buildEnv.install_dir, "lib"))
|
||||
libs = []
|
||||
for f in os.listdir(lib_dirs[0]):
|
||||
|
@ -38,7 +38,7 @@ class Libkiwix(Dependency):
|
||||
if configInfo.build == "android":
|
||||
yield "-Dstatic-linkage=true"
|
||||
yield "-Dwerror=false"
|
||||
if configInfo.build == "iOS":
|
||||
if configInfo.build == "ios":
|
||||
yield "-Db_bitcode=true"
|
||||
if configInfo.name == "flatpak":
|
||||
yield "--wrap-mode=nodownload"
|
||||
|
@ -115,7 +115,7 @@ PACKAGE_NAME_MAPPERS = {
|
||||
"COMMON": ["autoconf", "automake", "libtool", "cmake", "pkg-config"],
|
||||
"file": ["libmagic"],
|
||||
},
|
||||
"Darwin_iOS": {
|
||||
"Darwin_ios": {
|
||||
"COMMON": ["autoconf", "automake", "libtool", "cmake", "pkg-config"],
|
||||
"file": ["libmagic"],
|
||||
},
|
||||
|
Reference in New Issue
Block a user