[libzim] Update to 9.0.0 (#35576)

* [libzim] No uwp

* [libzim] Update to 9.0.0
This commit is contained in:
Kai Pastor 2023-12-12 10:31:45 +01:00 committed by GitHub
parent 87e44be6f5
commit 7e67ab9f0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 48 additions and 66 deletions

View File

@ -1,10 +1,13 @@
diff --git a/meson.build b/meson.build
index 85d8da7..7f97dbc 100644
index f3e7a27..d946c49 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@ project('libzim', ['c', 'cpp'],
@@ -1,9 +1,9 @@
project('libzim', ['c', 'cpp'],
version : '9.0.0',
license : 'GPL2',
default_options : ['c_std=c11', 'cpp_std=c++11'])
- default_options : ['c_std=c11', 'cpp_std=c++17', 'werror=true'])
+ default_options : ['c_std=c11', 'cpp_std=c++17'])
-if build_machine.system() != 'windows'
+if host_machine.system() != 'windows' or meson.get_compiler('cpp').get_id() == 'gcc'

View File

@ -1,13 +0,0 @@
diff --git a/meson.build b/meson.build
index d887f9a..270413d 100644
--- a/meson.build
+++ b/meson.build
@@ -81,7 +81,7 @@ else
icu_dep = dependency('icu-i18n', required:false, static:static_linkage)
endif
-gtest_dep = dependency('gtest', main:true, fallback:['gtest', 'gtest_main_dep'], required:false)
+gtest_dep = dependency('', required:false)
inc = include_directories('include')

View File

@ -1,52 +1,16 @@
diff --git a/include/zim/zim.h b/include/zim/zim.h
index 5d1af80..6171f56 100644
index 80e8596..631cfab 100644
--- a/include/zim/zim.h
+++ b/include/zim/zim.h
@@ -33,14 +33,16 @@
#define DEPRECATED
#endif
@@ -35,8 +35,10 @@
-#if (defined _WIN32 || defined __CYGWIN__) && defined LIBZIM_EXPORT_DLL
+#include <zim/zim_config.h>
+
+#if defined(LIBZIM_DLL) && defined(LIBZIM_BUILDING_LIBRARY)
#include <zim/zim_config.h>
-#if defined(_MSC_VER) && defined(LIBZIM_EXPORT_DLL)
+#if defined(_WIN32) && defined(LIBZIM_EXPORT_DLL)
#define LIBZIM_API __declspec(dllexport)
+#elif defined(LIBZIM_DLL)
+#elif defined(_WIN32) && defined(LIBZIM_IMPORT_DLL)
+ #define LIBZIM_API __declspec(dllimport)
#else
#define LIBZIM_API
#endif
-#include <zim/zim_config.h>
-
namespace zim
{
// An index of an entry (in a zim file)
diff --git a/meson.build b/meson.build
index 7f97dbc..8fd13d7 100644
--- a/meson.build
+++ b/meson.build
@@ -14,6 +14,10 @@ sizeof_size_t = cpp.sizeof('size_t')
private_conf = configuration_data()
public_conf = configuration_data()
+if host_machine.system() == 'windows' and get_option('default_library') == 'shared'
+ public_conf.set('LIBZIM_DLL', true)
+endif
+
private_conf.set('VERSION', '"@0@"'.format(meson.project_version()))
public_conf.set('LIBZIM_VERSION', '"@0@"'.format(meson.project_version()))
private_conf.set('DIRENT_CACHE_SIZE', get_option('DIRENT_CACHE_SIZE'))
diff --git a/src/meson.build b/src/meson.build
index 4529b7c..956b145 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -75,7 +75,7 @@ libzim = library('zim',
include_directories : inc,
dependencies : deps,
link_args : extra_link_args,
- cpp_args : extra_cpp_args,
+ cpp_args : extra_cpp_args + '-DLIBZIM_BUILDING_LIBRARY',
version: meson.project_version(),
install : true)
libzim_dep = declare_dependency(link_with: libzim,

View File

@ -2,12 +2,12 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO openzim/libzim
REF "${VERSION}"
SHA512 4554a9237f5167f6f94aad76ef0e847e949c47c6ee2a89bbd6e587da3b3a3e2d0a8b2d03f7a0fbde0e0dc96fb61bf8c115b3ef3cbd7eff5e880f152bee9b29f0
SHA512 55d18535d677d3249c8331ceac1acd4afa650de1f61a0aa3ffc1c98ca2a395bc657c774d01780f1a2c2aedd7d9c5d2e7d9f5e717ed879de84dc6d1be6accfe5e
HEAD_REF main
PATCHES
cross-builds.diff
dllexport.diff
disable-gtest.diff
subdirs.diff
)
set(EXTRA_OPTIONS "")
@ -29,5 +29,9 @@ vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zim/zim.h" "defined(LIBZIM_IMPORT_DLL)" "1")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

20
ports/libzim/subdirs.diff Normal file
View File

@ -0,0 +1,20 @@
diff --git a/meson.build b/meson.build
index d946c49..eded01d 100644
--- a/meson.build
+++ b/meson.build
@@ -90,6 +90,7 @@ subdir('include')
subdir('scripts')
subdir('static')
subdir('src')
+if false
if get_option('examples')
subdir('examples')
endif
@@ -97,6 +98,7 @@ subdir('test')
if get_option('doc')
subdir('docs')
endif
+endif
pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : libzim,

View File

@ -1,11 +1,10 @@
{
"name": "libzim",
"version": "8.2.0",
"port-version": 2,
"version": "9.0.0",
"description": "The Libzim is the reference implementation for the ZIM file format. It's a software library to read and write ZIM files on many systems and architectures. More information about the ZIM format and the openZIM project at https://openzim.org/.",
"homepage": "https://github.com/openzim/libzim",
"license": "GPL-2.0-or-later",
"supports": "!android & !xbox",
"supports": "!android & !uwp & !xbox",
"dependencies": [
"icu",
"liblzma",

View File

@ -5177,8 +5177,8 @@
"port-version": 0
},
"libzim": {
"baseline": "8.2.0",
"port-version": 2
"baseline": "9.0.0",
"port-version": 0
},
"libzip": {
"baseline": "1.10.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1b50ef00c5ff7e2ba8f3b064c8ffe6eb14a74f28",
"version": "9.0.0",
"port-version": 0
},
{
"git-tree": "96c23c527ace6213975b81955373f37d96977063",
"version": "8.2.0",