diff --git a/index.js b/index.js index a9f6f7ea7..f0d59f8dd 100755 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ if (process.platform === 'win32') { // HOME is undefined on windows process.env.HOME = process.env.USERPROFILE; // Add custom library paths to the PATH - process.env.PATH = path.join(__dirname,"node_modules/mapnik/lib/mapnik/lib") + + process.env.PATH = path.join(__dirname,"node_modules/mapnik/lib/binding/") + ";" + path.join(__dirname,"node_modules/zipfile/lib"); } diff --git a/platforms/windows/build.bat b/platforms/windows/build.bat index 52c07900d..ccdfbb5d4 100644 --- a/platforms/windows/build.bat +++ b/platforms/windows/build.bat @@ -1,4 +1,5 @@ @rem for some reason this causes script to exit @rem npm cache clean -rd /q /s node_modules -npm install --force --no-rollback \ No newline at end of file +call rd /q /s node_modules +call npm cache clean +call npm install --force \ No newline at end of file diff --git a/platforms/windows/excludes.txt b/platforms/windows/excludes.txt index 0170e9c74..d6a697d19 100644 --- a/platforms/windows/excludes.txt +++ b/platforms/windows/excludes.txt @@ -12,6 +12,7 @@ \ipch\ \include\ \obj\ +\build\ .exp .lib .pdb diff --git a/platforms/windows/package.bat b/platforms/windows/package.bat index a5af1ecbe..82e062b1f 100644 --- a/platforms/windows/package.bat +++ b/platforms/windows/package.bat @@ -1,70 +1,37 @@ set DEVROOT=c:\dev2 -@rem place c++ addons outside of node_modules for now -@rem to make it easier to remove/recreate node_modules -set DEST=node_modules set MAPNIK_INSTALL=c:\mapnik-v2.3.0 -set NODEEXE="C:\Program Files (x86)\nodejs\node.exe" -set MAPNIK_DEST=%DEST%\mapnik\lib\mapnik -set MAPNIK_DATA_DEST=%DEST%\mapnik\lib\mapnik\share -mkdir %MAPNIK_DATA_DEST% - -@rem make sure Python is on the PATH +set NODEEXE="c:\dev2\nodist\v\0.10.25\node.exe" set PATH=%PATH%;c:\Python27 - @rem change into current directory cd /d %~dp0 @rem then move to main tilemill folder cd ..\..\ set TILEMILL_DIR=%CD% - -@rem mkdir %DEST% - -@rem nuke any failed c++ module installs -@rem rd /q /s node_modules\bones\node_modules\jquery\node_modules\jsdom\node_modules\contextify -@rem rd /q /s node_modules\sqlite3 -rd /q /s node_modules\mapnik -rd /q /s node_modules\tilelive-mapnik\node_modules\mapnik -@rem rd /q /s node_modules\millstone\node_modules\srs -@rem rd /q /s node_modules\millstone\node_modules\zipfile -@rem rd /q /s node_modules\tilelive-mapnik\node_modules\eio +set DEST=%TILEMILL_DIR%\node_modules @rem remove then re-copy node-mapnik -xcopy /i /s /exclude:platforms\windows\excludes.txt %DEVROOT%\node-mapnik %DEST%\mapnik - +rd /q /s %TILEMILL_DIR%\node_modules\mapnik +rd /q /s %TILEMILL_DIR%\node_modules\tilelive-mapnik\node_modules\mapnik +xcopy /i /s /exclude:%TILEMILL_DIR%\platforms\windows\excludes.txt %DEVROOT%\node-mapnik %DEST%\mapnik @rem fixup paths to plugins making them relative @rem to future location of mapnik itself cd %DEST%\mapnik @rem - note, intentially not quoting the below -set MAPNIK_INPUT_PLUGINS=path.join(__dirname, 'mapnik/lib/mapnik/input') -set MAPNIK_FONTS=path.join(__dirname, 'mapnik/lib/mapnik/fonts') +set MAPNIK_INPUT_PLUGINS=path.join(__dirname, 'mapnik/input') +set MAPNIK_FONTS=path.join(__dirname, 'mapnik/fonts') python gen_settings.py @rem augment the settings -echo var path = require('path'); module.exports.env = {'ICU_DATA': path.join(__dirname, 'mapnik/share/icu'), 'GDAL_DATA': path.join(__dirname, 'mapnik/share/gdal'),'PROJ_LIB': path.join(__dirname, 'mapnik/share/proj') }; >> lib/mapnik_settings.js - +echo var path = require('path'); module.exports.env = {'GDAL_DATA': path.join(__dirname, 'mapnik/share/gdal'),'PROJ_LIB': path.join(__dirname, 'mapnik/share/proj') }; >> lib/binding/mapnik_settings.js -chdir /d %TILEMILL_DIR% -@rem symlink mapnik into main directory so npm is happy -@rem mklink /d /j node_modules/mapnik %DEST%/mapnik +set MAPNIK_DEST=%DEST%\mapnik\lib\binding\ +mkdir %MAPNIK_DEST%\share +mkdir %MAPNIK_DEST%\fonts +mkdir %MAPNIK_DEST%\input @rem - handle mapnik itself -rd /q /s %MAPNIK_DEST% -xcopy /i /s /exclude:platforms\windows\excludes.txt %MAPNIK_INSTALL% %MAPNIK_DEST% - -@rem - move all other C++ addons into place -@rem rd /q /s %DEST%\zipfile -@rem xcopy /i /s /exclude:platforms\windows\excludes.txt %DEVROOT%\node-zipfile %DEST%\zipfile -@rem rd /q /s %DEST%\srs -@rem xcopy /i /s /exclude:platforms\windows\excludes.txt %DEVROOT%\node-srs %DEST%\srs -@rem rd /q /s %DEST%\sqlite3 -@rem xcopy /i /s /exclude:platforms\windows\excludes.txt %DEVROOT%\node-sqlite3 %DEST%\sqlite3 -@rem rd /q /s %DEST%\contextify -@rem xcopy /i /s /exclude:platforms\windows\excludes.txt %DEVROOT%\contextify %DEST%\contextify - -@rem - move icu, proj, and gdal data into node-mapnik folder -rd /q /s %MAPNIK_DATA_DEST%\proj -xcopy /i /s %DEVROOT%\proj\nad %MAPNIK_DATA_DEST%\proj -rd /q /s %MAPNIK_DATA_DEST%\gdal -xcopy /i /s %DEVROOT%\gdal\data %MAPNIK_DATA_DEST%\gdal +xcopy /i /s /exclude:%TILEMILL_DIR%\platforms\windows\excludes.txt %MAPNIK_INSTALL%\lib %MAPNIK_DEST% +xcopy /i /s /exclude:%TILEMILL_DIR%\platforms\windows\excludes.txt %MAPNIK_INSTALL%\share %MAPNIK_DEST%\mapnik\share -del /q node.exe +del /q %TILEMILL_DIR%\node.exe xcopy %NODEEXE% %TILEMILL_DIR%\node.exe +chdir %TILEMILL_DIR%