commit
eeb22c1cb4
|
@ -27,7 +27,6 @@ BUILD_DEF = """
|
||||||
| macos | native_mixed | BP | BP | | | | macos-x86_64 |
|
| macos | native_mixed | BP | BP | | | | macos-x86_64 |
|
||||||
| macos | iOS_arm64 | dB | B | | | | |
|
| macos | iOS_arm64 | dB | B | | | | |
|
||||||
| macos | iOS_x86_64 | dB | B | | | | |
|
| macos | iOS_x86_64 | dB | B | | | | |
|
||||||
| macos | iOS_Mac_ABI | B | B | | | | |
|
|
||||||
| macos | macOS_arm64_static | | | | | | |
|
| macos | macOS_arm64_static | | | | | | |
|
||||||
| macos | macOS_arm64_mixed | BP | BP | | | | macos-arm64 |
|
| macos | macOS_arm64_mixed | BP | BP | | | | macos-arm64 |
|
||||||
| macos | macOS_x86_64 | B | B | | | | |
|
| macos | macOS_x86_64 | B | B | | | | |
|
||||||
|
|
|
@ -148,15 +148,17 @@ jobs:
|
||||||
- native_mixed
|
- native_mixed
|
||||||
- iOS_arm64
|
- iOS_arm64
|
||||||
- iOS_x86_64
|
- iOS_x86_64
|
||||||
- iOS_Mac_ABI
|
|
||||||
- macOS_arm64_static
|
- macOS_arm64_static
|
||||||
- macOS_arm64_mixed
|
- macOS_arm64_mixed
|
||||||
- macOS_x86_64
|
- macOS_x86_64
|
||||||
runs-on: macos-11
|
runs-on: macos-13
|
||||||
env:
|
env:
|
||||||
SSH_KEY: /tmp/id_rsa
|
SSH_KEY: /tmp/id_rsa
|
||||||
OS_NAME: macos
|
OS_NAME: macos
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set Xcode version (15.0.1)
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
|
||||||
|
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Setup python 3.8
|
- name: Setup python 3.8
|
||||||
|
|
|
@ -138,7 +138,7 @@ jobs:
|
||||||
- native_mixed
|
- native_mixed
|
||||||
- macOS_arm64_static
|
- macOS_arm64_static
|
||||||
- macOS_arm64_mixed
|
- macOS_arm64_mixed
|
||||||
runs-on: macos-11
|
runs-on: macos-13
|
||||||
env:
|
env:
|
||||||
SSH_KEY: /tmp/id_rsa
|
SSH_KEY: /tmp/id_rsa
|
||||||
OS_NAME: macos
|
OS_NAME: macos
|
||||||
|
@ -148,6 +148,9 @@ jobs:
|
||||||
KEYCHAIN_PASSWORD: mysecretpassword
|
KEYCHAIN_PASSWORD: mysecretpassword
|
||||||
KEYCHAIN_PROFILE: build-profile
|
KEYCHAIN_PROFILE: build-profile
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set Xcode version (15.0.1)
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
|
||||||
|
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Setup python 3.8
|
- name: Setup python 3.8
|
||||||
|
|
|
@ -24,8 +24,6 @@ class Libkiwix(Dependency):
|
||||||
platformInfo = self.buildEnv.platformInfo
|
platformInfo = self.buildEnv.platformInfo
|
||||||
if platformInfo.build == 'android':
|
if platformInfo.build == 'android':
|
||||||
return '-Dstatic-linkage=true -Dwerror=false'
|
return '-Dstatic-linkage=true -Dwerror=false'
|
||||||
if platformInfo.build == 'iOS':
|
|
||||||
return '-Db_bitcode=true'
|
|
||||||
if platformInfo.name == 'flatpak':
|
if platformInfo.name == 'flatpak':
|
||||||
return '--wrap-mode=nodownload'
|
return '--wrap-mode=nodownload'
|
||||||
if platformInfo.mixed and option('target') == 'libkiwix':
|
if platformInfo.mixed and option('target') == 'libkiwix':
|
||||||
|
|
|
@ -30,8 +30,6 @@ class Libzim(Dependency):
|
||||||
if platformInfo.build == 'android':
|
if platformInfo.build == 'android':
|
||||||
config_options.append("-DUSE_BUFFER_HEADER=false")
|
config_options.append("-DUSE_BUFFER_HEADER=false")
|
||||||
config_options.append("-Dstatic-linkage=true")
|
config_options.append("-Dstatic-linkage=true")
|
||||||
if platformInfo.build == 'iOS':
|
|
||||||
config_options.append("-Db_bitcode=true")
|
|
||||||
if platformInfo.mixed and option('target') == 'libzim':
|
if platformInfo.mixed and option('target') == 'libzim':
|
||||||
config_options.append("-Dstatic-linkage=true")
|
config_options.append("-Dstatic-linkage=true")
|
||||||
if platformInfo.name == "flatpak":
|
if platformInfo.name == "flatpak":
|
||||||
|
|
|
@ -5,6 +5,8 @@ from kiwixbuild.utils import pj, xrun_find
|
||||||
from .base import PlatformInfo, MetaPlatformInfo, MixedMixin
|
from .base import PlatformInfo, MetaPlatformInfo, MixedMixin
|
||||||
|
|
||||||
|
|
||||||
|
MIN_MACOS_VERSION = '12.0'
|
||||||
|
|
||||||
class ApplePlatformInfo(PlatformInfo):
|
class ApplePlatformInfo(PlatformInfo):
|
||||||
build = 'iOS'
|
build = 'iOS'
|
||||||
static = True
|
static = True
|
||||||
|
@ -14,6 +16,7 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
target = None
|
target = None
|
||||||
sdk_name = None
|
sdk_name = None
|
||||||
min_iphoneos_version = None
|
min_iphoneos_version = None
|
||||||
|
min_macos_version = None
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
@ -40,18 +43,14 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
'binaries': self.binaries,
|
'binaries': self.binaries,
|
||||||
'exe_wrapper_def': '',
|
'exe_wrapper_def': '',
|
||||||
'extra_libs': [
|
'extra_libs': [
|
||||||
'-fembed-bitcode',
|
|
||||||
'-isysroot', self.root_path,
|
'-isysroot', self.root_path,
|
||||||
'-arch', self.arch,
|
'-arch', self.arch,
|
||||||
'-target', self.target,
|
'-target', self.target,
|
||||||
'-stdlib=libc++'
|
|
||||||
],
|
],
|
||||||
'extra_cflags': [
|
'extra_cflags': [
|
||||||
'-fembed-bitcode',
|
|
||||||
'-isysroot', self.root_path,
|
'-isysroot', self.root_path,
|
||||||
'-arch', self.arch,
|
'-arch', self.arch,
|
||||||
'-target', self.target,
|
'-target', self.target,
|
||||||
'-stdlib=libc++',
|
|
||||||
*('-I{}'.format(include_dir) for include_dir in self.get_include_dirs())
|
*('-I{}'.format(include_dir) for include_dir in self.get_include_dirs())
|
||||||
],
|
],
|
||||||
'host_machine': {
|
'host_machine': {
|
||||||
|
@ -66,17 +65,24 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
if self.min_iphoneos_version:
|
if self.min_iphoneos_version:
|
||||||
config['extra_libs'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
config['extra_libs'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
||||||
config['extra_cflags'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
config['extra_cflags'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
||||||
|
if self.min_macos_version:
|
||||||
|
config['extra_libs'].append('-mmacosx-version-min={}'.format(self.min_macos_version))
|
||||||
|
config['extra_cflags'].append('-mmacosx-version-min={}'.format(self.min_macos_version))
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def get_env(self):
|
def get_env(self):
|
||||||
env = super().get_env()
|
env = super().get_env()
|
||||||
env['MACOSX_DEPLOYMENT_TARGET'] = '10.15'
|
cflags = [env['CFLAGS']]
|
||||||
|
if self.min_iphoneos_version:
|
||||||
|
cflags.append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
||||||
|
if self.min_macos_version:
|
||||||
|
cflags.append('-mmacosx-version-min={}'.format(self.min_macos_version))
|
||||||
|
env['CFLAGS'] = ' '.join(cflags)
|
||||||
return env
|
return env
|
||||||
|
|
||||||
def set_comp_flags(self, env):
|
def set_comp_flags(self, env):
|
||||||
super().set_comp_flags(env)
|
super().set_comp_flags(env)
|
||||||
cflags = [
|
cflags = [
|
||||||
'-fembed-bitcode',
|
|
||||||
'-isysroot {}'.format(self.root_path),
|
'-isysroot {}'.format(self.root_path),
|
||||||
'-arch {}'.format(self.arch),
|
'-arch {}'.format(self.arch),
|
||||||
'-target {}'.format(self.target),
|
'-target {}'.format(self.target),
|
||||||
|
@ -87,7 +93,6 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
env['CFLAGS'] = ' '.join(cflags)
|
env['CFLAGS'] = ' '.join(cflags)
|
||||||
env['CXXFLAGS'] = ' '.join([
|
env['CXXFLAGS'] = ' '.join([
|
||||||
env['CFLAGS'],
|
env['CFLAGS'],
|
||||||
'-stdlib=libc++',
|
|
||||||
'-std=c++11',
|
'-std=c++11',
|
||||||
env['CXXFLAGS'],
|
env['CXXFLAGS'],
|
||||||
])
|
])
|
||||||
|
@ -122,7 +127,7 @@ class iOSArm64(ApplePlatformInfo):
|
||||||
host = 'arm-apple-darwin'
|
host = 'arm-apple-darwin'
|
||||||
target = 'aarch64-apple-ios'
|
target = 'aarch64-apple-ios'
|
||||||
sdk_name = 'iphoneos'
|
sdk_name = 'iphoneos'
|
||||||
min_iphoneos_version = '13.0'
|
min_iphoneos_version = '15.0'
|
||||||
|
|
||||||
|
|
||||||
class iOSx64(ApplePlatformInfo):
|
class iOSx64(ApplePlatformInfo):
|
||||||
|
@ -131,43 +136,37 @@ class iOSx64(ApplePlatformInfo):
|
||||||
host = 'x86_64-apple-darwin'
|
host = 'x86_64-apple-darwin'
|
||||||
target = 'x86_64-apple-ios'
|
target = 'x86_64-apple-ios'
|
||||||
sdk_name = 'iphonesimulator'
|
sdk_name = 'iphonesimulator'
|
||||||
min_iphoneos_version = '13.0'
|
min_iphoneos_version = '15.0'
|
||||||
|
|
||||||
|
|
||||||
class iOSMacABI(ApplePlatformInfo):
|
|
||||||
name = 'iOS_Mac_ABI'
|
|
||||||
arch = cpu = 'x86_64'
|
|
||||||
host = 'x86_64-apple-darwin'
|
|
||||||
target = 'x86_64-apple-ios14.0-macabi'
|
|
||||||
sdk_name = 'macosx'
|
|
||||||
min_iphoneos_version = '14.0'
|
|
||||||
|
|
||||||
|
|
||||||
class macOSArm64(ApplePlatformInfo):
|
class macOSArm64(ApplePlatformInfo):
|
||||||
name = 'macOS_arm64_static'
|
name = 'macOS_arm64_static'
|
||||||
arch = cpu = 'arm64'
|
arch = cpu = 'arm64'
|
||||||
host = 'aarch64-apple-darwin'
|
host = 'aarch64-apple-darwin'
|
||||||
target = 'arm64-apple-macos11'
|
target = 'arm64-apple-macos'
|
||||||
sdk_name = 'macosx'
|
sdk_name = 'macosx'
|
||||||
min_iphoneos_version = None
|
min_iphoneos_version = None
|
||||||
|
min_macos_version = MIN_MACOS_VERSION
|
||||||
|
|
||||||
|
|
||||||
class macOSArm64Mixed(MixedMixin('macOS_arm64_static'), ApplePlatformInfo):
|
class macOSArm64Mixed(MixedMixin('macOS_arm64_static'), ApplePlatformInfo):
|
||||||
name = 'macOS_arm64_mixed'
|
name = 'macOS_arm64_mixed'
|
||||||
arch = cpu = 'arm64'
|
arch = cpu = 'arm64'
|
||||||
host = 'aarch64-apple-darwin'
|
host = 'aarch64-apple-darwin'
|
||||||
target = 'arm64-apple-macos11'
|
target = 'arm64-apple-macos'
|
||||||
sdk_name = 'macosx'
|
sdk_name = 'macosx'
|
||||||
min_iphoneos_version = None
|
min_iphoneos_version = None
|
||||||
|
min_macos_version = MIN_MACOS_VERSION
|
||||||
|
|
||||||
|
|
||||||
class macOSx64(ApplePlatformInfo):
|
class macOSx64(ApplePlatformInfo):
|
||||||
name = 'macOS_x86_64'
|
name = 'macOS_x86_64'
|
||||||
arch = cpu = 'x86_64'
|
arch = cpu = 'x86_64'
|
||||||
host = 'x86_64-apple-darwin'
|
host = 'x86_64-apple-darwin'
|
||||||
target = 'x86_64-apple-macos10.12'
|
target = 'x86_64-apple-macos'
|
||||||
sdk_name = 'macosx'
|
sdk_name = 'macosx'
|
||||||
min_iphoneos_version = None
|
min_iphoneos_version = None
|
||||||
|
min_macos_version = MIN_MACOS_VERSION
|
||||||
|
|
||||||
|
|
||||||
class IOS(MetaPlatformInfo):
|
class IOS(MetaPlatformInfo):
|
||||||
|
|
|
@ -2,7 +2,7 @@ from .base import PlatformInfo, MixedMixin
|
||||||
|
|
||||||
from kiwixbuild.utils import pj
|
from kiwixbuild.utils import pj
|
||||||
from kiwixbuild._global import option, neutralEnv
|
from kiwixbuild._global import option, neutralEnv
|
||||||
|
from kiwixbuild.platforms.ios import MIN_MACOS_VERSION
|
||||||
|
|
||||||
class NativePlatformInfo(PlatformInfo):
|
class NativePlatformInfo(PlatformInfo):
|
||||||
build = 'native'
|
build = 'native'
|
||||||
|
@ -11,6 +11,8 @@ class NativePlatformInfo(PlatformInfo):
|
||||||
env = super().get_env()
|
env = super().get_env()
|
||||||
if neutralEnv('distname') == 'fedora':
|
if neutralEnv('distname') == 'fedora':
|
||||||
env['QT_SELECT'] = "5-64"
|
env['QT_SELECT'] = "5-64"
|
||||||
|
if neutralEnv('distname') == 'Darwin':
|
||||||
|
env['CFLAGS'] += f'-mmacosx-version-min={MIN_MACOS_VERSION}'
|
||||||
return env
|
return env
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue