diff --git a/ports/libzim/cross-builds.diff b/ports/libzim/cross-builds.diff index 0916513f91..8e3b4679ad 100644 --- a/ports/libzim/cross-builds.diff +++ b/ports/libzim/cross-builds.diff @@ -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' diff --git a/ports/libzim/disable-gtest.diff b/ports/libzim/disable-gtest.diff deleted file mode 100644 index 7609c09c83..0000000000 --- a/ports/libzim/disable-gtest.diff +++ /dev/null @@ -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') - diff --git a/ports/libzim/dllexport.diff b/ports/libzim/dllexport.diff index d643f41102..212eb9e541 100644 --- a/ports/libzim/dllexport.diff +++ b/ports/libzim/dllexport.diff @@ -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 -+ -+#if defined(LIBZIM_DLL) && defined(LIBZIM_BUILDING_LIBRARY) + #include + +-#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 -- - 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, diff --git a/ports/libzim/portfile.cmake b/ports/libzim/portfile.cmake index 85b0bf595a..c1a751a4b6 100644 --- a/ports/libzim/portfile.cmake +++ b/ports/libzim/portfile.cmake @@ -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") diff --git a/ports/libzim/subdirs.diff b/ports/libzim/subdirs.diff new file mode 100644 index 0000000000..a30a1444fa --- /dev/null +++ b/ports/libzim/subdirs.diff @@ -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, diff --git a/ports/libzim/vcpkg.json b/ports/libzim/vcpkg.json index 58a4f0efbd..53ab0e0a25 100644 --- a/ports/libzim/vcpkg.json +++ b/ports/libzim/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index 658e40fc44..fb41666c9b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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", diff --git a/versions/l-/libzim.json b/versions/l-/libzim.json index 9f7021ecb7..5aa24ca124 100644 --- a/versions/l-/libzim.json +++ b/versions/l-/libzim.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "1b50ef00c5ff7e2ba8f3b064c8ffe6eb14a74f28", + "version": "9.0.0", + "port-version": 0 + }, { "git-tree": "96c23c527ace6213975b81955373f37d96977063", "version": "8.2.0",