diff --git a/ports/libzim/0001-build-share-library.patch b/ports/libzim/0001-build-share-library.patch new file mode 100644 index 00000000000000..b25326b9715cac --- /dev/null +++ b/ports/libzim/0001-build-share-library.patch @@ -0,0 +1,26 @@ +diff --git a/meson.build b/meson.build +index 6862f75..d887f9a 100644 +--- a/meson.build ++++ b/meson.build +@@ -37,8 +37,6 @@ static_linkage = static_linkage or get_option('default_library')=='static' + lzma_dep = dependency('liblzma', static:static_linkage) + if static_linkage + add_project_arguments('-DLZMA_API_STATIC', language: 'cpp') +-else +- private_conf.set('LIBZIM_EXPORT_DLL', true) + endif + + zstd_dep = dependency('libzstd', static:static_linkage) +@@ -59,6 +57,9 @@ pkg_requires = ['liblzma', 'libzstd'] + if build_machine.system() == 'windows' + extra_link_args = ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-licuuc', '-licuin'] + extra_cpp_args = ['-DSORTPP_PASS'] ++ if not static_linkage ++ extra_cpp_args += ['-DLIBZIM_EXPORT_DLL'] ++ endif + else + extra_link_args = [] + extra_cpp_args = [] +-- +2.37.3.windows.1 + diff --git a/ports/libzim/portfile.cmake b/ports/libzim/portfile.cmake new file mode 100644 index 00000000000000..83bfd7fc3b5703 --- /dev/null +++ b/ports/libzim/portfile.cmake @@ -0,0 +1,37 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO openzim/libzim + REF ${VERSION} + SHA512 4554a9237f5167f6f94aad76ef0e847e949c47c6ee2a89bbd6e587da3b3a3e2d0a8b2d03f7a0fbde0e0dc96fb61bf8c115b3ef3cbd7eff5e880f152bee9b29f0 + HEAD_REF main + PATCHES + 0001-build-share-library.patch +) + +set(EXTRA_OPTIONS "") + +if(NOT "xapian" IN_LIST FEATURES) + list(APPEND EXTRA_OPTIONS "-Dwith_xapian=false") +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND EXTRA_OPTIONS "-Dstatic-linkage=false") +else() + list(APPEND EXTRA_OPTIONS "-Dstatic-linkage=true") +endif() + +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -Dexamples=false + ${EXTRA_OPTIONS} +) + +vcpkg_install_meson(ADD_BIN_TO_PATH) + +vcpkg_copy_pdbs() + +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/libzim/vcpkg.json b/ports/libzim/vcpkg.json new file mode 100644 index 00000000000000..c949aaf4fd0d5d --- /dev/null +++ b/ports/libzim/vcpkg.json @@ -0,0 +1,26 @@ +{ + "name": "libzim", + "version": "8.2.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", + "dependencies": [ + "icu", + "liblzma", + { + "name": "vcpkg-tool-meson", + "host": true + }, + "zstd" + ], + "features": { + "xapian": { + "description": "Enable xapian support", + "supports": "!(windows & !mingw)", + "dependencies": [ + "xapian" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 7827520e46d89d..736c570b80cdee 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4836,6 +4836,10 @@ "baseline": "0.4.41", "port-version": 0 }, + "libzim": { + "baseline": "8.2.0", + "port-version": 0 + }, "libzip": { "baseline": "1.9.2", "port-version": 1 diff --git a/versions/l-/libzim.json b/versions/l-/libzim.json new file mode 100644 index 00000000000000..a0f5cc6ba622b3 --- /dev/null +++ b/versions/l-/libzim.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "93b2790850e120148daf03563e24e6ed3ee9e02e", + "version": "8.2.0", + "port-version": 0 + } + ] +}