Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 3101287

Browse files
committed
Fixed python #2673
1 parent ef617e6 commit 3101287

File tree

2 files changed

+401
-14
lines changed

2 files changed

+401
-14
lines changed

tools/python/Dockerfile.template

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,39 @@ apt-get -y install --no-install-recommends \
2020
libncursesw5-dev \
2121
tk-dev \
2222
libffi-dev \
23-
liblzma-dev
23+
liblzma-dev \
24+
libcrypt-dev \
25+
libgdbm-dev
2426
EOF
2527
WORKDIR /tmp/python
2628
ARG name
2729
ARG version
2830
RUN <<EOF
2931
curl --silent --location "https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz" \
3032
| tar --extract --xz --strip-components=1
33+
EOF
34+
COPY Setup Modules/
35+
RUN <<EOF
3136
./configure \
3237
--prefix=${prefix}${target} \
33-
--with-system-ffi \
34-
--with-system-expat \
35-
--enable-shared
36-
# --enable-optimizations
37-
make -j4
38-
make install
39-
echo "${prefix}${target}/lib" >/etc/ld.so.conf.d/python.conf
40-
ldconfig
41-
for FILE in python pip idle pydoc; do
42-
ln -sf "${FILE}3" "${prefix}${target}/bin/${FILE}"
43-
done
38+
LDFLAGS="-static" \
39+
--disable-shared
40+
## --enable-optimizations
41+
make LDFLAGS="-static" -j4
42+
make install LDFLAGS="-static" -j4
43+
ln --symbolic --relative --force "${prefix}${target}/bin/python3" "${prefix}${target}/bin/python"
44+
ln --symbolic --relative --force "${prefix}${target}/bin/pip3" "${prefix}${target}/bin/pip"
45+
EOF
46+
RUN <<EOF
47+
"${prefix}${target}/bin/pip" completion --bash >"${prefix}${target}/share/bash-completion/completions/pip"
48+
"${prefix}${target}/bin/pip" completion --fish >"${prefix}${target}/share/fish/vendor_completions.d/pip.fish"
49+
"${prefix}${target}/bin/pip" completion --zsh >"${prefix}${target}/share/zsh/vendor-completions/_pip"
50+
EOF
51+
RUN <<EOF
4452
"${prefix}${target}/bin/pip" install \
45-
venv \
4653
pipx
47-
find "${prefix}${target}/bin/" -type f -executable -exec sed -i "s|#!${prefix}/|#!/|" {} \;
54+
"${prefix}${target}/bin/register-python-argcomplete" pipx >"${prefix}${target}/share/bash-completion/completions/pipx"
55+
"${prefix}${target}/bin/register-python-argcomplete" pipx >"${prefix}${target}/share/fish/vendor_completions.d/pipx.fish"
56+
"${prefix}${target}/bin/register-python-argcomplete" --shell fish pipx >"${prefix}${target}/share/zsh/vendor-completions/_pipx"
57+
find "${prefix}${target}/bin/" -type f -executable -exec sed -i "s|#\!${prefix}/|#\!/|" {} \;
4858
EOF

0 commit comments

Comments
 (0)