From 24e887cb095878fc4d6a8632c368c7e033276832 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Fri, 20 Dec 2024 17:10:38 -0500 Subject: [PATCH] Add zhparser --- contrib/zhparser/Dockerfile | 19 +++++++++++++++++++ contrib/zhparser/Trunk.toml | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 contrib/zhparser/Dockerfile create mode 100644 contrib/zhparser/Trunk.toml diff --git a/contrib/zhparser/Dockerfile b/contrib/zhparser/Dockerfile new file mode 100644 index 00000000..e162e718 --- /dev/null +++ b/contrib/zhparser/Dockerfile @@ -0,0 +1,19 @@ +ARG PG_VERSION +FROM quay.io/coredb/c-builder:pg${PG_VERSION} + +# Install dependency. +USER root +RUN wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2 \ + && tar xvf scws-1.2.3.tar.bz2 \ + && cd scws-1.2.3 \ + && ./configure \ + && make install \ + && cd .. \ + && rm -rf scws-1.2.3.tar.bz2 scws-1.2.3 \ + && ln -s /usr/local/lib/libscws.so /usr/lib/x86_64-linux-gnu/libscws.so + +# Clone and build the extension. +ARG EXTENSION_NAME +ARG EXTENSION_VERSION +RUN git clone --depth 1 --branch "V$(perl -E 'print shift =~ s/[.]0$//gr' "${EXTENSION_VERSION}")" https://github.com/amutu/${EXTENSION_NAME}.git \ + && make -C ${EXTENSION_NAME} diff --git a/contrib/zhparser/Trunk.toml b/contrib/zhparser/Trunk.toml new file mode 100644 index 00000000..9763c0dc --- /dev/null +++ b/contrib/zhparser/Trunk.toml @@ -0,0 +1,17 @@ +[extension] +name = "zhparser" +version = "2.2.0" +repository = "https://github.com/amutu/zhparser" +license = "PostgreSQL" +description = "PostgreSQL extension for full-text search of Chinese language." +documentation = "https://github.com/amutu/zhparser" +categories = ["search"] + +[dependencies] +apt = ["libc6"] + +[build] +postgres_version = "17" +platform = "linux/amd64" +dockerfile = "Dockerfile" +install_command = "make -C zhparser install"