RF: switch to using multibuild for OSX

Update to latest multibuild

Remove terryfy submodule.

Adapt config.sh to do OSX-specifics for build.

Add tests for installed codecs and modules.
This commit is contained in:
Matthew Brett 2016-07-31 13:09:20 -07:00
parent 2ee6f328f8
commit 754b609628
7 changed files with 56 additions and 54 deletions

3
.gitmodules vendored
View File

@ -4,6 +4,3 @@
[submodule "multibuild"]
path = multibuild
url = https://github.com/matthew-brett/multibuild.git
[submodule "terryfy"]
path = terryfy
url = https://github.com/MacPython/terryfy.git

View File

@ -54,18 +54,18 @@ matrix:
- MB_PYTHON_VERSION=3.5
- PLAT=i686
- os: osx
language: objective-c
language: generic
env: MB_PYTHON_VERSION=2.7
- os: osx
language: objective-c
language: generic
env:
- MB_PYTHON_VERSION=3.3
- os: osx
language: objective-c
language: generic
env:
- MB_PYTHON_VERSION=3.4
- os: osx
language: objective-c
language: generic
env:
- MB_PYTHON_VERSION=3.5

2
Pillow

@ -1 +1 @@
Subproject commit 4f4c98222914353470336ab7288c1f1876b4b2b7
Subproject commit f54c60c162bb6f97421e4712ca65cfe9f0b3cc94

View File

@ -1,19 +1,44 @@
# Define custom utilities
# Test for OSX with [ -n "$IS_OSX" ]
# Package versions for fresh source builds
FREETYPE_VERSION=2.6.4
LIBPNG_VERSION=1.6.23
ZLIB_VERSION=1.2.8
JPEG_VERSION=9b
OPENJPEG_VERSION=2.1
TIFF_VERSION=4.0.6
LCMS2_VERSION=2.7
LIBWEBP_VERSION=0.5.1
function pre_build {
# Any stuff that you need to do before you start building the wheels
# Runs in the root directory of this repository.
set -e
if [ -n "$IS_OSX" ]; then
source osx_build_deps.sh
# Update to latest zlib for OSX build
build_new_zlib
else # Linux tests may depend on specific versions
FREETYPE_VERSION=2.6.3
fi
build_jpeg
build_tiff
build_libpng
build_openjpeg
if [ -n "$IS_OSX" ]; then
# Fix openjpeg library install id
# https://code.google.com/p/openjpeg/issues/detail?id=367
install_name_tool -id $BUILD_PREFIX/lib/libopenjp2.7.dylib $BUILD_PREFIX/lib/libopenjp2.2.1.0.dylib
fi
build_lcms2
build_libwebp
if [ -n "$IS_OSX" ]; then
# Custom freetype build
local ft_name_ver=freetype-${FREETYPE_VERSION}
fetch_unpack http://download.savannah.gnu.org/releases/freetype/${ft_name_ver}.tar.gz
(cd $ft_name_ver \
&& ./configure --prefix=$BUILD_PREFIX "--with-harfbuzz=no" \
&& make && make install)
else
source multibuild/library_builders.sh
build_jpeg
build_tiff
build_openjpeg
build_lcms2
build_libwebp
build_freetype
fi
}
@ -27,9 +52,26 @@ function run_tests_in_repo {
fi
}
EXP_CODECS="jpg jpg_2000 libtiff zlib"
EXP_MODULES="freetype2 littlecms2 pil tkinter webp"
function run_tests {
# Runs tests on installed distribution from an empty directory
export NOSE_PROCESS_TIMEOUT=600
export NOSE_PROCESSES=0
(cd ../Pillow && run_tests_in_repo)
# Show supported codecs and modules
local codecs=$(python -c 'from PIL.features import *; print(" ".join(sorted(get_supported_codecs())))')
# Test against expected codecs and modules
local ret=0
if [ "$codecs" != "$EXP_CODECS" ]; then
echo "Codecs should be: '$EXP_CODECS'; but are '$codecs'"
ret=1
fi
local modules=$(python -c 'from PIL.features import *; print(" ".join(sorted(get_supported_modules())))')
if [ "$modules" != "$EXP_MODULES" ]; then
echo "Modules should be: '$EXP_MODULES'; but are '$modules'"
ret=1
fi
return $ret
}

@ -1 +1 @@
Subproject commit d7ba4ae3e76af2a6ea13d3c83ddea41d8c2e1cad
Subproject commit db8f384596bbe436efdfa205f181f6c5209abbc4

View File

@ -1,36 +0,0 @@
# Script for building Pillow dependencies on OSX
source terryfy/library_installers.sh
# Compiler
export CC=clang
export CXX=clang++
# Package versions for fresh source builds
FT_VERSION=2.6.4
PNG_VERSION=1.6.23
ZLIB_VERSION=1.2.8
JPEG_VERSION=9b
OPENJPEG_VERSION=2.1.0
TIFF_VERSION=4.0.6
LCMS_VERSION=2.7
WEBP_VERSION=0.5.1
# Need cmake for openjpeg
brew install cmake
# Need pkg-config for freetype to find libpng
brew install pkg-config
# Set up build
clean_builds
clean_submodule Pillow
standard_install zlib $ZLIB_VERSION .tar.xz
standard_install jpeg $JPEG_VERSION .tar.gz jpegsrc.v
standard_install tiff $TIFF_VERSION
standard_install libpng $PNG_VERSION
standard_install lcms2 $LCMS_VERSION
WEBP_EXTRAS="--enable-libwebpmux --enable-libwebpdemux"
standard_install libwebp $WEBP_VERSION .tar.gz libwebp- "$WEBP_EXTRAS"
standard_install openjpeg $OPENJPEG_VERSION .tar.gz openjpeg- cmake
# Fix openjpeg library install id
# https://code.google.com/p/openjpeg/issues/detail?id=367
install_name_tool -id $PWD/build/lib/libopenjp2.7.dylib build/lib/libopenjp2.2.1.0.dylib
standard_install freetype $FT_VERSION .tar.gz freetype- "--with-harfbuzz=no"

@ -1 +0,0 @@
Subproject commit 48785a36b56e17a53def971153bd775aae230eba