-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to download and compile Python from scratch. Currently, Linux systems will use Python 3.6.6 and Mac OS systems 3.7. Once Python 3.7 compiles without SSL issues on Linux, the version should be bumped so that ideally both operating system versions use the same Python. The Python library is only compiled into a static library so that the final binary should be as portable as possible without the need for Python to be installed in a target environment. Update Travis CI configuration to address the changed pre-reqs. Change the way CFLAGS and LDFLAGS are populated in the Go source file that uses the transpiled C file.
- Loading branch information
1 parent
166ae68
commit ba3a2a7
Showing
5 changed files
with
98 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ internal/**/updateYAML.c | |
internal/**/updateYAML.go | ||
internal/**/__pycache__ | ||
binaries | ||
third_party |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
BASEDIR="$(cd "$(dirname "$0")/.." && pwd)" | ||
|
||
setupDarwin() { | ||
if [[ ! -d "${BASEDIR}/third_party/lib/python" ]]; then | ||
mkdir -p "${BASEDIR}/third_party/src" | ||
pushd "${BASEDIR}/third_party/src" >/dev/null | ||
|
||
curl --silent --location https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz | tar -xzf - | ||
pushd Python-3.7.0 >/dev/null | ||
|
||
./configure --prefix "${BASEDIR}/third_party/lib/python" --disable-shared --with-openssl="$(brew --prefix openssl)" --enable-optimizations | ||
make --jobs | ||
make install | ||
popd >/dev/null | ||
|
||
popd >/dev/null | ||
fi | ||
} | ||
|
||
setupLinux() { | ||
if [[ ! -d "${BASEDIR}/third_party/lib/python" ]]; then | ||
mkdir -p "${BASEDIR}/third_party/src" | ||
pushd "${BASEDIR}/third_party/src" >/dev/null | ||
|
||
curl --silent --location https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz | tar -xJf - | ||
pushd Python-3.6.6 >/dev/null | ||
|
||
./configure --prefix "${BASEDIR}/third_party/lib/python" --disable-shared --enable-optimizations | ||
make --jobs | ||
make install | ||
popd >/dev/null | ||
|
||
popd >/dev/null | ||
fi | ||
} | ||
|
||
case "$(uname)" in | ||
Darwin) | ||
setupDarwin | ||
;; | ||
|
||
Linux) | ||
setupLinux | ||
;; | ||
esac | ||
|
||
if ! (pip3 list | grep ruamel >/dev/null); then | ||
"${BASEDIR}"/third_party/lib/python/bin/pip3 install --user --upgrade \ | ||
'pip' \ | ||
'setuptools' \ | ||
'wheel' \ | ||
'ruamel.yaml<=0.15.42' \ | ||
'cython' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters