Skip to content

Commit

Permalink
Build curl with openssl and nghttp2 & drop manylinux1 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Aug 22, 2020
1 parent 023d1ed commit acc39c4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 42 deletions.
31 changes: 1 addition & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ env:
global:
- REPO_DIR=pyproj
# Commit from your-project that you want to build
- BUILD_COMMIT=56b5bf9
# pip dependencies to _build_ your project
- BUILD_COMMIT=a32fe05 # pip dependencies to _build_ your project
- BUILD_DEPENDS="Cython"
# pip dependencies to _test_ your project. Include any dependencies
# that you need, that are also specified in BUILD_DEPENDS, this will be
Expand Down Expand Up @@ -32,43 +31,15 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- MB_ML_VER=1
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- MB_ML_VER=1
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- MB_ML_VER=1
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- PLAT=i686
- MB_ML_VER=1
- os: linux
env:
- MB_PYTHON_VERSION=3.8
- os: linux
env:
- MB_PYTHON_VERSION=3.8
- MB_ML_VER=1
- os: linux
env:
- MB_PYTHON_VERSION=3.8
- PLAT=i686
- MB_ML_VER=1
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.6
- os: osx
language: generic
env:
Expand Down
51 changes: 39 additions & 12 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,43 @@ PROJ_VERSION=7.1.0
SQLITE_VERSION=3320300
LIBTIFF_VERSION=4.1.0
CURL_VERSION=7.71.1
NGHTTP2_VERSION=1.35.1

export PROJ_WHEEL=true

function build_nghttp2 {
if [ -e nghttp2-stamp ]; then return; fi
fetch_unpack https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz
(cd nghttp2-${NGHTTP2_VERSION} \
&& ./configure --enable-lib-only --prefix=$BUILD_PREFIX \
&& make -j4 \
&& make install)
touch nghttp2-stamp
}

function build_curl {
build_simple curl $CURL_VERSION https://curl.haxx.se/download
function build_curl_ssl {
if [ -e curl-stamp ]; then return; fi
CFLAGS="$CFLAGS -g -O2"
CXXFLAGS="$CXXFLAGS -g -O2"
local flags="--prefix=$BUILD_PREFIX --with-nghttp2=$BUILD_PREFIX --with-zlib=$BUILD_PREFIX"
suppress build_nghttp2
if [ -n "$IS_OSX" ]; then
flags="$flags --with-darwinssl"
else # manylinux
suppress build_openssl
flags="$flags --with-ssl"
fi
fetch_unpack https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz
(cd curl-${CURL_VERSION} \
&& if [ -z "$IS_OSX" ]; then \
LIBS=-ldl ./configure $flags; else \
./configure $flags; fi\
&& make -j4 \
&& make install)
touch curl-stamp
}


function build_libtiff {
build_simple tiff $LIBTIFF_VERSION https://download.osgeo.org/libtiff
}
Expand All @@ -29,9 +58,12 @@ function build_sqlite {

function build_proj {
if [ -e proj-stamp ]; then return; fi
# fetch_unpack https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz
(cd proj-${PROJ_VERSION:0:5} \
&& ./configure --prefix=$PROJ_DIR --with-curl=${BUILD_PREFIX}/bin/curl-config \
#fetch_unpack https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz
#cd proj-${PROJ_VERSION:0:5}
fetch_unpack https://github.com/OSGeo/PROJ/archive/master.zip
(cd PROJ-master \
&& sh autogen.sh \
&& ./configure --prefix=$PROJ_DIR --with-curl=$BUILD_PREFIX/bin/curl-config \
&& make -j4 \
&& make install)
touch proj-stamp
Expand All @@ -41,11 +73,9 @@ function pre_build {
# Any stuff that you need to do before you start building the wheels
# Runs in the root directory of this repository.
suppress build_zlib
suppress build_curl_ssl
suppress build_sqlite
suppress build_libtiff
# unpack early because SSL support not added with custom curl
fetch_unpack https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz
suppress build_curl
export PROJ_DIR=$PWD/pyproj/pyproj/proj_dir
build_proj
if [ -z "$IS_OSX" ]; then
Expand All @@ -56,15 +86,12 @@ function pre_build {

function run_tests {
pyproj -v
pyproj sync --file us_noaa_alaska.tif --verbose
pyproj sync --file us_noaa_emhpgn.tif --verbose
pyproj sync --file us_noaa_conus.tif --verbose
python -m pip install shapely || echo "Shapely install failed"
# Runs tests on installed distribution from an empty directory
python --version
python -c "import pyproj; pyproj.Proj(init='epsg:4269')"
# run all tests
cp -r ../pyproj/test .
python -m pytest -v -s
PROJ_NETWORK=ON python -m pytest -v -s
}

0 comments on commit acc39c4

Please sign in to comment.