Skip to content

Commit ac5c0a7

Browse files
committed
wip
1 parent 46300b2 commit ac5c0a7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

scripts/build-postgres-debian.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,27 @@ $DOCKER_OPTS $IMG_NAME /bin/bash -ex -c 'echo "Starting building postgres binari
155155
&& curl -sL "https://github.com/pgRouting/pgrouting/archive/v$PGROUTING_VERSION.tar.gz" | tar -xzf - -C /usr/src/pgrouting --strip-components 1 \
156156
&& cd /usr/src/pgrouting && mkdir build && cd build \
157157
&& cmake -DWITH_DOC=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/pg-build .. \
158-
&& make \
158+
&& make -j$(nproc) \
159159
&& make install \
160160
; fi \
161161
\
162162
&& if [ -n "$PGVECTOR_VERSION" ]; then \
163163
echo "Building pgvector v$PGVECTOR_VERSION" \
164+
&& rm -rf /usr/src/pgvector \
164165
&& mkdir -p /usr/src/pgvector \
165-
&& curl -sL "https://github.com/pgvector/pgvector/archive/refs/tags/v$PGVECTOR_VERSION.tar.gz" | tar -xzf - -C /usr/src \
166-
&& mv /usr/src/pgvector-* /usr/src/pgvector \
166+
&& curl -sL "https://github.com/pgvector/pgvector/archive/refs/tags/v$PGVECTOR_VERSION.tar.gz" | tar -xzf - -C /usr/src/pgvector --strip-components 1 \
167167
&& cd /usr/src/pgvector \
168168
&& make USE_PGXS=1 PG_CONFIG=/usr/local/pg-build/bin/pg_config \
169169
&& make USE_PGXS=1 PG_CONFIG=/usr/local/pg-build/bin/pg_config install \
170170
; fi \
171171
\
172172
&& cd /usr/local/pg-build \
173-
&& cp /usr/lib/libossp-uuid.so.16 ./lib || cp /usr/lib/*/libossp-uuid.so.16 ./lib \
174-
&& cp /lib/*/libz.so.1 /lib/*/liblzma.so.5 /usr/lib/*/libxml2.so.2 /usr/lib/*/libxslt.so.1 ./lib \
175-
&& cp /lib/*/libssl.so.1* /lib/*/libcrypto.so.1* ./lib || cp /usr/lib/*/libssl.so.1* /usr/lib/*/libcrypto.so.1* ./lib \
176-
&& if [ "$ICU_ENABLED" = true ]; then cp --no-dereference /usr/lib/*/libicudata.so* /usr/lib/*/libicuuc.so* /usr/lib/*/libicui18n.so* ./lib; fi \
177-
&& if [ -n "$POSTGIS_VERSION" ]; then cp --no-dereference /lib/*/libjson-c.so* /usr/lib/*/libsqlite3.so* ./lib ; fi \
173+
&& mkdir -p ./lib \
174+
&& if [ -f /usr/lib/libossp-uuid.so.16 ]; then cp /usr/lib/libossp-uuid.so.16 ./lib/; else cp /usr/lib/*/libossp-uuid.so.16 ./lib/; fi \
175+
&& cp /lib/*/libz.so.1 /lib/*/liblzma.so.5 /usr/lib/*/libxml2.so.2 /usr/lib/*/libxslt.so.1 ./lib/ \
176+
&& if ls /lib/*/libssl.so.1* /lib/*/libcrypto.so.1* >/dev/null 2>&1; then cp /lib/*/libssl.so.1* /lib/*/libcrypto.so.1* ./lib/; else cp /usr/lib/*/libssl.so.1* /usr/lib/*/libcrypto.so.1* ./lib/; fi \
177+
&& if [ "$ICU_ENABLED" = true ]; then cp --no-dereference /usr/lib/*/libicudata.so* /usr/lib/*/libicuuc.so* /usr/lib/*/libicui18n.so* ./lib/; fi \
178+
&& if [ -n "$POSTGIS_VERSION" ]; then cp --no-dereference /lib/*/libjson-c.so* /usr/lib/*/libsqlite3.so* ./lib/ ; fi \
178179
&& find ./bin -type f \( -name "initdb" -o -name "pg_ctl" -o -name "postgres" -o -name "pg_dump" -o -name "pg_dumpall" -o -name "pg_restore" -o -name "pg_isready" -o -name "psql" \) -print0 | xargs -0 -n1 patchelf --set-rpath "\$ORIGIN/../lib" \
179180
&& find ./lib -maxdepth 1 -type f -name "*.so*" -print0 | xargs -0 -n1 patchelf --set-rpath "\$ORIGIN" \
180181
&& find ./lib/postgresql -maxdepth 1 -type f -name "*.so*" -print0 | xargs -0 -n1 patchelf --set-rpath "\$ORIGIN/.." \

0 commit comments

Comments
 (0)