Skip to content

Commit

Permalink
Refactor templating for better consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Mar 1, 2022
1 parent c3b9e88 commit fc08343
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 37 deletions.
2 changes: 1 addition & 1 deletion 3.7/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 30 additions & 25 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -116,35 +116,40 @@ RUN set -eux; \
{{ cmd }} --version; \
\
{{ if is_3 then ( -}}
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+
cd {{ lib_pypy }}; \
if [ -f _gdbm_build.py ]; then \
{{ if is_slim then ( -}}
apt-get install -y --no-install-recommends gcc libc6-dev libgdbm-dev; \
{{ ) else "" end -}}
{{ cmd }} _gdbm_build.py; \
fi; \
# https://github.com/docker-library/pypy/issues/24#issuecomment-409408657
if [ -f _ssl_build.py ]; then \
{{ if is_slim then ( -}}
apt-get install -y --no-install-recommends gcc libc6-dev libssl-dev; \
{{ ) else "" end -}}
{{ cmd }} _ssl_build.py; \
fi; \
# https://github.com/docker-library/pypy/issues/42
if [ -f _lzma_build.py ]; then \
{{ if is_slim then ( -}}
apt-get install -y --no-install-recommends gcc libc6-dev liblzma-dev; \
{{ ) else "" end -}}
{{ cmd }} _lzma_build.py; \
fi; \
# https://github.com/docker-library/pypy/issues/68
if [ -f _sqlite3_build.py ]; then \
{{
[
{
comment: "on pypy3, rebuild gdbm ffi bits for compatibility with Debian Stretch+",
file: "_gdbm_build.py",
deps: "libgdbm-dev",
},
{
comment: "https://github.com/docker-library/pypy/issues/24#issuecomment-409408657",
file: "_ssl_build.py",
deps: "libssl-dev",
},
{
comment: "https://github.com/docker-library/pypy/issues/42",
file: "_lzma_build.py",
deps: "liblzma-dev",
},
{
comment: "https://github.com/docker-library/pypy/issues/68",
file: "_sqlite3_build.py",
deps: "libsqlite3-dev",
},
empty # trailing comma hack
] | map(
-}}
# {{ .comment }}
if [ -f {{ .file }} ]; then \
{{ if is_slim then ( -}}
apt-get install -y --no-install-recommends gcc libc6-dev libsqlite3-dev; \
apt-get install -y --no-install-recommends gcc libc6-dev {{ .deps }}; \
{{ ) else "" end -}}
{{ cmd }} _sqlite3_build.py; \
{{ cmd }} {{ .file }}; \
fi; \
{{ ) | join("") -}}
# TODO rebuild other cffi modules here too? (other _*_build.py files)
\
{{ ) else "" end -}}
Expand Down

0 comments on commit fc08343

Please sign in to comment.