From e5b7bccdf2b99a005d9e0a8daf70fca4e1c09238 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Sun, 1 Sep 2024 10:06:21 +0200 Subject: [PATCH 1/2] Correctly include lib64 library on manylinux archives Manylinux build are based on Redhat and libs are put in `/lib64` directory and not in `/lib//` as on Debian based build. Fix #746 --- .github/scripts/common.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/scripts/common.py b/.github/scripts/common.py index b7c09d7..bc93a5c 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -69,6 +69,14 @@ def major_version(version: str) -> str: return version.split(".")[0] +# Depending of base distribution, libraries are in "lib64" (redhat base) or "lib/" (debian base). +# On top of that, when cross-compiling, libraries are always put in `lib/`. +# As we use this as glob regex to select which files to add to archive, this is not a problem to have both. +def lib_prefix(file): + yield "lib64/" + file + yield "lib/*/" + file + + # We have build everything. Now create archives for public deployement. EXPORT_FILES = { "kiwix-tools": ( @@ -97,18 +105,25 @@ EXPORT_FILES = { "libzim": ( INSTALL_DIR, ( + ## Linux # We need to package all dependencies (`*.a`) on wasm - "lib/*/libzim.a" if COMPILE_CONFIG != "wasm" else "lib/*.a", - "lib/*/libzim.so", - "lib/*/libzim.so.{version}".format(version=main_project_versions["libzim"]), - "lib/*/libzim.so.{version}".format( - version=major_version(main_project_versions["libzim"]) + *lib_prefix("libzim.a" if COMPILE_CONFIG != "wasm" else "*.a"), + *lib_prefix("libzim.so"), + *lib_prefix( + "libzim.so.{version}".format(version=main_project_versions["libzim"]) ), + *lib_prefix( + "libzim.so.{version}".format( + version=major_version(main_project_versions["libzim"]) + ) + ), + ## MacOS "lib/libzim.{}.dylib".format( major_version(main_project_versions["libzim"]) ), "lib/libzim.dylib", "lib/*/libzim.pc", + ## Windows "bin/zim-{version}.dll".format( version=major_version(main_project_versions["libzim"]) ), @@ -117,6 +132,7 @@ EXPORT_FILES = { version=major_version(main_project_versions["libzim"]) ), "lib/zim.lib", + ## Includes and others "include/zim/**/*.h", "share/icu/{}/icudt{}l.dat".format( base_deps_versions["icu4c"], major_version(base_deps_versions["icu4c"]) From dc2a8374505118c23a22a62bdd5a4b3b002140d0 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 2 Sep 2024 12:38:43 +0200 Subject: [PATCH 2/2] Update to libkiwix version change (14.0.0) Libkiwix update its version to 14.0.0 and we use the declared version in `version.py` to select file to package and sign. So we must be in sync. --- kiwixbuild/versions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index 87124d1..8dfa916 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -2,7 +2,7 @@ main_project_versions = { "libzim": "9.2.3", - "libkiwix": "13.1.0", + "libkiwix": "14.0.0", "kiwix-tools": "3.7.0", "zim-tools": "3.4.2", "kiwix-desktop": "2.3.1",