diff --git a/defaults/main.yml b/defaults/main.yml index 5f4385b..9fcdb1b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -63,4 +63,11 @@ python_build_opts: '' python_force_build: False setuptools_force_build: False +# List of patches to download and apply, should be maps with: +# - url +# - basename - base name of the patch (filename to download to) +# - sha1sum - sha1sum check string +# - pargs - patch args (default -p1) +python_patches: [] + # vi:ts=2:sw=2:et:ft=yaml diff --git a/tasks/build.yml b/tasks/build.yml index 6044f07..9dbfb09 100644 --- a/tasks/build.yml +++ b/tasks/build.yml @@ -20,6 +20,17 @@ src="{{python_src_prefix}}/{{python_src_pkg}}" dest="{{python_src_prefix}}" +- name: Patch code + shell: > + #!/bin/bash + set -e + wget -q -O "{{item.basename}}" "{{item.url}}" + echo "{{item.sha1sum}}" | sha1sum + patch {{item.pargs|default('-p1')}} -i "{{item.basename}}" + args: + chdir: "{{python_src_prefix}}" + with_items: "{{python_patches}}" + - name: Check Custom Python binary command: > {{python_bin}} --version