From c36d929eb7c2f463a169bf98778623580a655efb Mon Sep 17 00:00:00 2001 From: Evan H Stanton <79367212+EvanHStanton@users.noreply.github.com> Date: Wed, 19 Jul 2023 15:27:03 +0200 Subject: [PATCH] add pg_trgm (#228) Co-authored-by: Evan Stanton --- contrib/pg_trgm/Dockerfile | 28 ++++++++++++++++++++++++++++ contrib/pg_trgm/Trunk.toml | 21 +++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 contrib/pg_trgm/Dockerfile create mode 100644 contrib/pg_trgm/Trunk.toml diff --git a/contrib/pg_trgm/Dockerfile b/contrib/pg_trgm/Dockerfile new file mode 100644 index 00000000..085945e6 --- /dev/null +++ b/contrib/pg_trgm/Dockerfile @@ -0,0 +1,28 @@ +ARG PG_VERSION=15 +FROM quay.io/coredb/c-builder:pg${PG_VERSION} +USER root + +# Extension build dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + libreadline-dev \ + zlib1g-dev \ + flex bison \ + libxml2-dev \ + libxslt-dev \ + libssl-dev \ + libxml2-utils \ + xsltproc \ + ccache + +# Clone repository +RUN git clone https://github.com/postgres/postgres.git + +ARG PG_VERSION=15 + +RUN cd postgres && \ + git fetch origin REL_${PG_VERSION}_STABLE && \ + git checkout REL_${PG_VERSION}_STABLE && \ + ./configure && \ + cd contrib/pg_trgm && \ + make diff --git a/contrib/pg_trgm/Trunk.toml b/contrib/pg_trgm/Trunk.toml new file mode 100644 index 00000000..c4036e11 --- /dev/null +++ b/contrib/pg_trgm/Trunk.toml @@ -0,0 +1,21 @@ +[extension] +name = "pg_trgm" +version = "1.6.0" +repository = "https://github.com/postgres/postgres/tree/master/contrib/pg_trgm" +license = "PostgreSQL" +description = "Text similarity measurement and index searching based on trigrams." +homepage = "https://www.postgresql.org" +documentation = "https://www.postgresql.org/docs/current/pgtrgm.html" +categories = ["search"] + +[build] +postgres_version = "15" +platform = "linux/amd64" +dockerfile = "Dockerfile" +install_command = """ + cd postgres/contrib/pg_trgm && make install + set -x + mv /usr/local/pgsql/share/extension/* /usr/share/postgresql/15/extension + mv /usr/local/pgsql/lib/* /usr/lib/postgresql/15/lib + """ +