diff --git a/.gitignore b/.gitignore index 14d7a83..8128e02 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /nodejs-mapnik-3.5.11.tar.gz /nodejs-mapnik-3.5.12.tar.gz /nodejs-mapnik-3.5.14.tar.gz +/nodejs-mapnik-3.6.0.tar.gz diff --git a/nodejs-mapnik-empty-geojson.patch b/nodejs-mapnik-empty-geojson.patch deleted file mode 100644 index 8becfd0..0000000 --- a/nodejs-mapnik-empty-geojson.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit a96940eeaf5093e432a0f273b229788ba1140eba -Author: Tom Hughes -Date: Wed Feb 15 08:25:24 2017 +0000 - - Parsing empty GeoJSON from file now throws - -diff --git a/test/datasource.test.js b/test/datasource.test.js -index 7420efa..c12d81e 100644 ---- a/test/datasource.test.js -+++ b/test/datasource.test.js -@@ -212,10 +212,7 @@ describe('mapnik.Datasource', function() { - }); - - it('test empty geojson datasource due to invalid json file', function() { -- var ds = new mapnik.Datasource({ type:'geojson', file: './test/data/parse.error.json', cache_features: false }); -- var empty_fs = ds.featureset(); -- assert.equal(typeof(empty_fs),'undefined'); -- assert.equal(empty_fs, null); -+ assert.throws(function() { new mapnik.Datasource({ type:'geojson', file: './test/data/parse.error.json', cache_features: false }); }); - }); - - it('test valid use of memory datasource', function() { diff --git a/nodejs-mapnik-global-namespace.patch b/nodejs-mapnik-global-namespace.patch new file mode 100644 index 0000000..f714174 --- /dev/null +++ b/nodejs-mapnik-global-namespace.patch @@ -0,0 +1,45 @@ +commit bbbbb1386640c29007ba8722222d323b850530c3 +Author: Tom Hughes +Date: Thu May 4 09:56:30 2017 +0100 + + Use modules from the global namespace + +diff --git a/package.json b/package.json +index c498970..9284d4a 100644 +--- a/package.json ++++ b/package.json +@@ -58,7 +58,7 @@ + "aws-sdk": "2.0.12", + "jshint": "^2.5.10", + "mocha": "2.x", +- "@mapbox/sphericalmercator": "~1.0.2", ++ "sphericalmercator": "~1.0.2", + "bytes": "~2.1.0" + }, + "jshintConfig": { +diff --git a/test/vector-tile.composite.test.js b/test/vector-tile.composite.test.js +index 985bac2..38f7526 100644 +--- a/test/vector-tile.composite.test.js ++++ b/test/vector-tile.composite.test.js +@@ -5,7 +5,7 @@ var assert = require('assert'); + var util = require('util'); + var fs = require('fs'); + var path = require('path'); +-var mercator = new(require('@mapbox/sphericalmercator'))(); ++var mercator = new(require('sphericalmercator'))(); + var existsSync = require('fs').existsSync || require('path').existsSync; + var overwrite_expected_data = false; + +diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js +index d269d86..0933b3e 100644 +--- a/test/vector-tile.test.js ++++ b/test/vector-tile.test.js +@@ -4,7 +4,7 @@ var mapnik = require('../'); + var assert = require('assert'); + var fs = require('fs'); + var path = require('path'); +-var mercator = new(require('@mapbox/sphericalmercator'))(); ++var mercator = new(require('sphericalmercator'))(); + var existsSync = require('fs').existsSync || require('path').existsSync; + var overwrite_expected_data = false; + var zlib = require('zlib'); diff --git a/nodejs-mapnik-ppc64le.patch b/nodejs-mapnik-ppc64le.patch index 99457fc..9246336 100644 --- a/nodejs-mapnik-ppc64le.patch +++ b/nodejs-mapnik-ppc64le.patch @@ -1,32 +1,32 @@ -commit 6f7cae9d5da5134b22b3928979be9c2d720ae0fb +commit 45fec19ecf2ca5fcf1475cf46daa355ef01de9bf Author: Tom Hughes Date: Fri Dec 23 17:26:41 2016 +0000 Disable some tests that are failing on ppc64le diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js -index 6719c5a..77faed6 100644 +index d84778d..d269d86 100644 --- a/test/vector-tile.test.js +++ b/test/vector-tile.test.js -@@ -2179,7 +2179,7 @@ describe('mapnik.VectorTile ', function() { +@@ -2186,7 +2186,7 @@ describe('mapnik.VectorTile ', function() { map.render(vtile, opts, function(err, vtile) { if (err) throw err; if (hasBoostSimple) { - assert.equal(vtile.reportGeometrySimplicity().length, 0); +// assert.equal(vtile.reportGeometrySimplicity().length, 0); - assert.equal(vtile.reportGeometryValidity().length, 14); // Dataset not expected to be OGC valid + assert.equal(vtile.reportGeometryValidity().length, 25); // Dataset not expected to be OGC valid assert.equal(vtile.reportGeometryValidity({split_multi_features:true}).length, 0); } -@@ -2217,7 +2217,7 @@ describe('mapnik.VectorTile ', function() { +@@ -2224,7 +2224,7 @@ describe('mapnik.VectorTile ', function() { map.render(vtile, opts, function(err, vtile) { if (err) throw err; if (hasBoostSimple) { - assert.equal(vtile.reportGeometrySimplicity().length, 0); +// assert.equal(vtile.reportGeometrySimplicity().length, 0); - assert.equal(vtile.reportGeometryValidity().length, 14); // Dataset not expected to be OGC valid + assert.equal(vtile.reportGeometryValidity().length, 25); // Dataset not expected to be OGC valid assert.equal(vtile.reportGeometryValidity({split_multi_features:true}).length, 0); } -@@ -3509,7 +3509,7 @@ describe('mapnik.VectorTile ', function() { +@@ -3516,7 +3516,7 @@ describe('mapnik.VectorTile ', function() { 'landcover', 'hillshade', 'contour']); assert.equal(vtile.reportGeometryValidity().length, 0); assert.equal(vtile.reportGeometryValidity({split_multi_features:true}).length, 0); diff --git a/nodejs-mapnik-pregyp.patch b/nodejs-mapnik-pregyp.patch index 7010891..dc4e797 100644 --- a/nodejs-mapnik-pregyp.patch +++ b/nodejs-mapnik-pregyp.patch @@ -1,11 +1,11 @@ -commit 6c1f28cdfcbc5618701aa11da2cdc959ce44a6e7 +commit e2066a891fe3e5915efafd5831a421b9e961c97f Author: Tom Hughes Date: Mon Aug 18 14:30:51 2014 +0100 Patch out use of node-pre-gyp diff --git a/bin/mapnik-index.js b/bin/mapnik-index.js -index 6d0eeda..f293f6d 100755 +index ec1f249..0e18ada 100755 --- a/bin/mapnik-index.js +++ b/bin/mapnik-index.js @@ -2,9 +2,8 @@ @@ -17,11 +17,11 @@ index 6d0eeda..f293f6d 100755 - bindingPath = binary.find(path.resolve(__dirname, '..', 'package.json')), +var path = require('path'), + bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), - program = path.join(path.dirname(bindingPath), 'mapnik-index'), + program = path.join(path.dirname(bindingPath), 'bin', 'mapnik-index'), spawn = require('child_process').spawn, fs = require('fs'); diff --git a/bin/mapnik-shapeindex.js b/bin/mapnik-shapeindex.js -index a612777..e3a0c05 100755 +index 50b533d..0d73b7f 100755 --- a/bin/mapnik-shapeindex.js +++ b/bin/mapnik-shapeindex.js @@ -2,9 +2,8 @@ @@ -33,7 +33,7 @@ index a612777..e3a0c05 100755 - bindingPath = binary.find(path.resolve(__dirname, '..', 'package.json')), +var path = require('path'), + bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), - shapeindex = path.join(path.dirname(bindingPath), 'shapeindex'), + shapeindex = path.join(path.dirname(bindingPath), 'bin', 'shapeindex'), spawn = require('child_process').spawn, fs = require('fs'); diff --git a/lib/mapnik.js b/lib/mapnik.js @@ -52,14 +52,16 @@ index 4cbb721..ef64c92 100644 var settings = require(settings_path); diff --git a/package.json b/package.json -index fe65f93..efc07b3 100644 +index 208f920..c498970 100644 --- a/package.json +++ b/package.json -@@ -43,7 +43,6 @@ +@@ -38,8 +38,7 @@ "dependencies": { - "mapnik-vector-tile": "~1.2.2", - "nan": "~2.4.0", -- "node-pre-gyp": "~0.6.30", - "protozero": "~1.4.2" + "mapnik-vector-tile": "1.3.0", + "protozero": "1.5.1", +- "nan": "~2.5.0", +- "node-pre-gyp": "~0.6.30" ++ "nan": "~2.5.0" }, - "bin": { + "bundledDependencies": [ + "node-pre-gyp" diff --git a/nodejs-mapnik-protozero.patch b/nodejs-mapnik-protozero.patch deleted file mode 100644 index 9b003a8..0000000 --- a/nodejs-mapnik-protozero.patch +++ /dev/null @@ -1,18 +0,0 @@ -commit 0c81920ac80d6c09a28176df639dc9de81728e0f -Author: Tom Hughes -Date: Sat Sep 10 12:00:00 2016 +0100 - - Build against system protozero - -diff --git a/binding.gyp b/binding.gyp -index 4ebb74a..b58e6bf 100644 ---- a/binding.gyp -+++ b/binding.gyp -@@ -57,7 +57,6 @@ - './deps/clipper/', - './src', - " Date: Sun Dec 6 11:05:31 2015 +0000 Relax some test thresholds diff --git a/test/vector-tile.composite.test.js b/test/vector-tile.composite.test.js -index 5c5ce70..8e767c7 100644 +index 1380a66..985bac2 100644 --- a/test/vector-tile.composite.test.js +++ b/test/vector-tile.composite.test.js @@ -307,25 +307,25 @@ describe('mapnik.VectorTile.composite', function() { @@ -20,7 +20,7 @@ index 5c5ce70..8e767c7 100644 + assert.ok(compare_to_image(im2,expected_file2) <= 500); vtile3.composite([vtile2],{reencode:true}, function(err) { if (err) throw err; - assert.equal(vtile3.getData().length,54781); + assert.equal(vtile3.getData().length,54837); assert.deepEqual(vtile3.names(),["water","admin"]); vtile3.render(map,new mapnik.Image(256,256),function(err,im) { if (err) throw err; @@ -28,7 +28,7 @@ index 5c5ce70..8e767c7 100644 + assert.ok(compare_to_image(im,expected_file) <= 500); vtile4.composite([vtile2],{reencode:true,max_extent:world_clipping_extent}, function(err) { if (err) throw err; - assert.equal(vtile4.getData().length,54522); + assert.equal(vtile4.getData().length,54576); assert.deepEqual(vtile4.names(),["water","admin"]); - assert.equal(0,compare_to_image(im2,expected_file2)); + assert.ok(compare_to_image(im2,expected_file2) <= 500); diff --git a/nodejs-mapnik-system-libraries.patch b/nodejs-mapnik-system-libraries.patch new file mode 100644 index 0000000..99f952a --- /dev/null +++ b/nodejs-mapnik-system-libraries.patch @@ -0,0 +1,132 @@ +commit 05bbb2ebaf683b022ef716df757a620f1bde4119 +Author: Tom Hughes +Date: Sat Sep 10 12:00:00 2016 +0100 + + Build against system libraries + +diff --git a/bin/mapnik-index.js b/bin/mapnik-index.js +index 0e18ada..04430dc 100755 +--- a/bin/mapnik-index.js ++++ b/bin/mapnik-index.js +@@ -3,7 +3,7 @@ + 'use strict'; + + var path = require('path'), +- bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), ++ bindingPath = path.resolve(path.join(__dirname, '..', 'lib', 'binding', 'mapnik.node')), + program = path.join(path.dirname(bindingPath), 'bin', 'mapnik-index'), + spawn = require('child_process').spawn, + fs = require('fs'); +diff --git a/bin/mapnik-shapeindex.js b/bin/mapnik-shapeindex.js +index 0d73b7f..d4fed9f 100755 +--- a/bin/mapnik-shapeindex.js ++++ b/bin/mapnik-shapeindex.js +@@ -3,7 +3,7 @@ + 'use strict'; + + var path = require('path'), +- bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), ++ bindingPath = path.resolve(path.join(__dirname, '..', 'lib', 'binding', 'mapnik.node')), + shapeindex = path.join(path.dirname(bindingPath), 'bin', 'shapeindex'), + spawn = require('child_process').spawn, + fs = require('fs'); +diff --git a/binding.gyp b/binding.gyp +index dd58659..4f024e7 100644 +--- a/binding.gyp ++++ b/binding.gyp +@@ -54,16 +54,8 @@ + 4267 + ], + 'include_dirs': [ +- './mason_packages/.link/include/', +- './mason_packages/.link/include/freetype2', +- './mason_packages/.link/include/cairo', + './src', + "= 3.0.12 -BuildRequires: mapnik-static >= 3.0.12 -BuildRequires: protozero-devel >= 1.4.2 +BuildRequires: mapnik-devel >= %{mapnik_version} +BuildRequires: mapnik-static >= %{mapnik_version} +BuildRequires: protozero-devel >= %{protozero_version} +BuildRequires: protozero-static >= %{protozero_version} BuildRequires: boost-devel BuildRequires: libicu-devel BuildRequires: freetype-devel @@ -43,12 +48,12 @@ BuildRequires: polyclipping-devel BuildRequires: protobuf-lite-devel BuildRequires: libtool-ltdl-devel BuildRequires: libxml2-devel -BuildRequires: npm(mapnik-vector-tile) >= 1.2.2 +BuildRequires: npm(mapnik-vector-tile) >= %{mapnik_vector_tile_version} BuildRequires: mapnik-utils BuildRequires: npm(mocha) BuildRequires: npm(sphericalmercator) -BuildRequires: npm(nan) >= 2.4.0 +BuildRequires: npm(nan) >= 2.5.0 %{?nodejs_default_filter} @@ -61,7 +66,7 @@ BuildRequires: npm(nan) >= 2.4.0 %nodejs_fixdep --remove protozero %nodejs_fixdep --dev --move nan %nodejs_fixdep --dev --move mapnik-vector-tile -rm -rf deps/protozero node_modules +rm -rf deps node_modules echo '{}' > common.gypi @@ -76,6 +81,7 @@ export CXXFLAGS="%{optflags}" export LDFLAGS="%{?__global_ldflags}" node-gyp configure -- -Dmodule_name=mapnik -Dmodule_path=lib/binding node-gyp build +cp -p build/lib/binding/mapnik.node lib/binding %install @@ -99,6 +105,9 @@ ln -s %{nodejs_sitelib}/mapnik/bin/mapnik-inspect.js %{buildroot}/%{_bindir}/ma %changelog +* Thu May 4 2017 Tom Hughes - 3.6.0-1 +- Update to 3.6.0 upstream release + * Wed Feb 15 2017 Tom Hughes - 3.5.14-4 - Patch tests for change in mapnik 3.0.13 diff --git a/sources b/sources index 8de2af6..0029249 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0894ffaa83f1f3ec8d31d1b422141d05 nodejs-mapnik-3.5.14.tar.gz +SHA512 (nodejs-mapnik-3.6.0.tar.gz) = d8749160c3bc7727b2428bc9027495f09b6db3ae71a80d11c6cadf1b48a9711726657465c037a4a98ec291cdf0c2eea8d0ae7c4847115e6f254236620719d09c