Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hardcode references to MacOSX10.12.sdk #198

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5a6896f
mapnik 3.0.x compatibility branch
artemp Jan 19, 2017
ebce780
setup: install mapnik.printing
asbjornst Nov 11, 2016
8139e5c
printing: Update documentation and test
asbjornst Nov 11, 2016
d7fc489
fix postgis test
lightmare Feb 20, 2017
2b35590
better namings
artemp Mar 23, 2017
37f46e5
GeoJSON IO test - valid/invalid "empty" geometries test.
artemp Mar 23, 2017
3096fee
Remove `visibility=hidden` from compilation flags (fixes #148)
artemp May 4, 2017
1635afe
update FontEngine implementation
artemp Jun 2, 2017
541ae9d
attempt to build against mapnik 3.0.13 mason package
Mar 19, 2017
64a18f4
use latest mapnik 3.0.x package that disables the soname
May 4, 2017
2216c1e
upgrade mason and method used to install mason
May 4, 2017
794d6d2
fix mason install
May 4, 2017
7f39f6e
update to latest mason release
May 4, 2017
807c937
add -Qunused-arguments to CC as well to avoid verbose build warnings
May 4, 2017
e859c66
remove crash handling to make it easier to see errors in logs
May 4, 2017
67ea229
add postgis, remove unused 3rd arg
Jun 20, 2017
4b5e533
update for mapnik 3.0.15
Jun 20, 2017
01e5607
fix package_data
Jun 20, 2017
c582fb1
ensure we copy libmapnik too
Jun 20, 2017
6833fe1
update pgraster test fixtures - refs #155
Jun 20, 2017
15213d3
use postgres/postgis from mason, test on osx
Jun 20, 2017
d9183fc
ensure mason-config.env is created anew
Jun 20, 2017
8579cbd
move tests to script so they all run through
Jun 20, 2017
21b7c79
update to mapnik v3.0.15 test data
Jun 20, 2017
728f98a
load everything into the template_postgis db
Jun 20, 2017
f39a2b8
run postgres on alt host/port to avoid conflicting with travis instal…
Jun 20, 2017
0cd7493
Merge pull request #144 from mapnik/v3.0.x-mason
springmeyer Jun 21, 2017
1fcd05f
Fix python3 compatible in printing.
winsento Jan 29, 2018
804a794
Merge pull request #178 from winsento/winsento-printing-python3
artemp Jan 30, 2018
fe47aa1
Convert to numeric values to target types in __setitem__ (ref #3746)
artemp Apr 11, 2018
d858f87
Avoid redefining Pycairo_CAPI
tomhughes Jul 23, 2018
588fc90
Merge pull request #190 from tomhughes/pycairo
talaj Jul 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 15 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
language: generic

git:
submodules: true
depth: 10

addons:
postgresql: "9.4"

matrix:
include:
- os: linux
sudo: false
compiler: ": clang"
compiler: clang
# note: only using ccache for CC is intentional here to
# workaround an odd bug in distutils that manifests when only `ccache` is used to link
# because distutils also has a bug whereby CC is used to compile instead of CXX, this works :)
env: JOBS=8 CXX="clang++-3.8 -Qunused-arguments" CC="ccache clang-3.8"
env: JOBS=8 CXX="clang++-3.9 -Qunused-arguments" CC="ccache clang-3.9 -Qunused-arguments"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test']
packages: [ 'libstdc++-5-dev', 'gdb', 'apport']
# disabled until I have time to fix https://github.com/mapnik/python-mapnik/issues/95
#- os: osx
# osx_image: xcode7.3 # upgrades clang from 6 -> 7
# compiler: clang
# env: JOBS=4
- os: osx
osx_image: xcode8.2
compiler: clang
env: JOBS=4

cache:
directories:
Expand Down Expand Up @@ -55,23 +47,14 @@ before_install:
- export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
- |
if [[ $(uname -s) == 'Linux' ]]; then
export LDSHARED=$(python -c "import os;from distutils import sysconfig;print sysconfig.get_config_var('LDSHARED').replace('cc ','clang++-3.8 ')");
./.mason/mason install clang 3.8.0
export PATH=$(./.mason/mason prefix clang 3.8.0)/bin:${PATH}
export LDSHARED=$(python -c "import os;from distutils import sysconfig;print sysconfig.get_config_var('LDSHARED').replace('cc ','clang++-3.9 ')");
mason install clang++ 3.9.1
export PATH=$(mason prefix clang++ 3.9.1)/bin:${PATH}
which clang++
else
sudo easy_install pip;
brew info postgres;
export DATA_PATH=$(brew --prefix)/var/postgres;
rm -rf ${DATA_PATH};
initdb ${DATA_PATH} -E utf8;
pg_ctl -w start -l postgres.log --pgdata ${DATA_PATH};
cat postgres.log;
createuser -s postgres;
export LDSHARED=$(python -c "import os;from distutils import sysconfig;print sysconfig.get_config_var('LDSHARED').replace('cc ','clang++ ')");
fi
- psql -c 'create database template_postgis;' -U postgres
- psql -c 'create extension postgis;' -d template_postgis -U postgres
- pip install --upgrade --user nose
- pip install --upgrade --user wheel
- pip install --upgrade --user twine
Expand All @@ -84,15 +67,15 @@ install:
- python setup.py install --prefix ${PYTHONUSERBASE}

before_script:
- ulimit -c unlimited -S
- RESULT=0
- python test/run_tests.py || RESULT=$?
- ls -l .
- for i in $(find ./ -maxdepth 1 -name 'core*' -print); do gdb $(which python) $i -ex "thread apply all bt" -ex "set pagination 0" -batch; done;
- if [[ ${RESULT} != 0 ]]; then exit $RESULT; fi
# start postgres/postgis
- source mason-config.env
- ./mason_packages/.link/bin/postgres -k ${PGHOST} > postgres.log &

script:
- python test/run_tests.py
- python test/visual.py -q
# stop postgres
- ./mason_packages/.link/bin/pg_ctl -w stop
- |
if [[ ${COMMIT_MESSAGE} =~ "[publish]" ]]; then
python setup.py bdist_wheel
Expand Down
100 changes: 52 additions & 48 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,68 @@ function install() {
MASON_PLATFORM_ID=$(mason env MASON_PLATFORM_ID)
if [[ ! -d ./mason_packages/${MASON_PLATFORM_ID}/${1}/ ]]; then
mason install $1 $2
# the rm here is to workaround https://github.com/mapbox/mason/issues/230
rm -f ./mason_packages/.link/mason.ini
mason link $1 $2
fi
}

ICU_VERSION="55.1"
ICU_VERSION="57.1"

function install_mason_deps() {
FAIL=0
install mapnik latest &
install ccache 3.2.4 &
install jpeg_turbo 1.5.0 libjpeg &
install libpng 1.6.24 libpng &
install libtiff 4.0.6 libtiff &
install libpq 9.5.2 &
install sqlite 3.14.1 libsqlite3 &
install expat 2.2.0 libexpat &
install icu ${ICU_VERSION} &
install proj 4.9.2 libproj &
install pixman 0.34.0 libpixman-1 &
install cairo 1.14.6 libcairo &
install protobuf 2.6.1 &
# technically protobuf is not a mapnik core dep, but installing
# here by default helps make mapnik-vector-tile builds easier
install webp 0.5.1 libwebp &
install gdal 2.1.1 libgdal &
install boost 1.61.0 &
install boost_libsystem 1.61.0 &
install boost_libfilesystem 1.61.0 &
install boost_libprogram_options 1.61.0 &
install boost_libregex_icu 1.61.0 &
# technically boost thread and python are not a core dep, but installing
# here by default helps make python-mapnik builds easier
install boost_libthread 1.61.0 &
install boost_libpython 1.61.0 &
install freetype 2.6.5 libfreetype &
install harfbuzz 1.3.0 libharfbuzz &
for job in $(jobs -p)
do
wait $job || let "FAIL+=1"
done
if [[ "$FAIL" != "0" ]]; then
exit ${FAIL}
fi
install mapnik 3.0.15
install jpeg_turbo 1.5.1
install libpng 1.6.28
install libtiff 4.0.7
install libpq 9.6.2
install sqlite 3.17.0
install expat 2.2.0
install icu ${ICU_VERSION}
install proj 4.9.3
install pixman 0.34.0
install cairo 1.14.8
install webp 0.6.0
install libgdal 2.1.3
install boost 1.63.0
install boost_libsystem 1.63.0
install boost_libfilesystem 1.63.0
install boost_libprogram_options 1.63.0
install boost_libregex_icu57 1.63.0
install freetype 2.7.1
install harfbuzz 1.4.2-ft
# deps needed by python-mapnik (not mapnik core)
install boost_libthread 1.63.0
install boost_libpython 1.63.0
install postgis 2.3.2-1
}

function setup_runtime_settings() {
local MASON_LINKED_ABS=$(pwd)/mason_packages/.link
export PROJ_LIB=${MASON_LINKED_ABS}/share/proj
export ICU_DATA=${MASON_LINKED_ABS}/share/icu/${ICU_VERSION}
export GDAL_DATA=${MASON_LINKED_ABS}/share/gdal
if [[ $(uname -s) == 'Darwin' ]]; then
export DYLD_LIBRARY_PATH=$(pwd)/mason_packages/.link/lib:${DYLD_LIBRARY_PATH}
else
export LD_LIBRARY_PATH=$(pwd)/mason_packages/.link/lib:${LD_LIBRARY_PATH}
fi
export PATH=$(pwd)/mason_packages/.link/bin:${PATH}
echo "export PROJ_LIB=${MASON_LINKED_ABS}/share/proj" > mason-config.env
echo "export ICU_DATA=${MASON_LINKED_ABS}/share/icu/${ICU_VERSION}" >> mason-config.env
echo "export GDAL_DATA=${MASON_LINKED_ABS}/share/gdal" >> mason-config.env
echo "export PATH=$(pwd)/mason_packages/.link/bin:${PATH}" >> mason-config.env
echo "export PGTEMP_DIR=$(pwd)/local-tmp" >> mason-config.env
echo "export PGDATA=$(pwd)/local-postgres" >> mason-config.env
echo "export PGHOST=$(pwd)/local-unix-socket" >> mason-config.env
echo "export PGPORT=1111" >> mason-config.env

source mason-config.env
rm -rf ${PGHOST}
mkdir -p ${PGHOST}
rm -rf ${PGDATA}
mkdir -p ${PGDATA}
rm -rf ${PGTEMP_DIR}
mkdir -p ${PGTEMP_DIR}
./mason_packages/.link/bin/initdb
sleep 2
./mason_packages/.link/bin/postgres -k ${PGHOST} > postgres.log &
sleep 2
./mason_packages/.link/bin/createdb template_postgis -T postgres
./mason_packages/.link/bin/psql template_postgis -c "CREATE TABLESPACE temp_disk LOCATION '${PGTEMP_DIR}';"
./mason_packages/.link/bin/psql template_postgis -c "SET temp_tablespaces TO 'temp_disk';"
./mason_packages/.link/bin/psql template_postgis -c "CREATE PROCEDURAL LANGUAGE 'plpythonu' HANDLER plpython_call_handler;"
./mason_packages/.link/bin/psql template_postgis -c "CREATE EXTENSION postgis;"
./mason_packages/.link/bin/psql template_postgis -c "SELECT PostGIS_Full_Version();"
./mason_packages/.link/bin/pg_ctl -w stop
}

function main() {
Expand Down
12 changes: 6 additions & 6 deletions demo/python/rundemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
# FIXME - currently adding dash arrays is broken
# https://github.com/mapnik/mapnik/issues/2324
sym.stroke = mapnik.Color('black')
sym.stroke_width = 1.0
sym.stroke_width = 1
provlines_rule.symbols.append(sym)
provlines_style.rules.append(provlines_rule)

Expand Down Expand Up @@ -196,7 +196,7 @@

sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(171,158,137)
sym.stroke_width = 2.0
sym.stroke_width = 2
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP

roads34_rule.symbols.append(sym)
Expand All @@ -219,7 +219,7 @@

sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(171,158,137)
sym.stroke_width = 4.0
sym.stroke_width = 4
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
roads2_rule_1.symbols.append(sym)
roads2_style_1.rules.append(roads2_rule_1)
Expand All @@ -232,7 +232,7 @@
sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(255,250,115)
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
sym.stroke_width = 2.0
sym.stroke_width = 2
roads2_rule_2.symbols.append(sym)
roads2_style_2.rules.append(roads2_rule_2)

Expand All @@ -255,7 +255,7 @@
sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(188,149,28)
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
sym.stroke_width = 7.0
sym.stroke_width = 7
roads1_rule_1.symbols.append(sym)
roads1_style_1.rules.append(roads1_rule_1)
m.append_style('highway-border', roads1_style_1)
Expand All @@ -265,7 +265,7 @@
roads1_rule_2.filter = mapnik.Expression('[CLASS] = 1')
sym.stroke = mapnik.Color(242,191,36)
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
sym.stroke_width = 5.0
sym.stroke_width = 5
roads1_rule_2.symbols.append(sym)
roads1_style_2.rules.append(roads1_rule_2)

Expand Down
2 changes: 1 addition & 1 deletion mapnik/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ def register_fonts(path=None, valid_extensions=[
for dirpath, _, filenames in os.walk(path):
for filename in filenames:
if os.path.splitext(filename.lower())[1] in valid_extensions:
FontEngine.instance().register_font(os.path.join(dirpath, filename))
FontEngine.register_font(os.path.join(dirpath, filename))

# auto-register known plugins and fonts
register_plugins()
Expand Down
3 changes: 2 additions & 1 deletion mapnik/printing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class PDFPrinter(object):
Main class for creating PDF print outs. Basic usage is along the lines of

import mapnik
import mapnik.printing

page = mapnik.printing.PDFPrinter()
m = mapnik.Map(100,100)
Expand Down Expand Up @@ -1248,7 +1249,7 @@ def add_geospatial_pdf_header(self, m, filename, epsg=None, wkt=None):
file_writer = PdfFileWriter()

# preserve OCProperties at document root if we have one
if file_reader.trailer['/Root'].has_key(NameObject('/OCProperties')):
if NameObject('/OCProperties') in file_reader.trailer['/Root']:
file_writer._root_object[NameObject('/OCProperties')] = file_reader.trailer[
'/Root'].getObject()[NameObject('/OCProperties')]

Expand Down
13 changes: 4 additions & 9 deletions scripts/setup_mason.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ set -eu
set -o pipefail

# we pin the mason version to avoid changes in mason breaking builds
MASON_VERSION="new-pkgs"
MASON_VERSION="1150c38"

function setup_mason() {
if [[ ! -d ./.mason ]]; then
git clone https://github.com/mapbox/mason.git ./.mason
(cd ./.mason && git checkout ${MASON_VERSION})
else
echo "Updating to latest mason"
(cd ./.mason && git fetch && git checkout ${MASON_VERSION})
fi
mkdir -p ./mason
curl -sSfL https://github.com/mapbox/mason/archive/${MASON_VERSION}.tar.gz | tar --gunzip --extract --strip-components=1 --exclude="*md" --exclude="test*" --directory=./mason
export MASON_HOME=$(pwd)/mason_packages/.link
export PATH=$(pwd)/.mason:$PATH
export PATH=$(pwd)/mason:${PATH}
export CXX=${CXX:-clang++}
export CC=${CC:-clang}
}
Expand Down
Loading