Date: Mon, 13 Jan 2025 18:04:52 GMT From: Olivier Certner <olce@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: d761d9fdd64e - main - archivers/zim-tools: New port: Command-line tools for ZIM files Message-ID: <202501131804.50DI4qLo088872@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/ports/commit/?id=d761d9fdd64e2e0ea9ce21c474febcf193a8e5da commit d761d9fdd64e2e0ea9ce21c474febcf193a8e5da Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2025-01-13 16:03:51 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2025-01-13 18:04:23 +0000 archivers/zim-tools: New port: Command-line tools for ZIM files Sponsored by: The FreeBSD Foundation --- archivers/zim-tools/Makefile | 27 +++++++++++++++++++ archivers/zim-tools/distinfo | 3 +++ archivers/zim-tools/files/patch-meson.build | 16 ++++++++++++ .../zim-tools/files/patch-src_zimcheck_meson.build | 30 ++++++++++++++++++++++ archivers/zim-tools/pkg-descr | 14 ++++++++++ archivers/zim-tools/pkg-plist | 9 +++++++ 6 files changed, 99 insertions(+) diff --git a/archivers/zim-tools/Makefile b/archivers/zim-tools/Makefile new file mode 100644 index 000000000000..fa4f735ec98c --- /dev/null +++ b/archivers/zim-tools/Makefile @@ -0,0 +1,27 @@ +PORTNAME= zim-tools +DISTVERSION= 3.5.0 +CATEGORIES= archivers +MASTER_SITES= https://download.openzim.org/release/zim-tools/ + +MAINTAINER= olce.freebsd.ports@certner.fr +COMMENT= Tools for handling ZIM files +WWW= https://github.com/openzim/zim-tools + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${LOCALBASE}/include/kainjow/mustache.hpp:devel/mustache \ + googletest>0:devel/googletest +LIB_DEPENDS= libdocopt.so:devel/docopt.cpp \ + libgumbo.so:devel/gumbo \ + libicui18n.so:devel/icu \ + libzim.so:devel/libzim + +USES= compiler:c++17-lang meson pkgconfig tar:xz + +CPPFLAGS+= -I${LOCALBASE}/include/kainjow +CXXFLAGS+= -I${LOCALBASE}/include/kainjow + +PLIST_SUB= DISTVERSION=${DISTVERSION} DISTMAJ=${DISTVERSION:C/\..*//} + +.include <bsd.port.mk> diff --git a/archivers/zim-tools/distinfo b/archivers/zim-tools/distinfo new file mode 100644 index 000000000000..ed595cf30b04 --- /dev/null +++ b/archivers/zim-tools/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1736766185 +SHA256 (zim-tools-3.5.0.tar.xz) = cdf5ab5ca0c58150c7f3069462e09d49c1588e985ff1be817ef2a2888cbf83d0 +SIZE (zim-tools-3.5.0.tar.xz) = 230416 diff --git a/archivers/zim-tools/files/patch-meson.build b/archivers/zim-tools/files/patch-meson.build new file mode 100644 index 000000000000..b913095ecb3b --- /dev/null +++ b/archivers/zim-tools/files/patch-meson.build @@ -0,0 +1,16 @@ +--- meson.build.orig 2024-09-08 18:40:36 UTC ++++ meson.build +@@ -17,10 +17,10 @@ endif + endif + endif + +-libzim_dep = dependency('libzim', version:'>=9.2.0', static:static_linkage) +-libzim_dep = dependency('libzim', version:'<10.0.0', static:static_linkage) ++libzim_dep = dependency('libzim', version:['>=9.2.0', '<10.0.0'], static:static_linkage) + +-with_xapian_support = compiler.has_header_symbol('zim/zim.h', 'LIBZIM_WITH_XAPIAN') ++with_xapian_support = compiler.has_header_symbol( ++ 'zim/zim.h', 'LIBZIM_WITH_XAPIAN', dependencies: libzim_dep) + + find_library_in_compiler = meson.version().version_compare('>=0.31.0') + rt_dep = dependency('rt', required:false) diff --git a/archivers/zim-tools/files/patch-src_zimcheck_meson.build b/archivers/zim-tools/files/patch-src_zimcheck_meson.build new file mode 100644 index 000000000000..e458ce1b224f --- /dev/null +++ b/archivers/zim-tools/files/patch-src_zimcheck_meson.build @@ -0,0 +1,30 @@ +--- src/zimcheck/meson.build.orig 2024-09-08 18:40:36 UTC ++++ src/zimcheck/meson.build +@@ -8,11 +8,13 @@ inc = include_directories(extra_include) + + inc = include_directories(extra_include) + +-if compiler.get_id() == 'gcc' and host_machine.system() == 'linux' +- # C++ std::thread is implemented using pthread on linux by gcc +- thread_dep = dependency('threads') +-else +- thread_dep = dependency('', required:false) ++zimcheck_deps = [libzim_dep, icu_dep, docopt_dep] ++ ++# C++ std::thread is implemented using pthread on Linux by GCC, and on FreeBSD ++# for both GCC and LLVM. ++if (host_machine.system() == 'linux' and compiler.get_id() == 'gcc') or \ ++ host_machine.system() == 'freebsd' ++ zimcheck_deps += dependency('threads') + endif + + executable('zimcheck', +@@ -23,7 +25,5 @@ executable('zimcheck', + '../tools.cpp', + '../metadata.cpp', + include_directories : inc, +- dependencies: [libzim_dep, icu_dep, thread_dep, docopt_dep], ++ dependencies: zimcheck_deps, + install: true) +- +- diff --git a/archivers/zim-tools/pkg-descr b/archivers/zim-tools/pkg-descr new file mode 100644 index 000000000000..212253ff31d1 --- /dev/null +++ b/archivers/zim-tools/pkg-descr @@ -0,0 +1,14 @@ +Various command line tools for handling ZIM files (see devel/libzim). + +Notable tools are: +- 'zimcheck' verifies that a given ZIM file is not corrupted. It provides many + features to secure that ZIM entries are proper and properly linked. +- 'zimdump' inspects or dumps (part of) a ZIM file. +- 'zimsplit' splits smartly a ZIM file in smaller chunks. +- 'zimwriterfs' creates ZIM files from a locally-stored directory containing + "self-sufficient" HTML content (with pictures, javascript and stylesheets). + The result will contain all the files of the local directory compressed and + merged in the ZIM file. The generated file can be opened with a ZIM reader; + Kiwix is one example, but there are others. + +A few other tools are provided as well. diff --git a/archivers/zim-tools/pkg-plist b/archivers/zim-tools/pkg-plist new file mode 100644 index 000000000000..72bed9935d5e --- /dev/null +++ b/archivers/zim-tools/pkg-plist @@ -0,0 +1,9 @@ +bin/zimbench +bin/zimcheck +bin/zimdiff +bin/zimdump +bin/zimpatch +bin/zimrecreate +bin/zimsearch +bin/zimsplit +bin/zimwriterfs
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501131804.50DI4qLo088872>