Skip to content
Commits on Source (5)
......@@ -16,10 +16,14 @@ node.exe*
mapnik-sdk
sdk
foo
local.env
iwyu.sh
package
documentation
.mason/
.toolchain/
local.env
mason_packages/
mason-postgis-config.env
local-postgres/
postgres.log
local-unix-socket/
\ No newline at end of file
......@@ -4,3 +4,6 @@
[submodule "deps/geometry"]
path = deps/geometry
url = https://github.com/mapbox/geometry.hpp.git
[submodule "deps/protozero"]
path = deps/protozero
url = https://github.com/mapbox/protozero.git
......@@ -31,3 +31,9 @@ deps/wagyu/tests
deps/wagyu/docs
deps/geometry/tests
.toolchain
local-postgres
deps/protozero/test
.mason
mason-postgis-config.env
local.env
postgres.log
......@@ -6,8 +6,6 @@ sudo: false
# note: you'll need to generate your own keys for publishing a separate project
env:
global:
- secure: F42vcZEgWgCMDvQXlmyYmWwFo86fUjlJbsvXEwyliaMfasjCNsbmeILU61aScn8daiCGD+vRUaRlmv+XxUSS2G8FaoI8ZjwgMo2guMwthAQJ1ohTvf4bZI0JqVYKnnZpzhGPv2zD0DTdt31l30qn2GZnnGrF4yFpPU1HW2HcMuE=
- secure: WRWrn3KjCaevRo2htdvn26euALTZNCDtcSlQvtH6Bc7yLdhlH5apj+qSuWqlN59f1cprFH+5aQ2zmBkVmAV2DT4IbsfszMIR6k6EetuY6VOugo/qsPW2x/MQbpFgjCbl95bYty4eUH9Bcf70Pz/S+XVewABXHWikJiLUiZBbLyE=
- secure: "bvbvxQe4GXZoU1zxm6KylaUSuQuhUZKe1V4+iYM0Sde6hj6RtAUccCWT7mNacCe2I6uGVHHjVfd7wLovT5y7lyT5pzY3UtypxFwuvGxDHotH4hhTg4m8/7APdB4bf5YgBf5IC6pMUPpUloh6TsTIwYzEaJdp/52b31Qfx80FooqOGOrEqntiyvidWsdUmlrxWnpxCVndkZgwvD15Uc08DWyD8Hklor6cKW6d/3zVIFmy81uAvTQp5W5xXC47S/BYYIwz3GU0zx+CMWM1oFObSbkVMG3LXDurqyvzWf9+09ZtBlC2JW0AOt9atk7vnD115Ia1KaEWalMhb3AGwJx4M4hqonooWOx20NL5P0sqEUe94GBUwvvb295vFTbw9guSGYXL3cOeWTlh2Ol466vJUwBvfr4OQ6Qu401nb1sIIv4SoIT9xXSHbopoderRVQurrcl/wesR19hgzrQC9ytJ6QCS1xnnzKogflfMQDDayrCMwpiZ5gvMGheGNbAh661wL03YXiviMwG307+iwFk8zyw05g4nW5/v3S+OYq3QatUgk+ZDpX2JS2zX4D6Aj2QLzKtCrx9pNpngl8pN+drmac1nklUeQLANxyv8hQjJvs1a4utj7ed9CY7QEWkvfrUl7rZqXvzacKmGEWoTkZKru19pa0enLTThKQV6AOei3e4="
# enable c++11/14 builds
......@@ -33,7 +31,7 @@ install:
# we use before_script rather than script to ensure fast failure (the script section continues even after an error)
# https://docs.travis-ci.com/user/customizing-the-build#Breaking-the-Build
before_script:
- ./scripts/check_glibcxx.sh
- source scripts/postgis/setup_and_run.sh
- npm test
# after successful tests, publish binaries if specified in commit message
- ./scripts/publish.sh --toolset=${TOOLSET:-} --debug=$([ "${BUILDTYPE}" == 'debug' ] && echo "true" || echo "false")
......@@ -78,6 +76,10 @@ matrix:
- os: linux
env: BUILDTYPE=release
node_js: 9
# linux publishable node v10
- os: linux
env: BUILDTYPE=release
node_js: 10
# osx publishable node v0.10
- os: osx
osx_image: xcode8.3
......@@ -88,37 +90,32 @@ matrix:
osx_image: xcode8.3
env: BUILDTYPE=release
node_js: 4
# osx publishable node v4/debug
- os: osx
osx_image: xcode8.3
env: BUILDTYPE=debug
node_js: 4
# osx publishable node v6
- os: osx
osx_image: xcode8.3
env: BUILDTYPE=release
node_js: 6
# osx publishable node v6/debug
- os: osx
osx_image: xcode8.3
env: BUILDTYPE=debug
node_js: 6
# osx publishable node v7
- os: osx
osx_image: xcode8.3
osx_image: xcode8.2
env: BUILDTYPE=release
node_js: 7
# osx publishable node v8
- os: osx
osx_image: xcode8.3
osx_image: xcode8.2
env: BUILDTYPE=release
node_js: 8
# osx publishable node v9
- os: osx
osx_image: xcode8.3
osx_image: xcode8.2
env: BUILDTYPE=release
node_js: 9
# Sanitizer build linux node v4/Debug
# osx publishable node v10
- os: osx
osx_image: xcode8.2
env: BUILDTYPE=release
node_js: 10
# Sanitizer build node v4/Debug
- os: linux
env: BUILDTYPE=debug TOOLSET=-asan
node_js: 4
......@@ -137,34 +134,11 @@ matrix:
- export LD_PRELOAD=${MASON_LLVM_RT_PRELOAD}
# TODO: re-enable detect_leaks=0 once we can build and test against an asan sanitized libc++
- export ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_leaks=0:${ASAN_OPTIONS}
- source scripts/postgis/setup_and_run.sh
- npm test
- unset LD_PRELOAD
# after successful tests, publish binaries if specified in commit message
- ./scripts/publish.sh --toolset=${TOOLSET:-} --debug=$([ "${BUILDTYPE}" == 'debug' ] && echo "true" || echo "false")
# Sanitizer build osx node v4/Debug
- os: osx
osx_image: xcode8.3
env: BUILDTYPE=debug TOOLSET=-asan
node_js: 4
# Overrides `install` to set up custom asan flags
install:
- ./scripts/setup.sh --config local.env
# put mason and clang++ on PATH
- source local.env
# Note: to build without stopping on errors remove the -fno-sanitize-recover=all flag
# You might want to do this if there are multiple errors and you want to see them all before fixing
- export CXXFLAGS="${MASON_SANITIZE_CXXFLAGS} -fno-sanitize-recover=all"
- export LDFLAGS="${MASON_SANITIZE_LDFLAGS}"
- make ${BUILDTYPE}
# Overrides `script` to disable asan LD_PRELOAD before publishing
before_script:
- export DYLD_INSERT_LIBRARIES=${MASON_LLVM_RT_PRELOAD}
# TODO: re-enable detect_leaks=0 once we can build and test against an asan sanitized libc++
- export ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_leaks=0:${ASAN_OPTIONS}
- node ./node_modules/.bin/_mocha test/ --timeout 100000
- unset DYLD_INSERT_LIBRARIES
# after successful tests, publish binaries if specified in commit message
- ./scripts/publish.sh --toolset=${TOOLSET:-} --debug=$([ "${BUILDTYPE}" == 'debug' ] && echo "true" || echo "false")
# g++ build (default builds all use clang++)
- os: linux
env: BUILDTYPE=debug CXX="g++-6" CC="gcc-6"
......@@ -181,6 +155,10 @@ matrix:
- make ${BUILDTYPE}
# Overrides `script` to disable publishing
before_script:
# manually initialize mason (avoid sourcing local.env since we don't want to use clang++ here)
- ./scripts/setup.sh --config local.env
- export PATH=$(pwd)/.mason:${PATH}
- source scripts/postgis/setup_and_run.sh
- npm test
# test building with out SSE_MATH enabled
- os: linux
......@@ -195,6 +173,7 @@ matrix:
node_js: 4
# Overrides `script` to publish coverage data to codecov
before_script:
- source scripts/postgis/setup_and_run.sh
- npm test
- mason install llvm-cov ${MASON_LLVM_RELEASE}
- mason link llvm-cov ${MASON_LLVM_RELEASE}
......
# Changelog
## 4.0.1
- Updated mapnik-vector-tile to fix strange clipping in vector tiles https://github.com/mapnik/node-mapnik/issues/892
- Added ability to release the underlying buffer from a vector tile when using `getData` method so no memory is copied.
## 4.0.0
- Added support for node v10
- Stop bundling node-pre-gyp
- Upgraded to mapnik@a2f5969 (pre-release master)
- See https://github.com/mapnik/mapnik/wiki/API-changes-between-v3.0-and-v3.1 for changes
- Upgraded to protozero@1.6.2 (and also now pulling via submodule)
- Upgraded to mapnik-vector-tile@2.1.1 (https://github.com/mapbox/mapnik-vector-tile/blob/master/CHANGELOG.md#211)
- Pass variables to replace tokens in query (https://github.com/mapnik/node-mapnik/pull/809)
- Changed SVG parsing behavior to respect strict mode, and default to off.
## 3.7.2
- Upgraded to Mapnik v3.0.20
## 3.7.1
- Mapnik 3.7.0 was not properly published to npm with node-pre-gyp. Releasing again with fix.
- Fix to `SSE_MATH` flag during building
## 3.7.0
Updated to 3.0.18 of mapnik. See [here](https://github.com/mapnik/mapnik/blob/master/CHANGELOG.md).
......@@ -14,16 +34,16 @@ Updated to 3.0.18 of mapnik. See [here](https://github.com/mapnik/mapnik/blob/ma
## 3.6.2
Updated to 3.0.15 of mapnik. The full changelog for this release is located [here](https://github.com/mapnik/mapnik/blob/master/CHANGELOG.md#3015).
Updated to 3.0.15 of mapnik. The full changelog for this release is located [here](https://github.com/mapnik/mapnik/blob/master/CHANGELOG.md#3015).
## 3.6.1
Updated for a fix associated with mapnik-vector-tile where images could be requested that would have a width or height of zero resulting
in exceptions.
in exceptions.
Several fixes associated with different mapnik by updating to use 3.0.14. Please see mapnik change log for specifics. In
general note worthy changes from mapnik include stricter geojson parsing, fixes for raster plugin, fixes to image scaling,
changing the meaning of filter-factor, and improvements to the the TIFF decoder.
changing the meaning of filter-factor, and improvements to the the TIFF decoder.
Due to changes in the mapnik core version during this update you should see some changes in the image rescaling of raster and gdal plugin source data. This will definitely change the expected output. This is due to fixes in long standing bugs in the mapnik library.
......@@ -44,7 +64,6 @@ The second largest change is the update of all major C/C++ dependencies. The cha
The third most important set of changes were to node-mapnik directly: for performance many functions now can premultiply as part of another async operation (to avoid needing an additional threadpool access for async premultiply - this matters under load when the threadpool may be full since access can block). And many functions that allocate images now protect from extreme allocation that could hang a machine and result in OOM. Additionally the address sanitizer caught several cases of undefined behavior.
- No longer installing node-pre-gyp in `preinstall` target, now bundling again as a bundledDep (https://github.com/mapbox/node-pre-gyp/issues/260).
- Added support for node v7
- Updated to 1.3.0 of Mapnik Vector Tile (https://github.com/mapbox/mapnik-vector-tile/blob/master/CHANGELOG.md#130)
- Removed Angus Clipper and replaced with Wagyu v0.4.2 (https://github.com/mapbox/wagyu)
......@@ -214,7 +233,7 @@ Summary of changes:
- Added optional arguments of `tile_size` and `buffer_size` to `mapnik.VectorTile` constructor.
## 3.4.19
- Update to mapnik-core 3.0.11 with a fix to unquoted strings
## 3.4.18
......@@ -357,8 +376,8 @@ Notable changes in the Mapnik SDK include:
this is set to `mapnik.polygonFillType.nonZero`
- Added `multi_polygon_union` option to `VectorTile.composite`, `VectorTile.addGeoJSON`, and `Map.render`. By
default this is set to `true`. This will cause multipolygons to undergo a union operation during vector tile
creation.
- Added `simplify_distance` option to `VectorTile.composite`.
creation.
- Added `simplify_distance` option to `VectorTile.composite`.
- Added `max_extent` (bbox) option to `VectorTile.composite`. By default it is unset which means no
clipping extent will be used for the operation. If provided the data will be restricted to this extent.
- Landed in https://github.com/mapnik/node-mapnik/commit/ef3b12a36f529a1a8fbb70f4ddd6a92e1bd22008
......@@ -423,7 +442,7 @@ Notable Changes in Mapnik 3.0.5 include:
- Rebuilt with Mapnik 3.0.5
- Added ability to create an image using a Buffer object. It should be noted that this should
be used very carefully as the lifetime of the Image object is tied to that of the Buffer. If the
be used very carefully as the lifetime of the Image object is tied to that of the Buffer. If the
buffer object is garbage collect this could result in a segfault.
Notable Changes in Mapnik 3.0.5 include:
......@@ -487,7 +506,7 @@ Notable changes in the Mapnik SDK include:
- Binaries updated to use Mapnik v3.0.2 and mapnik-packaging@049968d24
Notable changes in the Mapnik SDK include:
- Added container to log SVG parsing errors
- Reimplemented to use rapidxml for parsing XML (DOM)
- Support both xml:id and id attributes ( xml:id takes precedence )
......@@ -628,7 +647,7 @@ Notable changes in the Mapnik SDK include:
- Added stress test benchmarks that live in ./bench folder of git repo
- Added `isSolid` method to `Image` object
- When making vector tiles that are larger then 64 MB changed node so that it would no longer through an abort but rather an exception
- Added extra meta data for some datasource associated with the use of the `describe` method on datasources
- Added extra meta data for some datasource associated with the use of the `describe` method on datasources
Notable changes in the Mapnik SDK include:
- Changes: https://github.com/mapnik/mapnik/compare/8063fa0...30c6cf636c
......@@ -692,7 +711,7 @@ Notable changes in the Mapnik SDK include:
- Binaries updated to use Mapnik v3.x (master branch) at 2577a6c and mapnik-packaging@759c4a32ba
## 3.1.0
- Added [`mapnik.Logger`](https://github.com/mapnik/node-mapnik/blob/master/docs/Logger.md)
- Added `Map.loadFonts`, `Map.fonts()`, `Map.fontFiles()`, `Map.fontDirectory()`, and `Map.memoryFonts()`
- Added `Feature.fromJSON` and `Feature.geometry`
......
......@@ -61,7 +61,7 @@ Then, back at node-mapnik, take the new SDK version (which is generated by `git
To get a new Mapnik SDK published for Windows:
- The scripts at https://github.com/BergWerkGIS/mapnik-dependencies are used
- The do not run fast enough to work on appveyor so we plan aws automation to get this working.
- They do not run fast enough to work on appveyor so we plan AWS automation to get this working.
- In the meantime ping @BergWerkGIS to run them and provide a new SDK.
Then, back at node-mapnik, take the new SDK version (which is generated by `git describe` and add it to the `MAPNIK_GIT` variable in the `appveyor.yml`.
......@@ -109,7 +109,7 @@ Ensure that all tests are passing and no dupes are reported. Only ignore failing
An official release requires:
- Updating the CHANGELOG.md
- Publishing new binaries for a non-alpha version like `3.1.5`. So you'd want to merge your branch and then edit the `version` value in package json back to a decent value for release.
- Publishing new binaries for a non-alpha version like `3.1.5`. So you'd want to merge your branch and then edit the `version` value in package.json back to a decent value for release.
- Create a github tag like `git tag --annotate v3.1.5 -m "v3.1.5"`
- Push new tags `git push --tags`
- Optional: Test mapnik-swoop again for your new tagged version
......
......@@ -44,7 +44,7 @@ coverage:
clean:
rm -rf lib/binding
rm -rf build
rm -rf .mason
rm -rf ./mason
find test/ -name *actual* -exec rm {} \;
echo "run make distclean to also remove mason_packages and node_modules"
......
......@@ -71,21 +71,21 @@ For more sample code see [the tests](./test) and [sample code](https://github.co
OS|Node.js|C++ minimum requirements|OS versions
---|---|---|---
Mac|v0.10.x, v4, v6, v8|C++11|Mac OS X > 10.10
Linux|v0.10.x, v4, v6, v8|C++11|Ubuntu Linux > 14.04 (trusty) or Centos >= 7 or other Linux distributions with a libstdc++ recent enough to contain >= GLIBCXX_3.4.19 symbols (libstdc++ that comes with at least g++ 4.8).
Linux|v0.10.x, v4, v6, v8|C++11|Ubuntu Linux > 16.04 or other Linux distributions with g++ >= 5 toolchain (>= GLIBCXX_3.4.21 from libstdc++)
Windows|v0.10.x, v4, v6, v8|C++11|See the [Windows requirements](https://github.com/mapnik/node-mapnik#windows-specific) section
An installation error like below indicates your system does not have a modern enough libstdc++/gcc-base toolchain:
```
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.19 not found
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.21 not found (required by /node_modules/osrm/lib/binding/osrm.node)
```
If you are running Ubuntu older than 14.04 you can easily upgrade your libstdc++ version like:
If you are running Ubuntu older than 16.04 you can easily upgrade your libstdc++ version like:
```
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update -y
sudo apt-get install -y libstdc++6
sudo apt-get install -y libstdc++-5-dev
```
To upgrade libstdc++ on travis (without sudo) you can do:
......@@ -145,23 +145,23 @@ There are two ways to build from source. These work on both OS X and Linux:
- A) Against a binary package from Mapnik from [mason](https://github.com/mapbox/mason)
- B) Against an existing version of Mapnik on your system
Using `A)` is recommended. You do not need to have Mapnik installed already, so this is the easiest and most predictable approach. When you use the route a binary package of Mapnik is download dynamically from [mason](https://github.com/mapbox/mason).
Using `A)` is recommended. You do not need to have Mapnik installed already, so this is the easiest and most predictable approach. When you use the route a binary package of Mapnik is downloaded dynamically from [mason](https://github.com/mapbox/mason).
You can invoke this method simply by running:
make release
`make release`
Or, for debug builds:
make debug
`make debug`
If you want to do a full rebuild do:
make distclean
`make distclean`
And then re-run the build:
make release
`make release`
Using `B)` is also possible, if you would like to build node-mapnik against an external, already installed Mapnik version.
......@@ -181,6 +181,11 @@ By default node mapnik is built with SSE support. If you are building on a platf
SSE_MATH=false make
```
### Building against Mapnik 3.0.x
The `master` branch of node-mapnik is not compatible with `3.0.x` series of Mapnik. To build again Mapnik 3.0.x, use [`v3.0.x`](https://github.com/mapnik/node-mapnik/tree/v3.0.x) branch.
## Using node-mapnik from your node app
To require node-mapnik as a dependency of another package put in your package.json:
......
......@@ -2,7 +2,7 @@
'includes': [ 'common.gypi' ],
'variables': {
'ENABLE_GLIBC_WORKAROUND%':'false', # can be overriden by a command line variable because of the % sign
'enable_sse%':'true'
'enable_sse%':'true'
},
'targets': [
{
......@@ -42,8 +42,8 @@
# TODO: move these to mason packages once we have a minimal windows client for mason (@springmeyer)
# https://github.com/mapbox/mason/issues/396
"./deps/geometry/include/",
"./deps/protozero/include/",
"./deps/wagyu/include/",
"<!(node -e \"require('protozero')\")",
"<!(node -e \"require('mapnik-vector-tile')\")"
],
'defines': [
......@@ -109,7 +109,7 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'MACOSX_DEPLOYMENT_TARGET':'10.8',
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
'CLANG_CXX_LANGUAGE_STANDARD':'c++14',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0'
}
},
......
......@@ -5,7 +5,7 @@
'msbuild_toolset':'v140',
'msvs_disabled_warnings': [ 4503, 4068,4244,4005,4506,4345,4804,4805,4661 ],
'cflags_cc' : [
'-std=c++11',
'-std=c++14',
],
'cflags_cc!': ['-std=gnu++0x','-fno-rtti', '-fno-exceptions'],
'configurations': {
......
......@@ -4,8 +4,7 @@ Uploaders: David Paleino <dapal@debian.org>,
Jérémy Lal <kapouer@melix.org>
Section: javascript
Priority: optional
Build-Depends: debhelper (>= 9~),
dh-buildinfo,
Build-Depends: debhelper (>= 11~),
libmapbox-wagyu-dev,
libmapnik-dev (>= 3.0.20),
libprotozero-dev (>= 1.5.1),
......@@ -14,10 +13,10 @@ Build-Depends: debhelper (>= 9~),
node-gyp,
node-mocha,
node-nan (>= 2.4.0),
node-pre-gyp,
node-pre-gyp (>=0.10~),
nodejs-dev,
node-sphericalmercator
Standards-Version: 4.1.4
Standards-Version: 4.2.0
Vcs-Browser: https://salsa.debian.org/js-team/node-mapnik
Vcs-Git: https://salsa.debian.org/js-team/node-mapnik.git
Homepage: https://github.com/mapnik/node-mapnik
......@@ -26,7 +25,7 @@ Package: node-mapnik
Architecture: any
Depends: mapnik-utils,
nodejs,
node-pre-gyp,
node-pre-gyp (>= 0.10~),
${shlibs:Depends},
${misc:Depends}
Recommends: node-carto,
......
......@@ -4,8 +4,8 @@
"url": "http://github.com/mapnik/node-mapnik",
"homepage": "http://mapnik.org",
"author": "Dane Springmeyer <dane@mapbox.com> (mapnik.org)",
"version": "3.7.2",
"mapnik_version":"v3.0.20",
"version": "4.0.1",
"mapnik_version": "434511c",
"main": "./lib/mapnik.js",
"binary": {
"module_name": "mapnik",
......@@ -36,14 +36,10 @@
],
"license": "BSD-3-Clause",
"dependencies": {
"mapnik-vector-tile": "1.6.1",
"protozero": "1.5.1",
"nan": "~2.8.0",
"node-pre-gyp": "~0.6.30"
"mapnik-vector-tile": "2.2.1",
"nan": "~2.10.0",
"node-pre-gyp": "~0.10.0"
},
"bundledDependencies": [
"node-pre-gyp"
],
"bin": {
"mapnik-index.js": "./bin/mapnik-index.js",
"mapnik-inspect.js": "./bin/mapnik-inspect.js",
......
#!/bin/bash
set -eu
set -o pipefail
shopt -s nullglob
: '
Ensure no GLIBCXX_3.4.2x symbols are present in the binary
If symbols >= 3.4.20 then it returns error code 1. This means
the binaries would not run on ubuntu trusty without upgrading libstdc++
'
FINAL_RETURN_CODE=0
function check() {
local RESULT=0
nm ${1} | grep "GLIBCXX_3.4.2[0-9]" > /tmp/out.txt || RESULT=$?
if [[ ${RESULT} != 0 ]]; then
echo "Success: GLIBCXX_3.4.2[0-9] symbols not present in binary (as expected)"
else
echo "$(cat /tmp/out.txt | c++filt)"
FINAL_RETURN_CODE=1
fi
}
echo "checking ./lib/binding/mapnik.node"
check "lib/binding/mapnik.node"
exit ${FINAL_RETURN_CODE}
......@@ -10,6 +10,8 @@ function install() {
ICU_VERSION="57.1"
# setup mason
# NOTE: update the mason version inside setup.sh
./scripts/setup.sh --config local.env
source local.env
......@@ -25,10 +27,10 @@ if [ ! -f ./mason_packages/.link/bin/mapnik-config ]; then
install cairo 1.14.8
install webp 0.6.0
install libgdal 2.1.3
install boost 1.65.1
install boost_libsystem 1.65.1
install boost_libfilesystem 1.65.1
install boost_libregex_icu57 1.65.1
install boost 1.66.0
install boost_libsystem 1.66.0
install boost_libfilesystem 1.66.0
install boost_libregex_icu57 1.66.0
install freetype 2.7.1
install harfbuzz 1.4.2-ft
......@@ -36,5 +38,5 @@ if [ ! -f ./mason_packages/.link/bin/mapnik-config ]; then
# NOTE: sync this version with the `mapnik_version` in package.json (which is used for windows builds)
# In the future we could pull from that version automatically if mason were to support knowing the right dep
# versions to install automatically. Until then there is not much point since the deps are still hardcoded here.
install mapnik 3.0.20
install mapnik 434511c
fi
#!/bin/bash
set -eu
set -o pipefail
if [[ ! -f mason-postgis-config.env ]]; then
echo "Please run setup.sh first"
exit 1
fi
# do each time you use the local postgis:
source mason-postgis-config.env
# do once: create directories to hold postgres data
echo "Creating pghost: ${PGHOST} and temp dir: ${PGTEMP_DIR}"
mkdir ${PGHOST}
mkdir ${PGTEMP_DIR}
# do once: initialize local db cluster
echo "Initializing database cluser at ${PGDATA}"
./mason_packages/.link/bin/initdb
sleep 2
# start server and background (NOTE: if running interactively hit return to fully background and get your prompt back)
./mason_packages/.link/bin/postgres -k $PGHOST > postgres.log &
sleep 2
# set up postgres to know about local temp directory
./mason_packages/.link/bin/psql postgres -c "CREATE TABLESPACE temp_disk LOCATION '${PGTEMP_DIR}';"
./mason_packages/.link/bin/psql postgres -c "SET temp_tablespaces TO 'temp_disk';"
# add plpython support if you need
./mason_packages/.link/bin/psql postgres -c "CREATE PROCEDURAL LANGUAGE 'plpythonu' HANDLER plpython_call_handler;"
# create postgis enabled db
./mason_packages/.link/bin/createdb template_postgis -T postgres
./mason_packages/.link/bin/psql template_postgis -c "CREATE EXTENSION postgis;"
./mason_packages/.link/bin/psql template_postgis -c "SELECT PostGIS_Full_Version();"
# load hstore, fuzzystrmatch, and unaccent extensions
./mason_packages/.link/bin/psql template_postgis -c "CREATE EXTENSION hstore;"
./mason_packages/.link/bin/psql template_postgis -c "CREATE EXTENSION fuzzystrmatch;"
./mason_packages/.link/bin/psql template_postgis -c "CREATE EXTENSION unaccent;"
echo "Fully bootstrapped template_postgis database is now ready"
# stop the database
./mason_packages/.link/bin/pg_ctl -w stop
#!/bin/bash
set -eu
set -o pipefail
if [[ ! -f mason-postgis-config.env ]]; then
echo "Please run setup.sh first"
exit 1
fi
# do each time you use the local postgis:
source mason-postgis-config.env
# do each time you use this local postgis:
# start server and background (NOTE: if running interactively hit return to fully background and get your prompt back)
./mason_packages/.link/bin/postgres -k $PGHOST > postgres.log &
sleep 2
echo "Server is now running"
echo "To stop server do:"
echo " source mason-postgis-config.env && ./mason_packages/.link/bin/pg_ctl -w stop"
#!/bin/bash
set -eu
set -o pipefail
GDAL_VERSION="2.1.3"
POSTGIS_VERSION="2.3.2-1"
# do once: install stuff
mason install libgdal ${GDAL_VERSION}
GDAL_DATA_VALUE=$(mason prefix libgdal ${GDAL_VERSION})/share/gdal/
mason install postgis ${POSTGIS_VERSION}
mason link postgis ${POSTGIS_VERSION}
if [[ ! -d ${GDAL_DATA_VALUE} ]]; then
echo "${GDAL_DATA_VALUE} not found (needed for postgis to access GDAL_DATA)"
exit 1
fi
# setup config
echo 'export CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"' > mason-postgis-config.env
echo 'export PGDATA=${CURRENT_DIR}/local-postgres' >> mason-postgis-config.env
echo 'export PGHOST=${CURRENT_DIR}/local-unix-socket' >> mason-postgis-config.env
echo 'export PGTEMP_DIR=${CURRENT_DIR}/local-tmp' >> mason-postgis-config.env
echo 'export PGPORT=1111' >> mason-postgis-config.env
echo 'export PATH=${CURRENT_DIR}/mason_packages/.link/bin:${PATH}' >> mason-postgis-config.env
echo "export GDAL_DATA=${GDAL_DATA_VALUE}" >> mason-postgis-config.env
echo "generated mason-postgis-config.env"
./scripts/postgis/setup.sh
./scripts/postgis/initialize.sh
./scripts/postgis/run.sh
source mason-postgis-config.env
#!/bin/bash
set -eu
set -o pipefail
source mason-postgis-config.env && ./mason_packages/.link/bin/pg_ctl -w stop