-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc50681
commit 4c15bb0
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
FROM debian:bookworm-slim | ||
LABEL maintainer "Dave Curylo <[email protected]>, Michael Hendricks <[email protected]>" | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libtcmalloc-minimal4 \ | ||
libarchive13 \ | ||
libyaml-0-2 \ | ||
libgmp10 \ | ||
libossp-uuid16 \ | ||
libssl3 \ | ||
ca-certificates \ | ||
libdb5.3 \ | ||
libpcre2-8-0 \ | ||
libedit2 \ | ||
libgeos3.11.1 \ | ||
libspatialindex6 \ | ||
unixodbc \ | ||
odbc-postgresql \ | ||
tdsodbc \ | ||
libmariadbclient-dev-compat \ | ||
libsqlite3-0 \ | ||
libserd-0-0 \ | ||
python3 \ | ||
libpython3.11 \ | ||
libraptor2-0 && \ | ||
dpkgArch="$(dpkg --print-architecture)" && \ | ||
rm -rf /var/lib/apt/lists/* | ||
ENV LANG C.UTF-8 | ||
RUN set -eux; \ | ||
SWIPL_VER=9.3.9; \ | ||
SWIPL_CHECKSUM=9c37b1c4714146ad089acdc5badb1e8cb608fd933f1aaeb8337a52beb6d1eb2b; \ | ||
# Removed libgeos-dev libspatialindex-dev because the space pack cannot be built | ||
BUILD_DEPS='make cmake ninja-build gcc g++ wget git pkg-config m4 libtool automake autoconf libarchive-dev libgmp-dev libossp-uuid-dev libpcre2-dev libreadline-dev libedit-dev libssl-dev zlib1g-dev libdb-dev unixodbc-dev libsqlite3-dev libserd-dev libraptor2-dev libyaml-dev libgoogle-perftools-dev libpython3-dev'; \ | ||
dpkgArch="$(dpkg --print-architecture)"; \ | ||
apt-get update; apt-get install -y --no-install-recommends $BUILD_DEPS; rm -rf /var/lib/apt/lists/*; \ | ||
mkdir /tmp/src; \ | ||
cd /tmp/src; \ | ||
wget -q https://www.swi-prolog.org/download/devel/src/swipl-$SWIPL_VER.tar.gz; \ | ||
echo "$SWIPL_CHECKSUM swipl-$SWIPL_VER.tar.gz" >> swipl-$SWIPL_VER.tar.gz-CHECKSUM; \ | ||
sha256sum -c swipl-$SWIPL_VER.tar.gz-CHECKSUM; \ | ||
tar -xzf swipl-$SWIPL_VER.tar.gz; \ | ||
mkdir swipl-$SWIPL_VER/build; \ | ||
cd swipl-$SWIPL_VER/build; \ | ||
cmake -DCMAKE_BUILD_TYPE=PGO \ | ||
-DSWIPL_PACKAGES_X=OFF \ | ||
-DSWIPL_PACKAGES_JAVA=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-G Ninja \ | ||
..; \ | ||
ninja; \ | ||
ninja install; \ | ||
rm -rf /tmp/src; \ | ||
mkdir -p /usr/share/swi-prolog/pack; \ | ||
cd /usr/share/swi-prolog/pack; \ | ||
# usage: install_addin addin-name git-url git-commit | ||
install_addin () { \ | ||
git clone "$2" "$1"; \ | ||
git -C "$1" checkout -q "$3"; \ | ||
# the prosqlite plugin lib directory must be removed? | ||
if [ "$1" = 'prosqlite' ]; then rm -rf "$1/lib"; fi; \ | ||
swipl -g "pack_rebuild($1)" -t halt; \ | ||
find "$1" -mindepth 1 -maxdepth 1 ! -name lib ! -name prolog ! -name pack.pl -exec rm -rf {} +; \ | ||
find "$1" -name .git -exec rm -rf {} +; \ | ||
find "$1" -name '*.so' -exec strip {} +; \ | ||
}; \ | ||
dpkgArch="$(dpkg --print-architecture)"; \ | ||
install_addin prosqlite https://github.com/nicos-angelopoulos/prosqlite.git 95aba2a5c156b831cf2bcfd387f65a9b470280e4; \ | ||
# C++ packages are currently incompatible with 32 bit. Must be upgraded to SWI-cpp2.h when stable. | ||
# libgeos-dev of Debian bookworm is broken: the library does not define the Coordinate constructors nor the inline code to avoid calling these. | ||
# [ "$dpkgArch" = 'armhf' ] || [ "$dpkgArch" = 'armel' ] || install_addin space https://github.com/JanWielemaker/space.git 097687c7b67902704b03f095cc2f1e9.3.91e700; \ | ||
[ "$dpkgArch" = 'armhf' ] || [ "$dpkgArch" = 'armel' ] || install_addin rocksdb https://github.com/JanWielemaker/rocksdb.git a63f1f5650e44c7d40401ed5a8b689aa1caca635; \ | ||
install_addin hdt https://github.com/JanWielemaker/hdt.git 7f2221747ea751a20ad0d7b95aebfd2c99649c1f; \ | ||
[ "$dpkgArch" = 'armhf' ] || [ "$dpkgArch" = 'armel' ] || install_addin rserve_client https://github.com/JanWielemaker/rserve_client.git bdf8962264d65dd8ef6eedf5f00ff0c0f6c52c2f; \ | ||
apt-get purge -y --auto-remove $BUILD_DEPS | ||
CMD ["swipl"] |