Skip to content

Commit b3f7c55

Browse files
committed
Add swig
1 parent f893d1e commit b3f7c55

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

docker/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ RUN export CMAKE_VERSION=3.18.3 && \
7878
manylinux-entrypoint /build_scripts/build-cmake.sh
7979

8080

81+
FROM build_base AS build_swig
82+
COPY build_scripts/build-swig.sh /build_scripts/
83+
RUN export SWIG_ROOT=swig-4.0.2 && \
84+
export SWIG_HASH=d53be9730d8d58a16bf0cbd1f8ac0c0c3e1090573168bfa151b01eb47fa906fc && \
85+
export SWIG_DOWNLOAD_URL=https://sourceforge.net/projects/swig/files/swig/${SWIG_ROOT} && \
86+
export PCRE_ROOT=pcre-8.44 && \
87+
export PCRE_HASH=aecafd4af3bd0f3935721af77b889d9024b2e01d96b58471bd91a3063fb47728 && \
88+
export PCRE_DOWNLOAD_URL=https://ftp.pcre.org/pub/pcre && \
89+
manylinux-entrypoint /build_scripts/build-swig.sh
90+
91+
8192
FROM build_base AS build_cpython
8293
COPY build_scripts/build-sqlite3.sh /build_scripts/
8394
RUN export SQLITE_AUTOCONF_ROOT=sqlite-autoconf-3340000 && \
@@ -130,6 +141,7 @@ RUN hardlink -cv /opt/_internal
130141
FROM runtime_base
131142
COPY --from=build_git /manylinux-rootfs /
132143
COPY --from=build_cmake /manylinux-rootfs /
144+
COPY --from=build_swig /manylinux-rootfs /
133145
COPY --from=build_cpython /manylinux-rootfs /
134146
COPY --from=all_cpython /opt/_internal /opt/_internal/
135147
COPY build_scripts/finalize.sh /build_scripts/finalize.sh

docker/build_scripts/build-swig.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
# Top-level build script called from Dockerfile
3+
4+
# Stop at any error, show all commands
5+
set -exuo pipefail
6+
7+
# Get script directory
8+
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
9+
10+
# Get build utilities
11+
source $MY_DIR/build_utils.sh
12+
13+
# Install newest swig
14+
check_var ${SWIG_ROOT}
15+
check_var ${SWIG_HASH}
16+
check_var ${SWIG_DOWNLOAD_URL}
17+
check_var ${PCRE_ROOT}
18+
check_var ${PCRE_HASH}
19+
check_var ${PCRE_DOWNLOAD_URL}
20+
21+
fetch_source ${SWIG_ROOT}.tar.gz ${SWIG_DOWNLOAD_URL}
22+
check_sha256sum ${SWIG_ROOT}.tar.gz ${SWIG_HASH}
23+
tar -xzf ${SWIG_ROOT}.tar.gz
24+
pushd ${SWIG_ROOT}
25+
fetch_source ${PCRE_ROOT}.tar.gz ${PCRE_DOWNLOAD_URL}
26+
check_sha256sum ${PCRE_ROOT}.tar.gz ${PCRE_HASH}
27+
./Tools/pcre-build.sh
28+
./configure
29+
make -j$(nproc)
30+
make install DESTDIR=/manylinux-rootfs
31+
popd
32+
rm -rf ${SWIG_ROOT}*
33+
34+
# Strip what we can
35+
strip_ /manylinux-rootfs
36+
37+
# Install
38+
cp -rf /manylinux-rootfs/* /
39+
40+
swig -version

0 commit comments

Comments
 (0)