2015-04-28 04:23:47 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-03-16 21:49:46 +01:00
|
|
|
set -eu
|
|
|
|
|
2015-04-28 04:23:47 +02:00
|
|
|
MASON_NAME=mapnik
|
|
|
|
MASON_VERSION=latest
|
|
|
|
MASON_LIB_FILE=lib/libmapnik-wkt.a
|
|
|
|
|
|
|
|
. ${MASON_DIR:-~/.mason}/mason.sh
|
|
|
|
|
|
|
|
function mason_load_source {
|
2015-04-28 19:21:55 +02:00
|
|
|
export MASON_BUILD_PATH=$(pwd)
|
2015-04-28 04:23:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function mason_compile {
|
|
|
|
HERE=$(pwd)
|
2015-04-29 00:30:18 +02:00
|
|
|
make install
|
2016-03-16 21:49:46 +01:00
|
|
|
# this is to adapt to when mapnik is not installed in MASON_PREFIX
|
|
|
|
# originally (to make it easier to publish locally as a stopgap)
|
|
|
|
if [[ $(mapnik-config --prefix) != ${MASON_PREFIX} ]]; then
|
|
|
|
MAPNIK_PREFIX=$(mapnik-config --prefix)
|
|
|
|
mkdir -p ${MASON_PREFIX}/lib
|
|
|
|
mkdir -p ${MASON_PREFIX}/include
|
|
|
|
mkdir -p ${MASON_PREFIX}/bin
|
|
|
|
cp -r ${MAPNIK_PREFIX}/lib/*mapnik* ${MASON_PREFIX}/lib/
|
|
|
|
cp -r ${MAPNIK_PREFIX}/include/mapnik ${MASON_PREFIX}/include/
|
|
|
|
cp -r ${MAPNIK_PREFIX}/bin/mapnik* ${MASON_PREFIX}/bin/
|
|
|
|
cp -r ${MAPNIK_PREFIX}/bin/shapeindex ${MASON_PREFIX}/bin/
|
|
|
|
fi
|
|
|
|
if [[ $(uname -s) == 'Darwin' ]]; then
|
2015-04-30 19:39:23 +02:00
|
|
|
install_name_tool -id @loader_path/libmapnik.dylib ${MASON_PREFIX}"/lib/libmapnik.dylib";
|
2015-05-04 18:35:09 +02:00
|
|
|
PLUGINDIR=${MASON_PREFIX}"/lib/mapnik/input/*.input";
|
|
|
|
for f in $PLUGINDIR; do
|
2015-05-04 16:30:40 +02:00
|
|
|
echo $f;
|
2016-03-16 21:49:46 +01:00
|
|
|
echo $(basename $f);
|
|
|
|
install_name_tool -id plugins/input/$(basename $f) $f;
|
2015-05-01 21:01:29 +02:00
|
|
|
install_name_tool -change ${MASON_PREFIX}"/lib/libmapnik.dylib" @loader_path/../../libmapnik.dylib $f;
|
2015-04-30 19:39:23 +02:00
|
|
|
done;
|
2015-04-29 15:51:22 +02:00
|
|
|
fi;
|
2015-04-28 04:23:47 +02:00
|
|
|
python -c "data=open('$MASON_PREFIX/bin/mapnik-config','r').read();open('$MASON_PREFIX/bin/mapnik-config','w').write(data.replace('$HERE','.'))"
|
|
|
|
find ${MASON_PREFIX} -name "*.pyc" -exec rm {} \;
|
|
|
|
}
|
|
|
|
|
|
|
|
function mason_cflags {
|
|
|
|
""
|
|
|
|
}
|
|
|
|
|
|
|
|
function mason_ldflags {
|
|
|
|
""
|
|
|
|
}
|
|
|
|
|
|
|
|
function mason_clean {
|
2015-04-28 20:04:34 +02:00
|
|
|
echo "Done"
|
2015-04-28 04:23:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mason_run "$@"
|