|
| 1 | +#!/usr/bin/env bash -ve |
| 2 | +# |
| 3 | +# Use this to make binary wheels for OSX |
| 4 | +# |
| 5 | +# |
| 6 | +# this script uses homebrew, install with: |
| 7 | +# |
| 8 | +# $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" |
| 9 | +# |
| 10 | +# |
| 11 | +# then install some requirements: |
| 12 | +# |
| 13 | +# $ brew install cmake bison openssl pyenv readline bzip2 |
| 14 | +# |
| 15 | + |
| 16 | +# some settings and variables |
| 17 | +PYTHONS=(3.6.10 3.7.7 3.8.3 3.9.0b3) # pypy3.6-7.3.1 |
| 18 | +BRANCH=oscar |
| 19 | +HERE="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" |
| 20 | +BUILD=${HERE}/build |
| 21 | +SRC=${BUILD}/MonetDB-${BRANCH} |
| 22 | +PREFIX=${BUILD}/monetdb |
| 23 | + |
| 24 | +# make sure the pythons are installed |
| 25 | +for p in ${PYTHONS[@]}; do |
| 26 | + pyenv install -s ${p} |
| 27 | +done |
| 28 | + |
| 29 | +# prepare for monetdb build |
| 30 | +mkdir -p ${BUILD} |
| 31 | +cd ${BUILD} |
| 32 | + |
| 33 | +# download and install monetdb |
| 34 | +if [ ! -f ${BRANCH}.tar.bz2 ]; then |
| 35 | + curl -O -C - https://dev.monetdb.org/hg/MonetDB/archive/${BRANCH}.tar.bz2 |
| 36 | +fi |
| 37 | + |
| 38 | +if [ ! -d ${SRC} ]; then |
| 39 | + tar jxvf ${BRANCH}.tar.bz2 |
| 40 | +fi |
| 41 | + |
| 42 | +mkdir -p ${SRC}/build |
| 43 | +cd ${SRC}/build |
| 44 | +cmake .. -DPY3INTEGRATION=OFF -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison -DCMAKE_INSTALL_PREFIX=${PREFIX} -DINT128=ON -DWITH_CRYPTO=OFF -DCMAKE_BUILD_TYPE=Release -DASSERT=OFF |
| 45 | +rm -rf ${PREFIX} |
| 46 | +make -j5 install |
| 47 | + |
| 48 | +# set some flags to find the monetdb libs |
| 49 | +export CFLAGS="-I${PREFIX}/include -L${PREFIX}/lib" |
| 50 | +export DYLD_LIBRARY_PATH=${PREFIX}/lib |
| 51 | + |
| 52 | +cd ${HERE} |
| 53 | + |
| 54 | +for p in ${PYTHONS[@]}; do |
| 55 | + ~/.pyenv/versions/${p}/bin/pip install wheel |
| 56 | + ~/.pyenv/versions/${p}/bin/python setup.py bdist_wheel |
| 57 | +done |
| 58 | + |
| 59 | +~/.pyenv/versions/${PYTHONS[0]}/bin/pip install delocate |
| 60 | +DYLD_LIBRARY_PATH=${PREFIX}/lib/ ~/.pyenv/versions/${PYTHONS[0]}/bin/delocate-wheel -v dist/*.whl |
0 commit comments