work around abi issues between nodes's v8 versions by compiling a version of node-mapnik against every one known to man

This commit is contained in:
Dane Springmeyer 2011-01-06 22:00:11 +00:00
parent a5b714fcd2
commit 464e51942c
2 changed files with 59 additions and 65 deletions

View file

@ -121,48 +121,6 @@ install_name_tool -id $INSTALL/libboost_thread.dylib libboost_thread.dylib
install_name_tool -change libboost_system.dylib $INSTALL/libboost_system.dylib libboost_filesystem.dylib
#install_name_tool -change libicui18n.46.dylib $INSTALL/libicui18n.46.dylib libboost_regex.dylib
# build a few versions of node
cd ../../deps
cd ../
wget http://nodejs.org/dist/node-v0.2.0.tar.gz
tar xvf node-v0.2.0.tar.gz
cd node-v0.2.0
./configure --prefix=$PREFIX/node20
make
make install
wget http://nodejs.org/dist/node-v0.2.6.tar.gz
tar xvf node-v0.2.6.tar.gz
cd node-v0.2.6
./configure --prefix=$PREFIX/node26
make
make install
cd ../
wget http://nodejs.org/dist/node-v0.3.0.tar.gz
tar xvf node-v0.3.0.tar.gz
cd node-v0.3.0
./configure --prefix=$PREFIX/node30
make
make install
cd ../
wget http://nodejs.org/dist/node-v0.3.3.tar.gz
tar xvf node-v0.3.3.tar.gz
cd node-v0.3.3
./configure --prefix=$PREFIX/node33
make
make install
# HEAD (master)
cd ../
git clone git://github.com/ry/node.git node-master
cd node-master
./configure --prefix=$PREFIX/node-34
make
make install
# rasterlite we must bundle as it is not available in the SQLite.framework
cd ../../deps
svn co https://www.gaia-gis.it/svn/librasterlite
@ -233,6 +191,29 @@ scons -j2 install
cp bindings/python/mapnik/_mapnik2.so osx/python/_mapnik2_31.so
# build a ton of versions of node (just to be safe about ABI)
cd ../../deps
for VER in {"0.2.4","0.2.5","0.2.6","0.3.0","0.3.1","0.3.2","0.3.3"}
do
wget http://nodejs.org/dist/node-v$VER.tar.gz
tar xvf node-v$VER.tar.gz
cd node-v$VER
./configure --prefix=$PREFIX/node$VER
make
make install
cd ../
done
# HEAD (master)
VER="0.3.4"
git clone git://github.com/ry/node.git node-master
cd node-master
./configure --prefix=$PREFIX/node$VER
make
make install
cd ../
# node-mapnik
cd ../../deps
git clone git://github.com/mapnik/node-mapnik.git
@ -241,13 +222,19 @@ export PATH=../../Library/Frameworks/Mapnik.framework/Programs:$PATH
CXXFLAGS=" -g -DNDEBUG -O3 -Wall -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -ansi -finline-functions -Wno-inline -fPIC -arch x86_64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DEV_MULTIPLICITY=0 -I/Library/Frameworks/Mapnik.framework/Versions/2.0/unix/include -I/Library/Frameworks/Mapnik.framework/Versions/2.0/unix/include/freetype2 "
VER="33"
mkdir build/default/src/$VER
mkdir mapnik/$VER
NODE_PREFIX="$PREFIX/node$VER"
export PATH=$NODE_PREFIX/bin:$PATH
OBJ="build/default/src/$VER/_mapnik_1.o"
TARGET="mapnik/$VER/_mapnik.node"
g++ $CXXFLAGS -I$NODE_PREFIX/include/node src/_mapnik.cc -c -o $OBJ
LDFLAGS="-L/Library/Frameworks/Mapnik.framework/Versions/2.0/unix/lib -lmapnik2 -bundle -undefined dynamic_lookup"
g++ $OBJ -o $TARGET $LDFLAGS
for VER in {"0.2.4","0.2.5","0.2.6","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4"}
for VER in {"0.3.4",}
do
mkdir build/default/src/$VER
mkdir mapnik/$VER
NODE_PREFIX="$PREFIX/node$VER"
export PATH=$NODE_PREFIX/bin:$PATH
OBJ="build/default/src/$VER/_mapnik_1.o"
TARGET="mapnik/$VER/_mapnik.node"
g++ $CXXFLAGS -I$NODE_PREFIX/include/node src/_mapnik.cc -c -o $OBJ
LDFLAGS="-L/Library/Frameworks/Mapnik.framework/Versions/2.0/unix/lib -lmapnik2 -bundle -undefined dynamic_lookup"
g++ $OBJ -o $TARGET $LDFLAGS
done
# then re-run wrap.py

View file

@ -17,7 +17,7 @@ def sym(target,link):
except OSError, e:
raise OSError('%s: %s' % (e,link))
def copy_all_items(pattern,place,recursive=False):
def copy_all_items(pattern,place,recursive=True):
items = glob.glob(pattern)
for i in items:
if recursive:
@ -30,7 +30,7 @@ if __name__ == "__main__":
# include headers for a full SDK?
INCLUDE_HEADERS = False
INCLUDE_HEADERS = True
# final resting place
@ -59,6 +59,19 @@ if __name__ == "__main__":
# point top level 'unix' to active one
sym(join(active,'unix'),join(framework,'unix'))
# create headers directory if needed
if INCLUDE_HEADERS:
if not os.path.exists(join(active,'unix/include')):
os.mkdir(join(active,'unix/include'))
# Mapnik Headers
if INCLUDE_HEADERS:
sym(join(active,'unix/include'),join(active,'Headers'))
sym(join(active,'Headers'),join(framework,'Headers'))
else:
# purge the installed headers of mapnik
os.system('rm -rf %s' % join(active,'unix/include'))
# install icu libs
copy_all_items('sources/lib/libicuu*dylib',join(active,'unix/lib'),recursive=True)
@ -93,13 +106,15 @@ if __name__ == "__main__":
copy_all_items('sources/include/freetype2/*',join(active,'unix/include/freetype2'),recursive=True)
copy_all_items('sources/include/ft2build.h',join(active,'unix/include/'),recursive=True)
# Node-mapnik bindings snapshot
# Node-mapnik bindings location
if not os.path.exists(join(active,'unix/lib/node')):
os.mkdir(join(active,'unix/lib/node'))
os.mkdir(join(active,'unix/lib/node/mapnik'))
sym(join(active,'unix/lib/node'),join(active,'Node'))
sym(join(active,'Node'),join(framework,'Node'))
copy_all_items('sources/lib/node/mapnik/*',join(active,'unix/lib/node/mapnik/'),recursive=True)
# do this later...
copy_all_items('deps/node-mapnik/mapnik/*',join(active,'unix/lib/node/mapnik/'),recursive=True)
# Resources
if not os.path.exists(join(active,'Resources')):
@ -108,15 +123,7 @@ if __name__ == "__main__":
# or link to /share
sym(join(active,'Resources'),join(framework,'Resources'))
shutil.copy('Info.plist',join(active,'Resources'))
# Mapnik Headers
if INCLUDE_HEADERS:
sym(join(active,'unix/include'),join(active,'Headers'))
sym(join(active,'Headers'),join(framework,'Headers'))
else:
# purge the installed headers of mapnik
os.system('rm -rf %s' % join(active,'unix/include'))
# Programs
sym(join(active,'unix/bin'),join(active,'Programs'))
sym(join(active,'Programs'),join(framework,'Programs'))