diff --git a/devel/Makefile b/devel/Makefile --- a/devel/Makefile +++ b/devel/Makefile @@ -1346,6 +1346,7 @@ SUBDIR += libjodycode SUBDIR += libk8055 SUBDIR += libkiwix + SUBDIR += libkiwix13 SUBDIR += libklel SUBDIR += liblangtag SUBDIR += liblnk diff --git a/devel/libkiwix/Makefile b/devel/libkiwix/Makefile --- a/devel/libkiwix/Makefile +++ b/devel/libkiwix/Makefile @@ -27,6 +27,8 @@ kainjow:Mustache:v4.1:mustache USE_LDCONFIG= yes +CONFLICTS_INSTALL= libkiwix13 + SHEBANG_FILES= scripts/format_code.sh SHEBANG_REGEX= ./scripts/kiwix.*[^.]. diff --git a/devel/libkiwix/Makefile b/devel/libkiwix13/Makefile copy from devel/libkiwix/Makefile copy to devel/libkiwix13/Makefile --- a/devel/libkiwix/Makefile +++ b/devel/libkiwix13/Makefile @@ -1,9 +1,10 @@ PORTNAME= libkiwix DISTVERSION= 13.1.0 CATEGORIES= devel +PKGNAMESUFFIX= 13 MAINTAINER= olce.freebsd.ports@certner.fr -COMMENT= Common code base for all Kiwix ports +COMMENT= Common code base for all Kiwix ports, version 13 WWW= https://www.kiwix.org/ LICENSE= GPLv3+ @@ -27,6 +28,8 @@ kainjow:Mustache:v4.1:mustache USE_LDCONFIG= yes +CONFLICTS_INSTALL= libkiwix + SHEBANG_FILES= scripts/format_code.sh SHEBANG_REGEX= ./scripts/kiwix.*[^.]. diff --git a/devel/libkiwix13/distinfo b/devel/libkiwix13/distinfo new file mode 100644 --- /dev/null +++ b/devel/libkiwix13/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1716196790 +SHA256 (kiwix-libkiwix-13.1.0_GH0.tar.gz) = 04d93f66b939f937df2c941af517966128d4c9872b707f9ed192177fe51364d3 +SIZE (kiwix-libkiwix-13.1.0_GH0.tar.gz) = 1136812 +SHA256 (kainjow-Mustache-v4.1_GH0.tar.gz) = acd66359feb4318b421f9574cfc5a511133a77d916d0b13c7caa3783c0bfe167 +SIZE (kainjow-Mustache-v4.1_GH0.tar.gz) = 98905 diff --git a/devel/libkiwix13/files/patch-meson.build b/devel/libkiwix13/files/patch-meson.build new file mode 100644 --- /dev/null +++ b/devel/libkiwix13/files/patch-meson.build @@ -0,0 +1,52 @@ +Has been upstreamed via https://github.com/kiwix/libkiwix/pull/1173 and will be +included in next release (14.1.0), so remove this patch at next update. + +--- meson.build.orig 2024-10-09 17:18:52 UTC ++++ meson.build +@@ -4,14 +4,40 @@ compiler = meson.get_compiler('cpp') + default_options : ['c_std=c11', 'cpp_std=c++17', 'werror=true']) + + compiler = meson.get_compiler('cpp') +- + static_deps = get_option('static-linkage') or get_option('default_library') == 'static' ++extra_libs = [] + +-# See https://github.com/kiwix/libkiwix/issues/371 +-if ['arm', 'mips', 'm68k', 'ppc', 'sh4'].contains(host_machine.cpu_family()) +- extra_libs = ['-latomic'] +-else +- extra_libs = [] ++# Atomics as compiled by GCC or clang can lead to external references to ++# functions depending on the type size and the platform. LLVM provides them in ++# 'libcompiler_rt', which clang normally automatically links in, while GNU ++# provides them in 'libatomic', which GCC *does not* link in automatically (but ++# this is probably going to change, see ++# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358). Regardless of the setup ++# of the compiler driver itself (GCC or clang), we can thus assume that if some ++# atomic references can't be resolved, then 'libatomic' is missing. ++atomics_program = ''' ++#include ++#include ++ ++using namespace std; ++ ++int main() { ++ volatile atomic_bool a_b = true; ++ volatile atomic_ullong a_ull = -1; ++ // Next two lines are to cover atomic from 'httplib.h'. ++ volatile atomic a_u32 = -1; ++ volatile atomic a_u64 = -1; ++ ++ return atomic_load(&a_b) == false && atomic_load(&a_ull) == 0 && ++ atomic_load(&a_u32) == 0 && atomic_load(&a_u64) == 0; ++} ++''' ++if not compiler.links(atomics_program, ++ name: 'compiler driver readily supports atomics') ++ libatomic = compiler.find_library('atomic') ++ compiler.links(atomics_program, name: 'atomics work with libatomic', ++ dependencies: libatomic, required: true) ++ extra_libs += ['-latomic'] + endif + + if (compiler.get_id() == 'gcc' and build_machine.system() == 'linux') or host_machine.system() == 'freebsd' diff --git a/devel/libkiwix13/pkg-descr b/devel/libkiwix13/pkg-descr new file mode 100644 --- /dev/null +++ b/devel/libkiwix13/pkg-descr @@ -0,0 +1,7 @@ +Kiwix is an offline reader for web content archived in ZIM format. It is +particularly tailored towards Wikipedia and other wikis. + +The Kiwix library contains the code shared by Kiwix ports on all supported +platforms. + +This is version 13, which is required by kiwix-tools 3.7. diff --git a/devel/libkiwix13/pkg-plist b/devel/libkiwix13/pkg-plist new file mode 100644 --- /dev/null +++ b/devel/libkiwix13/pkg-plist @@ -0,0 +1,21 @@ +bin/kiwix-compile-i18n +bin/kiwix-compile-resources +include/kiwix/book.h +include/kiwix/bookmark.h +include/kiwix/common.h +include/kiwix/downloader.h +include/kiwix/kiwix_config.h +include/kiwix/kiwixserve.h +include/kiwix/library.h +include/kiwix/manager.h +include/kiwix/name_mapper.h +include/kiwix/search_renderer.h +include/kiwix/server.h +include/kiwix/tools.h +include/kiwix/version.h +lib/libkiwix.so +lib/libkiwix.so.%%PORTMAJ%% +lib/libkiwix.so.%%PORTVERSION%% +libdata/pkgconfig/kiwix.pc +share/man/man1/kiwix-compile-i18n.1.gz +share/man/man1/kiwix-compile-resources.1.gz