Commit 1b069e81 authored by Matthew Brett's avatar Matthew Brett
Browse files

Refactor lib builders to be cross platform

parent 30aefa0a
......@@ -4,6 +4,7 @@
set -e
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
if [ $(uname) == "Darwin" ]; then IS_OSX=1; fi
function abspath {
python -c "import os.path; print(os.path.abspath('$1'))"
......
......@@ -17,7 +17,7 @@ WHEEL_SDIR=${WHEEL_SDIR:-wheelhouse}
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
# This next also sources common utils.
source $MULTIBUILD_DIR/manylinux_utils.sh
source $MULTIBUILD_DIR/docker_lib_builders.sh
source $MULTIBUILD_DIR/library_builders.sh
# Set PATH for chosen Python, Unicode width
export PATH="$(cpython_path $PYTHON_VERSION $UNICODE_WIDTH)/bin:$PATH"
......
......@@ -13,6 +13,11 @@ XZ_VERSION="${XZ_VERSION:-5.2.2}"
LIBYAML_VERSION="${LIBYAML_VERSION:-0.1.5}"
OPENBLAS_VERSION="${OPENBLAS_VERSION:-0.2.18}"
if [ $(uname) == "Darwin" ]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"}
export CFLAGS="${CFLAGS} $ARCH_FLAGS"
IS_OSX=1
fi
function build_simple {
local name=$1
......@@ -42,7 +47,8 @@ function build_openblas {
function build_zlib {
# Gives an old but safe version
if [ -e zlib-stamp ]; then return; fi
yum install -y zlib-devel
# OSX has zlib already
if [ -z "$IS_OSX" ]; then yum install -y zlib-devel; fi
touch zlib-stamp
}
......@@ -82,7 +88,11 @@ function build_tiff {
function build_openjpeg {
if [ -e openjpeg-stamp ]; then return; fi
yum install -y cmake28
if [ -n "$IS_OSX" ]; then
brew install cmake
else
yum install -y cmake28
fi
curl -LO https://github.com/uclouvain/openjpeg/archive/version.${OPENJPEG_VERSION}.tar.gz
tar zxf version.${OPENJPEG_VERSION}.tar.gz
(cd openjpeg-version.${OPENJPEG_VERSION} && cmake28 . && make install)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment