Skip to content

Commit

Permalink
Build curl with openssl & set CURL_CA_BUNDLE
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Aug 15, 2020
1 parent 023d1ed commit 4902187
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=3.8
- MB_ML_VER=1
- os: linux
env:
env:
- MB_PYTHON_VERSION=3.8
- PLAT=i686
- MB_ML_VER=1
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- MB_ML_VER=1
- os: osx
language: generic
env:
Expand Down
55 changes: 44 additions & 11 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
suppress build_nghttp2
CFLAGS="$CFLAGS -g -O2"
CXXFLAGS="$CXXFLAGS -g -O2"
local flags="--prefix=$BUILD_PREFIX --with-nghttp2=$BUILD_PREFIX"
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,8 +58,11 @@ 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} \
#fetch_unpack https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz
#cd proj-${PROJ_VERSION:0:5}
fetch_unpack https://github.com/snowman2/PROJ/archive/ssl.zip
(cd PROJ-ssl \
&& sh autogen.sh \
&& ./configure --prefix=$PROJ_DIR --with-curl=${BUILD_PREFIX}/bin/curl-config \
&& make -j4 \
&& make install)
Expand All @@ -41,11 +73,13 @@ 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

fetch_unpack https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz
# Remove previously installed curl.
rm -rf /usr/local/lib/libcurl*
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 +90,14 @@ 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"
python -m pip install certifi
export PROJ_CURL_CA_BUNDLE=$(python -m certifi)
# 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 4902187

Please sign in to comment.