This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-opt-python.yaml
61 lines (50 loc) · 1.6 KB
/
make-opt-python.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
# Ensures git submodules are up to date, configures them, and builds them,
# and installs them on the current machine.
#
# Installation is required so Python can link against the installed OpenSSL
- hosts: all
vars:
VARIANT_NAME: "{{ lookup('env','USER') }}-python"
INSTALL_DIR: "/opt/{{ VARIANT_NAME }}"
INSTALLED_LIB_DIR: "{{ INSTALL_DIR }}/lib"
INSTALLED_INCLUDE_DIR: "{{ INSTALL_DIR }}/include"
environment:
LD_RUN_PATH: "{{ INSTALLED_LIB_DIR }}"
tasks:
# Tricky to use git submodule here, as that doesn't offer a way to ensure
# that submodules are up to date without also updating the host repo
- name: Ensure git submodules are up to date
command:
git submodule update --init --recursive
args:
warn: false
register: git_result
changed_when: '"checked out" in git_result.stdout'
- name: Configure OpenSSL
command:
./config shared --prefix={{ INSTALL_DIR }}
args:
chdir: sources/openssl
- name: Build OpenSSL
make:
chdir: sources/openssl
- name: Install OpenSSL
make:
chdir: sources/openssl
target: install_sw
become: yes
# TODO: Pass --enable-optimizations to the CPython configure call
- name: Configure CPython
command:
./configure --prefix={{ INSTALL_DIR }} --with-openssl={{ INSTALL_DIR }}
args:
chdir: sources/cpython
- name: Build CPython
make:
chdir: sources/cpython
- name: Install CPython
make:
chdir: sources/cpython
target: install
become: yes