Merge pull request #721 from kiwix/ci_windows_all_config
This commit is contained in:
commit
3bd6ba5ec7
|
@ -9,10 +9,15 @@ jobs:
|
||||||
Windows:
|
Windows:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
- native_mixed
|
||||||
|
- native_dyn
|
||||||
|
- native_static
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
env:
|
env:
|
||||||
OS_NAME: windows
|
OS_NAME: windows
|
||||||
COMPILE_CONFIG: native_mixed
|
COMPILE_CONFIG: ${{matrix.config}}
|
||||||
HOME: 'C:\\Users\\runneradmin'
|
HOME: 'C:\\Users\\runneradmin'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|
|
@ -8,6 +8,61 @@ on:
|
||||||
- cron: '0 1 * * *'
|
- cron: '0 1 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
Windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
- native_mixed
|
||||||
|
- native_dyn
|
||||||
|
- native_static
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
OS_NAME: windows
|
||||||
|
COMPILE_CONFIG: ${{matrix.config}}
|
||||||
|
HOME: 'C:\\Users\\runneradmin'
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup python 3.8
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
- name: Install packages
|
||||||
|
run: |
|
||||||
|
choco.exe install pkgconfiglite ninja
|
||||||
|
- name: Install python modules
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pip3 install meson pytest requests distro paramiko
|
||||||
|
pip3 install --no-deps $GITHUB_WORKSPACE
|
||||||
|
- name: Setup MSVC compiler
|
||||||
|
uses: bus1/cabuild/action/msdevshell@v1
|
||||||
|
with:
|
||||||
|
architecture: x64
|
||||||
|
- name: secret
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "${{secrets.ssh_key}}" > $SSH_KEY
|
||||||
|
env:
|
||||||
|
SSH_KEY: ${{ runner.temp }}/id_rsa
|
||||||
|
- name: Ensure base deps
|
||||||
|
run: |
|
||||||
|
python .github\\scripts\\ensure_base_deps.py
|
||||||
|
env:
|
||||||
|
SSH_KEY: ${{ runner.temp }}/id_rsa
|
||||||
|
- name: Build Release
|
||||||
|
run: |
|
||||||
|
python .github\\scripts\\build_release_nightly.py
|
||||||
|
env:
|
||||||
|
SSH_KEY: ${{ runner.temp }}/id_rsa
|
||||||
|
- name: Upload failure logs
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
python .github\\scripts\\upload_failure_logs.py
|
||||||
|
env:
|
||||||
|
SSH_KEY: ${{ runner.temp }}/id_rsa
|
||||||
|
|
||||||
Linux:
|
Linux:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
from .base import Dependency, ReleaseDownload, MakeBuilder, MesonBuilder
|
from .base import (
|
||||||
|
Dependency,
|
||||||
|
ReleaseDownload,
|
||||||
|
MakeBuilder,
|
||||||
|
MesonBuilder,
|
||||||
|
Builder as BaseBuilder,
|
||||||
|
)
|
||||||
|
|
||||||
from kiwixbuild.utils import pj, SkipCommand, Remotefile, extract_archive
|
from kiwixbuild.utils import pj, SkipCommand, Remotefile, extract_archive
|
||||||
from kiwixbuild._global import get_target_step, neutralEnv
|
from kiwixbuild._global import get_target_step, neutralEnv
|
||||||
|
@ -6,40 +12,123 @@ import os, shutil
|
||||||
import fileinput
|
import fileinput
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
|
||||||
class Icu(Dependency):
|
class Icu(Dependency):
|
||||||
name = "icu4c"
|
name = "icu4c"
|
||||||
|
|
||||||
class Source(ReleaseDownload):
|
class Source(ReleaseDownload):
|
||||||
archive_src = Remotefile(
|
archive = Remotefile(
|
||||||
"icu4c-73_2-src.tgz",
|
"icu4c-73_1-Win64-MSVC2019.zip",
|
||||||
"818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1",
|
"",
|
||||||
"https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz",
|
"https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-Win64-MSVC2019.zip",
|
||||||
)
|
|
||||||
archive_data = Remotefile(
|
|
||||||
"icu4c-73_2-data.zip",
|
|
||||||
"ca1ee076163b438461e484421a7679fc33a64cd0a54f9d4b401893fa1eb42701",
|
|
||||||
"https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-data.zip",
|
|
||||||
)
|
|
||||||
meson_patch = Remotefile(
|
|
||||||
"icu_73.2-2_patch.zip",
|
|
||||||
"218a5f20b58b6b2372e636c2eb2d611a898fdc11be17d6c4f35a3cd54d472010",
|
|
||||||
"https://wrapdb.mesonbuild.com/v2/icu_73.2-2/get_patch",
|
|
||||||
)
|
|
||||||
|
|
||||||
archives = [archive_src, archive_data, meson_patch]
|
|
||||||
|
|
||||||
def _extract(self, context):
|
|
||||||
context.try_skip(self.extract_path)
|
|
||||||
if os.path.exists(self.extract_path):
|
|
||||||
shutil.rmtree(self.extract_path)
|
|
||||||
extract_archive(
|
|
||||||
pj(neutralEnv("archive_dir"), self.archive_src.name),
|
|
||||||
neutralEnv("source_dir"),
|
|
||||||
topdir=None,
|
|
||||||
name=self.source_dir,
|
|
||||||
)
|
)
|
||||||
if platform.system() != "Windows":
|
|
||||||
|
class Builder(BaseBuilder):
|
||||||
|
def build(self):
|
||||||
|
self.command("copy_headers", self._copy_headers)
|
||||||
|
self.command("copy_bins", self._copy_bin)
|
||||||
|
self.command("generate_pkg_config", self._generate_pkg_config)
|
||||||
|
|
||||||
|
def _copy_headers(self, context):
|
||||||
|
context.try_skip(self.build_path)
|
||||||
|
shutil.copytree(
|
||||||
|
pj(self.source_path, "include", "unicode"),
|
||||||
|
pj(self.buildEnv.install_dir, "include", "unicode"),
|
||||||
|
)
|
||||||
|
|
||||||
|
def _copy_bin(self, context):
|
||||||
|
context.try_skip(self.build_path)
|
||||||
|
shutil.copytree(
|
||||||
|
pj(self.source_path, "lib64"),
|
||||||
|
pj(self.buildEnv.install_dir, "lib"),
|
||||||
|
dirs_exist_ok=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
def ignore_non_dll(path, names):
|
||||||
|
return [n for n in names if not n.endswith(".dll")]
|
||||||
|
|
||||||
|
shutil.copytree(
|
||||||
|
pj(self.source_path, "bin64"),
|
||||||
|
pj(self.buildEnv.install_dir, "bin"),
|
||||||
|
ignore=ignore_non_dll,
|
||||||
|
dirs_exist_ok=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
def _generate_pkg_config(self, context):
|
||||||
|
context.try_skip(self.build_path)
|
||||||
|
|
||||||
|
pkg_config_template = """ Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||||
|
# License & terms of use: http://www.unicode.org/copyright.html
|
||||||
|
# Copyright (C) 2010-2013, International Business Machines Corporation. All Rights Reserved.
|
||||||
|
|
||||||
|
# CFLAGS contains only anything end users should set
|
||||||
|
CFLAGS =
|
||||||
|
# CXXFLAGS contains only anything end users should set
|
||||||
|
CXXFLAGS = -std=c++11
|
||||||
|
# DEFS only contains those UCONFIG_CPPFLAGS which are not auto-set by platform.h
|
||||||
|
DEFS =
|
||||||
|
prefix = {prefix}
|
||||||
|
exec_prefix = ${{prefix}}
|
||||||
|
libdir = ${{exec_prefix}}\\lib
|
||||||
|
includedir = ${{prefix}}\\include
|
||||||
|
baselibs = -lpthread -lm
|
||||||
|
UNICODE_VERSION=15.0
|
||||||
|
ICUPREFIX=icu
|
||||||
|
ICULIBSUFFIX=
|
||||||
|
LIBICU=lib${{ICUPREFIX}}
|
||||||
|
pkglibdir=${{libdir}}/icu${{ICULIBSUFFIX}}/73.1
|
||||||
|
ICUDATA_NAME = icudt73l
|
||||||
|
ICUDESC=International Components for Unicode
|
||||||
|
|
||||||
|
Version: 73.1
|
||||||
|
Cflags: -I${{includedir}}
|
||||||
|
Description: International Components for Unicode: Internationalization library
|
||||||
|
Name: icu-i18n
|
||||||
|
Libs: -L&{{libdir}} -licuin -licuuc -licudt"""
|
||||||
|
|
||||||
|
pkg_config_content = pkg_config_template.format(
|
||||||
|
prefix=self.buildEnv.install_dir
|
||||||
|
)
|
||||||
|
|
||||||
|
os.makedirs(
|
||||||
|
pj(self.buildEnv.install_dir, "lib", "pkgconfig"), exist_ok=True
|
||||||
|
)
|
||||||
|
with open(
|
||||||
|
pj(self.buildEnv.install_dir, "lib", "pkgconfig", "icu-i18n.pc"),
|
||||||
|
mode="w",
|
||||||
|
) as f:
|
||||||
|
f.write(pkg_config_content)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
class Icu(Dependency):
|
||||||
|
name = "icu4c"
|
||||||
|
|
||||||
|
class Source(ReleaseDownload):
|
||||||
|
archive_src = Remotefile(
|
||||||
|
"icu4c-73_2-src.tgz",
|
||||||
|
"818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1",
|
||||||
|
"https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz",
|
||||||
|
)
|
||||||
|
archive_data = Remotefile(
|
||||||
|
"icu4c-73_2-data.zip",
|
||||||
|
"ca1ee076163b438461e484421a7679fc33a64cd0a54f9d4b401893fa1eb42701",
|
||||||
|
"https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-data.zip",
|
||||||
|
)
|
||||||
|
|
||||||
|
archives = [archive_src, archive_data]
|
||||||
|
|
||||||
|
def _extract(self, context):
|
||||||
|
context.try_skip(self.extract_path)
|
||||||
|
if os.path.exists(self.extract_path):
|
||||||
|
shutil.rmtree(self.extract_path)
|
||||||
|
extract_archive(
|
||||||
|
pj(neutralEnv("archive_dir"), self.archive_src.name),
|
||||||
|
neutralEnv("source_dir"),
|
||||||
|
topdir=None,
|
||||||
|
name=self.source_dir,
|
||||||
|
)
|
||||||
shutil.rmtree(
|
shutil.rmtree(
|
||||||
pj(neutralEnv("source_dir"), self.source_dir, "source", "data")
|
pj(neutralEnv("source_dir"), self.source_dir, "source", "data")
|
||||||
)
|
)
|
||||||
|
@ -49,29 +138,18 @@ class Icu(Dependency):
|
||||||
topdir="data",
|
topdir="data",
|
||||||
name="data",
|
name="data",
|
||||||
)
|
)
|
||||||
extract_archive(
|
extract_archive(
|
||||||
pj(neutralEnv("archive_dir"), self.meson_patch.name),
|
pj(neutralEnv("archive_dir"), self.meson_patch.name),
|
||||||
neutralEnv("source_dir"),
|
neutralEnv("source_dir"),
|
||||||
topdir="icu",
|
topdir="icu",
|
||||||
name=self.source_dir,
|
name=self.source_dir,
|
||||||
)
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
"icu4c_fix_static_lib_name_mingw.patch",
|
|
||||||
"icu4c_rpath.patch",
|
|
||||||
"icu4c_wasm.patch",
|
|
||||||
]
|
|
||||||
|
|
||||||
if platform.system() == "Windows":
|
|
||||||
|
|
||||||
class Builder(MesonBuilder):
|
|
||||||
def set_env(self, env):
|
|
||||||
env["ICU_DATA_FILTER_FILE"] = pj(
|
|
||||||
os.path.dirname(os.path.realpath(__file__)),
|
|
||||||
"icu4c_data_filter.json",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
patches = [
|
||||||
|
"icu4c_fix_static_lib_name_mingw.patch",
|
||||||
|
"icu4c_rpath.patch",
|
||||||
|
"icu4c_wasm.patch",
|
||||||
|
]
|
||||||
|
|
||||||
class Builder(MakeBuilder):
|
class Builder(MakeBuilder):
|
||||||
subsource_dir = "source"
|
subsource_dir = "source"
|
||||||
|
|
Loading…
Reference in New Issue