Skip to content

Commit

Permalink
[libzim] Update to 9.0.0 (#35576)
Browse files Browse the repository at this point in the history
* [libzim] No uwp

* [libzim] Update to 9.0.0
  • Loading branch information
dg0yt committed Dec 12, 2023
1 parent 87e44be commit 7e67ab9
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 66 deletions.
9 changes: 6 additions & 3 deletions ports/libzim/cross-builds.diff
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
13 changes: 0 additions & 13 deletions ports/libzim/disable-gtest.diff

This file was deleted.

50 changes: 7 additions & 43 deletions ports/libzim/dllexport.diff
Original file line number Diff line number Diff line change
@@ -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 @@

#include <zim/zim_config.h>

-#if (defined _WIN32 || defined __CYGWIN__) && defined LIBZIM_EXPORT_DLL
+#include <zim/zim_config.h>
+
+#if defined(LIBZIM_DLL) && defined(LIBZIM_BUILDING_LIBRARY)
-#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,
8 changes: 6 additions & 2 deletions ports/libzim/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand All @@ -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 changes: 20 additions & 0 deletions ports/libzim/subdirs.diff
Original file line number Diff line number Diff line change
@@ -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,
5 changes: 2 additions & 3 deletions ports/libzim/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libzim.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1b50ef00c5ff7e2ba8f3b064c8ffe6eb14a74f28",
"version": "9.0.0",
"port-version": 0
},
{
"git-tree": "96c23c527ace6213975b81955373f37d96977063",
"version": "8.2.0",
Expand Down

0 comments on commit 7e67ab9

Please sign in to comment.