diff --git a/.github/scripts/build_release_nightly.py b/.github/scripts/build_release_nightly.py index 0afd08c..b1303fe 100755 --- a/.github/scripts/build_release_nightly.py +++ b/.github/scripts/build_release_nightly.py @@ -33,37 +33,37 @@ else: RELEASE = True if PLATFORM_TARGET == "android": - TARGETS = ("kiwix-lib-app",) + TARGETS = ("libkiwix-app",) elif PLATFORM_TARGET.startswith("iOS"): - TARGETS = ("libzim", "kiwix-lib") + TARGETS = ("libzim", "libkiwix") elif PLATFORM_TARGET.startswith("native_"): if OS_NAME == "osx": - TARGETS = ("libzim", ) if PLATFORM_TARGET == "native_mixed" else ("libzim", "zim-tools", "kiwix-lib") + TARGETS = ("libzim", ) if PLATFORM_TARGET == "native_mixed" else ("libzim", "zim-tools", "libkiwix") else: if DESKTOP: TARGETS = ("kiwix-desktop",) elif PLATFORM_TARGET == "native_mixed": TARGETS = ("libzim",) else: - TARGETS = ("zim-tools", "kiwix-lib", "kiwix-tools") + TARGETS = ("zim-tools", "libkiwix", "kiwix-tools") elif PLATFORM_TARGET in ("win32_static", "armhf_static", "i586_static"): TARGETS = ("kiwix-tools",) elif PLATFORM_TARGET == "flatpak": TARGETS = ("kiwix-desktop",) else: - TARGETS = ("libzim", "zim-tools", "kiwix-lib", "kiwix-tools") + TARGETS = ("libzim", "zim-tools", "libkiwix", "kiwix-tools") # Filter what to build if we are doing a release. if RELEASE: def release_filter(project): - if project == "kiwix-lib-app": - project = "kiwix-lib" + if project == "libkiwix-app": + project = "libkiwix" return release_versions.get(project) is not None TARGETS = tuple(filter(release_filter, TARGETS)) if RELEASE and PLATFORM_TARGET == "android": - # Kiwix-lib need to know the extrapostfix version to correctly generate the pom.xml file. - extra_postfix = release_versions.get('kiwix-lib') + # libkiwix need to know the extrapostfix version to correctly generate the pom.xml file. + extra_postfix = release_versions.get('libkiwix') if extra_postfix: os.environ['KIWIXLIB_BUILDVERSION'] = str(extra_postfix) @@ -109,12 +109,12 @@ if RELEASE: if PLATFORM_TARGET == "flatpak" and "kiwix-desktop" in TARGETS: update_flathub_git() - if PLATFORM_TARGET == "android" and "kiwix-lib-app" in TARGETS: - postfix = get_postfix("kiwix-lib") + if PLATFORM_TARGET == "android" and "libkiwix-app" in TARGETS: + postfix = get_postfix("libkiwix") basename = "kiwixlib-{}".format(postfix) output_release_dir = ( - HOME / "BUILD_android" / "kiwix-lib-app" / "kiwixLibAndroid" / "build" + HOME / "BUILD_android" / "libkiwix-app" / "kiwixLibAndroid" / "build" ) shutil.copy( str(output_release_dir / "outputs" / "aar" / "kiwixLibAndroid-release.aar"), diff --git a/.github/scripts/common.py b/.github/scripts/common.py index e3fd467..609753b 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -134,7 +134,7 @@ def run_kiwix_build( command.append("--hide-progress") command.append("--fast-clone") command.append("--assume-packages-installed") - if target == "kiwix-lib-app" and platform.startswith("android_"): + if target == "libkiwix-app" and platform.startswith("android_"): command.extend(["--target-platform", "android", "--android-arch", platform[8:]]) elif platform == "android": command.extend(["--target-platform", "android"]) diff --git a/.github/scripts/compile_all_deps.py b/.github/scripts/compile_all_deps.py index ff0fd9d..5ecb189 100755 --- a/.github/scripts/compile_all_deps.py +++ b/.github/scripts/compile_all_deps.py @@ -13,21 +13,21 @@ from common import ( ) if PLATFORM_TARGET.startswith("android_"): - TARGETS = ("libzim", "kiwix-lib") + TARGETS = ("libzim", "libkiwix") elif PLATFORM_TARGET.startswith("iOS"): - TARGETS = ("libzim", "kiwix-lib") + TARGETS = ("libzim", "libkiwix") elif PLATFORM_TARGET.startswith("native_"): if OS_NAME == "osx": - TARGETS = ("libzim", "zim-tools", "kiwix-lib") + TARGETS = ("libzim", "zim-tools", "libkiwix") else: if DESKTOP: TARGETS = ("kiwix-desktop",) elif PLATFORM_TARGET == "native_mixed": TARGETS = ("libzim",) else: - TARGETS = ("libzim", "zim-tools", "kiwix-lib", "kiwix-tools") + TARGETS = ("libzim", "zim-tools", "libkiwix", "kiwix-tools") else: - TARGETS = ("libzim", "zim-tools", "kiwix-lib", "kiwix-tools") + TARGETS = ("libzim", "zim-tools", "libkiwix", "kiwix-tools") for target in TARGETS: run_kiwix_build(target, platform=PLATFORM_TARGET, build_deps_only=True) diff --git a/.github/scripts/upload_to_bintray.py b/.github/scripts/upload_to_bintray.py index 643be93..c2fc8c2 100755 --- a/.github/scripts/upload_to_bintray.py +++ b/.github/scripts/upload_to_bintray.py @@ -10,7 +10,7 @@ def create_version(version): url = "https://api.bintray.com/packages/kiwix/kiwix/kiwixlib/versions" payload = { 'name': version, - 'desc': 'Release of kiwix-lib' + 'desc': 'Release of libkiwix' } headers = { 'Content-Type': 'application/json' diff --git a/README.md b/README.md index 01a818c..c865c39 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ You may want to compile a specific target so you will have to specify it on the command line: ```bash -kiwix-build kiwix-lib # will build kiwix-build and its dependencies +kiwix-build libkiwix # will build kiwix-build and its dependencies kiwix-build kiwix-desktop # will build kiwix-desktop and its dependencies kiwix-build zim-tools # will build zim-tools and its dependencies ``` @@ -76,7 +76,7 @@ invalid choice: 'not-existing-target' (choose from 'alldependencies', 'android-n If no target platform is specified, a default one will be infered from the specified target: -- `kiwix-lib-app` will be build using the platform `android` +- `libkiwix-app` will be build using the platform `android` - Other targets will be build using the platform `native_dyn` But you can select another target platform using the option @@ -104,33 +104,33 @@ Android ------- `kiwix-android` (https://github.com/kiwix/kiwix-android) depends of -the `kiwix-lib` project. -It uses a special `.aar` file that represent (and embed) the kiwix-lib for +the `libkiwix` project. +It uses a special `.aar` file that represent (and embed) the libkiwix for all supported android arch. This is a kind of fat archive we have for MacOs. -The `.aar` file is build using the `kiwix-lib-app` project. -`kiwix-lib-app` itself is architecture independent (it is just a packaging of -other archives) but it use `kiwix-lib` who is architecture dependent. +The `.aar` file is build using the `libkiwix-app` project. +`libkiwix-app` itself is architecture independent (it is just a packaging of +other archives) but it use `libkiwix` who is architecture dependent. -When building `kiwix-lib`, you should directly use the +When building `libkiwix`, you should directly use the target-platform `android_`: ```bash -kiwix-build kiwix-lib --target-platform android_arm +kiwix-build libkiwix --target-platform android_arm ``` -But, `kiwix-lib-app` is mainly multi arch. -To compile `kiwix-lib-app`, you must use the `android` platform: +But, `libkiwix-app` is mainly multi arch. +To compile `libkiwix-app`, you must use the `android` platform: ```bash -$ kiwix-build --target-platform android kiwix-lib-app -$ kiwix-build kiwix-lib-app # because `android` platform is the default for `kiwix-lib-app` +$ kiwix-build --target-platform android libkiwix-app +$ kiwix-build libkiwix-app # because `android` platform is the default for `libkiwix-app` ``` -By default, when using platform `android`, `kiwix-lib` will be build for +By default, when using platform `android`, `libkiwix` will be build for all architectures. This can be changed by using the option `--android-arch`: ```bash -$ kiwix-build kiwix-lib-app # aar with all architectures -$ kiwix-build kiwix-lib-app --android-arch arm # aar with arm architecture -$ kiwix-build kiwix-lib-app --android-arch arm --android-arch arm64 # aan with arm and arm64 architectures +$ kiwix-build libkiwix-app # aar with all architectures +$ kiwix-build libkiwix-app --android-arch arm # aar with arm architecture +$ kiwix-build libkiwix-app --android-arch arm --android-arch arm64 # aan with arm and arm64 architectures ``` To build `kiwix-android` itself, you should see the documentation of `kiwix-android`. @@ -145,12 +145,12 @@ 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 --target-platform iOS_multi kiwix-lib +kiwix-build --target-platform iOS_multi libkiwix ``` You can specify the supported architectures with the option `--ios-arch`: ```bash -kiwix-build --target-platform iOS_multi kiwix-lib # all architetures +kiwix-build --target-platform iOS_multi libkiwix # all architetures kiwix-build --target-platform iOS_multi --ios-arch arm --ios-arch arm64 # arm and arm64 arch only ``` diff --git a/appveyor.yml b/appveyor.yml index 244fdfe..ccb0daa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -58,7 +58,7 @@ build_script: - IF "%USE_CACHE%" NEQ "1" appveyor\install_libmicrohttpd.cmd - IF "%USE_CACHE%" NEQ "1" %MINGW64_RUN% "cd /c/projects/kiwix-build && appveyor/create_cache.sh" - appveyor\install_libzim.cmd - - appveyor\install_kiwix-lib.cmd + - appveyor\install_libkiwix.cmd - appveyor\install_kiwix-desktop.cmd before_deploy: diff --git a/appveyor/install_kiwix-lib.cmd b/appveyor/install_libkiwix.cmd similarity index 72% rename from appveyor/install_kiwix-lib.cmd rename to appveyor/install_libkiwix.cmd index c0a8b10..dc357e7 100644 --- a/appveyor/install_kiwix-lib.cmd +++ b/appveyor/install_libkiwix.cmd @@ -1,7 +1,7 @@ REM ======================================================== -REM Install kiwix-lib -git clone https://github.com/kiwix/kiwix-lib.git || exit /b 1 -cd kiwix-lib +REM Install libkiwix +git clone https://github.com/kiwix/libkiwix.git || exit /b 1 +cd libkiwix set CPPFLAGS="-I%EXTRA_DIR%/include" meson . build --prefix %EXTRA_DIR% --default-library static --buildtype release || exit /b 1 cd build diff --git a/kiwixbuild/__init__.py b/kiwixbuild/__init__.py index f90f385..0945f1d 100644 --- a/kiwixbuild/__init__.py +++ b/kiwixbuild/__init__.py @@ -60,7 +60,7 @@ def parse_args(): options.ios_arch = ['arm64', 'x86_64'] if not options.target_platform: - if options.target in ('kiwix-lib-app',): + if options.target in ('libkiwix-app',): options.target_platform = 'android' else: options.target_platform = 'native_dyn' diff --git a/kiwixbuild/dependencies/__init__.py b/kiwixbuild/dependencies/__init__.py index f6ea52d..e9e0079 100644 --- a/kiwixbuild/dependencies/__init__.py +++ b/kiwixbuild/dependencies/__init__.py @@ -13,9 +13,9 @@ from . import ( ios_fat_lib, mustache, kiwix_desktop, - kiwix_lib, kiwix_tools, libcurl, + libkiwix, libmagic, libmicrohttpd, libzim, diff --git a/kiwixbuild/dependencies/kiwix_desktop.py b/kiwixbuild/dependencies/kiwix_desktop.py index ec1611b..1afac43 100644 --- a/kiwixbuild/dependencies/kiwix_desktop.py +++ b/kiwixbuild/dependencies/kiwix_desktop.py @@ -12,7 +12,7 @@ class KiwixDesktop(Dependency): git_dir = "kiwix-desktop" class Builder(QMakeBuilder): - dependencies = ["qt", "qtwebengine", "kiwix-lib", "aria2"] + dependencies = ["qt", "qtwebengine", "libkiwix", "aria2"] make_install_target = 'install' configure_env = None diff --git a/kiwixbuild/dependencies/kiwix_tools.py b/kiwixbuild/dependencies/kiwix_tools.py index 2f1500f..a9ea548 100644 --- a/kiwixbuild/dependencies/kiwix_tools.py +++ b/kiwixbuild/dependencies/kiwix_tools.py @@ -12,7 +12,7 @@ class KiwixTools(Dependency): git_dir = "kiwix-tools" class Builder(MesonBuilder): - dependencies = ["kiwix-lib"] + dependencies = ["libkiwix"] @property def configure_option(self): diff --git a/kiwixbuild/dependencies/kiwix_lib.py b/kiwixbuild/dependencies/libkiwix.py similarity index 78% rename from kiwixbuild/dependencies/kiwix_lib.py rename to kiwixbuild/dependencies/libkiwix.py index 9964fd6..21a9b31 100644 --- a/kiwixbuild/dependencies/kiwix_lib.py +++ b/kiwixbuild/dependencies/libkiwix.py @@ -8,13 +8,13 @@ from .base import ( from kiwixbuild.utils import pj, copy_tree from kiwixbuild._global import option, get_target_step, neutralEnv -class Kiwixlib(Dependency): - name = "kiwix-lib" +class Libkiwix(Dependency): + name = "libkiwix" force_build = True class Source(GitClone): - git_remote = "https://github.com/kiwix/kiwix-lib.git" - git_dir = "kiwix-lib" + git_remote = "https://github.com/kiwix/libkiwix.git" + git_dir = "libkiwix" class Builder(MesonBuilder): dependencies = ["pugixml", "libzim", "zlib", "lzma", "libcurl", "libmicrohttpd", "icu4c", "mustache", "xapian-core"] @@ -38,15 +38,15 @@ class Kiwixlib(Dependency): return super().library_type -class KiwixlibApp(Dependency): - name = "kiwix-lib-app" +class LibkiwixApp(Dependency): + name = "libkiwix-app" force_build = True - class Source(Kiwixlib.Source): - name = "kiwix-lib" + class Source(Libkiwix.Source): + name = "libkiwix" class Builder(GradleBuilder): - dependencies = ["kiwix-lib"] + dependencies = ["libkiwix"] gradle_target = "assembleRelease writePom" @classmethod @@ -54,7 +54,7 @@ class KiwixlibApp(Dependency): if not allDeps: return super().get_dependencies(platformInfo, allDeps) else: - deps = [('android_{}'.format(arch), 'kiwix-lib') + deps = [('android_{}'.format(arch), 'libkiwix') for arch in option('android_arch')] return deps @@ -64,17 +64,17 @@ class KiwixlibApp(Dependency): except FileNotFoundError: pass if not os.path.exists(self.build_path): - shutil.copytree(pj(self.source_path, 'android-kiwix-lib-publisher'), self.build_path, symlinks=True) + shutil.copytree(pj(self.source_path, 'android-libkiwix-publisher'), self.build_path, symlinks=True) for arch in option('android_arch'): try: - kiwix_builder = get_target_step('kiwix-lib', 'android_{}'.format(arch)) + kiwix_builder = get_target_step('libkiwix', 'android_{}'.format(arch)) except KeyError: pass else: - copy_tree(pj(kiwix_builder.buildEnv.install_dir, 'kiwix-lib'), + copy_tree(pj(kiwix_builder.buildEnv.install_dir, 'libkiwix'), pj(self.build_path, 'kiwixLibAndroid', 'src', 'main')) -# The ICU dat file should be embedded with the kiwix-lib application +# The ICU dat file should be embedded with the libkiwix application # but for now it is package with kiwix-android app and use there. # We must fix this at a time (before we update the icu version). # os.makedirs( @@ -82,7 +82,7 @@ class KiwixlibApp(Dependency): # exist_ok=True) # for arch in option('android_arch'): # try: -# kiwix_builder = get_target_step('kiwix-lib', 'android_{}'.format(arch)) +# kiwix_builder = get_target_step('libkiwix', 'android_{}'.format(arch)) # except KeyError: # pass # else: diff --git a/kiwixbuild/platforms/android.py b/kiwixbuild/platforms/android.py index 0f1468a..97aa9e7 100644 --- a/kiwixbuild/platforms/android.py +++ b/kiwixbuild/platforms/android.py @@ -134,7 +134,7 @@ class Android(MetaPlatformInfo): return ['android_{}'.format(arch) for arch in option('android_arch')] def add_targets(self, targetName, targets): - if targetName not in ('kiwix-lib-app',): + if targetName not in ('libkiwix-app',): return super().add_targets(targetName, targets) else: return AndroidPlatformInfo.add_targets(self, targetName, targets) diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index fe5eba1..70065f5 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -2,7 +2,7 @@ main_project_versions = { 'libzim': '7.0.0', # Because of bump of version in libzim. No release made for now. - 'kiwix-lib': '9.4.1', + 'libkiwix': '9.4.1', 'kiwix-tools': '3.1.2', 'zim-tools': '2.1.0', 'kiwix-desktop': '2.0.5' # Also change KIWIX_DESKTOP_VERSION and KIWIX_DESKTOP_RELEASE in appveyor.yml @@ -30,10 +30,10 @@ main_project_versions = { release_versions = { 'libzim': 0, # Depends of base deps (was 0) - 'kiwix-lib': 0, # Depends of libzim (was 0) - 'kiwix-tools': 4, # Depends of kiwix-lib and libzim (was 3) + 'libkiwix': 0, # Depends of libzim (was 0) + 'kiwix-tools': 4, # Depends of libkiwix and libzim (was 3) 'zim-tools': 0, # Depends of libzim (was 2) - 'kiwix-desktop': 0 # Depends of kiwix-lib and libzim (was 0) + 'kiwix-desktop': 0 # Depends of libkiwix and libzim (was 0) } diff --git a/scripts/upload_kiwix_lib_android_to_bintray.py b/scripts/upload_libkiwix_android_to_bintray.py similarity index 98% rename from scripts/upload_kiwix_lib_android_to_bintray.py rename to scripts/upload_libkiwix_android_to_bintray.py index 0e7a5fe..43bd6e7 100755 --- a/scripts/upload_kiwix_lib_android_to_bintray.py +++ b/scripts/upload_libkiwix_android_to_bintray.py @@ -10,7 +10,7 @@ def create_version(version): url = "https://api.bintray.com/packages/kiwix/kiwix/kiwixlib/versions" payload = { 'name': version, - 'desc': 'Release of kiwix-lib' + 'desc': 'Release of libkiwix' } headers = { 'Content-Type': 'application/json'