Skip to content

Commit

Permalink
Add postgresbson (#627)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Stanton <[email protected]>
  • Loading branch information
ianstanton authored Jan 17, 2024
1 parent 8ab7934 commit 52ba437
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- dind
- large-8x8
container:
image: quay.io/tembo/trunk-test-tembo:0.0.31
image: quay.io/tembo/trunk-test-tembo:0.0.32
options: --user root
needs:
- find_directories
Expand All @@ -81,7 +81,7 @@ jobs:
- dind
- large-8x8
container:
image: quay.io/tembo/trunk-test-tembo:0.0.31
image: quay.io/tembo/trunk-test-tembo:0.0.32
options: --user root
needs:
- find_directories
Expand Down
16 changes: 16 additions & 0 deletions contrib/postgresbson/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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 \
libbson-dev
# Clone repository
RUN git clone https://github.com/buzzm/postgresbson.git
RUN mkdir -p ~/projects/bson/include
# For some reason these need to be in ~/projects/bson/include/ and postgresbson/
RUN cp -r /usr/include/libbson-1.0/* ~/projects/bson/include/
RUN cp -r /usr/include/libbson-1.0/* postgresbson/

# Replacing BSON_SHLIB with the path to libbson-1.0.so (https://github.com/buzzm/postgresbson/blob/5b442c42642075c43edbfc41c1e2e7e6d1034758/Makefile#L9)
RUN cd postgresbson && make BSON_SHLIB=/usr/lib/x86_64-linux-gnu/libbson-1.0.so
24 changes: 24 additions & 0 deletions contrib/postgresbson/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[extension]
name = "postgresbson"
version = "2.0.0"
repository = "https://github.com/buzzm/postgresbson"
license = "MIT"
description = "This PostgreSQL extension realizes the BSON data type, together with functions to create and inspect BSON objects for the purposes of expressive and performant querying."
homepage = "https://github.com/buzzm/postgresbson"
documentation = "https://github.com/buzzm/postgresbson"
categories = ["data_transformations"]

[dependencies]
apt = ["libc6"]

[build]
postgres_version = "15"
platform = "linux/amd64"
dockerfile = "Dockerfile"
install_command = """
cd postgresbson && 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
"""

1 change: 1 addition & 0 deletions images/trunk-test-tembo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ RUN apt-get update && apt-get install -y \
libsfcgal1 \
openjdk-11-jdk \
libaio1 \
libbson-dev \
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so /usr/lib/x86_64-linux-gnu/libjvm.so
RUN wget https://download.oracle.com/otn_software/linux/instantclient/1920000/instantclient-basiclite-linux.x64-19.20.0.0.0dbru.zip && \
Expand Down

0 comments on commit 52ba437

Please sign in to comment.