@@ -20,29 +20,39 @@ apt-get -y install --no-install-recommends \
20
20
libncursesw5-dev \
21
21
tk-dev \
22
22
libffi-dev \
23
- liblzma-dev
23
+ liblzma-dev \
24
+ libcrypt-dev \
25
+ libgdbm-dev
24
26
EOF
25
27
WORKDIR /tmp/python
26
28
ARG name
27
29
ARG version
28
30
RUN <<EOF
29
31
curl --silent --location "https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz" \
30
32
| tar --extract --xz --strip-components=1
33
+ EOF
34
+ COPY Setup Modules/
35
+ RUN <<EOF
31
36
./configure \
32
37
--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
44
52
"${prefix}${target}/bin/pip" install \
45
- venv \
46
53
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}/|#\!/|" {} \;
48
58
EOF
0 commit comments