From 636fedff122dc254ec77ea5504cf8d94acd8b351 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 10 Sep 2014 14:24:29 -0400 Subject: [PATCH 1/8] make context active before clearing buffers --- common/headless_view.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/headless_view.cpp b/common/headless_view.cpp index f790d90ce..0fce22398 100644 --- a/common/headless_view.cpp +++ b/common/headless_view.cpp @@ -113,6 +113,8 @@ void HeadlessView::resize(int width, int height) { } void HeadlessView::clear_buffers() { + make_active(); + #if MBGL_USE_CGL glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); From c836bc2b01c1c8642875d86126c1ef2a76dfd359 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 10 Sep 2014 15:11:17 -0400 Subject: [PATCH 2/8] Revert "make context active before clearing buffers" This reverts commit 636fedff122dc254ec77ea5504cf8d94acd8b351. --- common/headless_view.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/headless_view.cpp b/common/headless_view.cpp index 0fce22398..f790d90ce 100644 --- a/common/headless_view.cpp +++ b/common/headless_view.cpp @@ -113,8 +113,6 @@ void HeadlessView::resize(int width, int height) { } void HeadlessView::clear_buffers() { - make_active(); - #if MBGL_USE_CGL glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); From e26020ccacdb146ecba62496099038816a417e87 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 15 Sep 2014 11:23:09 -0700 Subject: [PATCH 3/8] Add gcc back to build matrix (fixes #465) --- .travis.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index b641c1158..42cca837c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,23 @@ language: cpp -os: - - linux - - osx - -compiler: - - clang +matrix: + exclude: + - os: linux + include: + - os: linux + env: BUILDTYPE=Release + compiler: clang + - os: linux + env: BUILDTYPE=Debug + compiler: clang + - os: linux + env: BUILDTYPE=Release + compiler: gcc + - os: osx + env: BUILDTYPE=Debug + compiler: clang env: - matrix: - - BUILDTYPE=Release - - BUILDTYPE=Debug global: - secure: "bG4YYWMfl9API0MSRgmOaJrlGLv06tRg9KJNawBieZvBJbITPpxVGJZT3/l/SEJ+Rl15e2dRex4k+MGQlmT2SqPQxTEYWv1qxNigKPPcla7IWeNmWWqW8uVvFjdglojgBOK2k/xErVQtA4zDfi3mwSXH4DKwquXWsoEKmX2SV7M=" - secure: "Cbvap9ubVKgjPe3hUhI6JGeDZzBXHpOG9RaYKh+SdoIPhKnlJiNOYm1egomi+e4uqJInlFKuVHTw7Ng9Cun6Zm0jIxpkSchv1GpsR7hmB3UGnGed19Dw8121FwuUaktN+4YnbVlsyd+u8EHD3+h58t4eELrLrZolM4rS7DL6caA=" From 65185ca3776594b855965c200e55b8dc673db715 Mon Sep 17 00:00:00 2001 From: AJ Ashton Date: Wed, 17 Sep 2014 14:10:40 -0700 Subject: [PATCH 4/8] Update Ubuntu instructions in README [skip ci] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3eda50210..3887e57ec 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,9 @@ Set the environment variable `MAPBOX_ACCESS_TOKEN` to your token. Ensure you have git and other build essentials: sudo apt-get update - sudo apt-get install git build-essential zlib1g-dev automake libtool xutils-dev make cmake pkg-config nodejs-legacy curl + sudo apt-get install git build-essential zlib1g-dev automake libtool xutils-dev make cmake pkg-config nodejs-legacy curl libuv-dev -Install a `-std=c++11` capable compiler +If you are running Ubuntu 13.10 or older, install a `-std=c++11` capable compiler: sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test sudo apt-get update From 5788714e3b2f0e5d22293bb20fb726a17e68dc86 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 17 Sep 2014 18:26:33 -0700 Subject: [PATCH 5/8] fix 64-bit iOS builds --- Makefile | 17 ++++++++++++----- README.md | 4 ++++ ios/mapbox-gl-cocoa | 2 +- mapboxgl.gyp | 1 + setup-libraries.sh | 37 ++++++++++++++++++++----------------- 5 files changed, 38 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index d5d713613..b7aa397e1 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,12 @@ setup: config.gypi config.gypi: ./setup-libraries.sh +xlibs: + @./mapnik-packaging/osx/darwin_configure.sh osx + +ilibs: + @./mapnik-packaging/osx/darwin_configure.sh ios + # Builds the regular library mbgl: config.gypi mapboxgl.gyp node deps/run_gyp mapboxgl.gyp --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make @@ -37,7 +43,7 @@ xtest: config.gypi clear_xcode_cache node ##### Makefile builds ########################################################## -# Builds the linux app with make. This is also used by Travis CI +# Builds the linux app with make. linux: config.gypi linux/mapboxgl-app.gyp node deps/run_gyp linux/mapboxgl-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make $(MAKE) -C build/linux BUILDTYPE=$(BUILDTYPE) V=$(V) linuxapp @@ -71,14 +77,14 @@ clear_xcode_cache: fi # build Mac OS X project for Xcode -xproj-cli: config.gypi macosx/mapboxgl-app.gyp clear_xcode_cache node +xproj-cli: config.gypi xlibs macosx/mapboxgl-app.gyp clear_xcode_cache node deps/run_gyp macosx/mapboxgl-app.gyp --depth=. --generator-output=./build -f xcode xproj: xproj-cli open ./build/macosx/mapboxgl-app.xcodeproj # build iOS project for Xcode -iproj-cli: config.gypi ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp clear_xcode_cache node +iproj-cli: config.gypi ilibs ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp clear_xcode_cache node deps/run_gyp ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp --depth=. --generator-output=./build -f xcode iproj: iproj-cli @@ -98,7 +104,8 @@ clean: clear_xcode_cache -rm -rf ./config.gypi distclean: clean - -rm -rf ./config.gypi - -rm -rf ./mapnik-packaging/osx/out/ + -rm -rf ./mapnik-packaging/osx/out/build-* + -rm -rf ./mapnik-packaging/osx/out/universal + -find ./mapnik-packaging/osx/out/packages -type d ! -name 'packages' -maxdepth 1 -exec rm -rf {} \; .PHONY: mbgl test linux diff --git a/README.md b/README.md index 3887e57ec..82ad7966e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ To create projects, you can run: and settings storage. This is what is also being built on Linux. - `make linux`: Builds the Linux GLFW application with `make`. +Note that if you are doing iOS development as well, to toggle from iOS back to OS X, you will need to `make xproj` again. + Target OS: 10.9+ ## iOS @@ -74,6 +76,8 @@ This downloads all required dependencies, builds them and creates universal libr Lastly, `make iproj` to create and open an Xcode project with an iOS-specific view controller housing. +Note that if you are doing OS X development as well, to toggle from OS X back to iOS, you will need to `make iproj` again. + Target devices: iPhone 4 and above (4S, 5, 5c, 5s) and iPad 2 and above (3, 4, mini and/or retina). Target OS: 7.0+ diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa index 8a315662b..16f6352d4 160000 --- a/ios/mapbox-gl-cocoa +++ b/ios/mapbox-gl-cocoa @@ -1 +1 @@ -Subproject commit 8a315662b365566cb37b3c9f13da6d6730d0abdb +Subproject commit 16f6352d4d53c5ca1bb46e3deb73fdddc1db4558 diff --git a/mapboxgl.gyp b/mapboxgl.gyp index f389e7d48..dcd89f3a7 100644 --- a/mapboxgl.gyp +++ b/mapboxgl.gyp @@ -196,6 +196,7 @@ 'xcode_settings': { 'SDKROOT': 'iphoneos', 'SUPPORTED_PLATFORMS':['iphonesimulator','iphoneos'], + 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], 'TARGETED_DEVICE_FAMILY': '1,2', 'CODE_SIGN_IDENTITY': 'iPhone Developer', 'IPHONEOS_DEPLOYMENT_TARGET': '7.0', diff --git a/setup-libraries.sh b/setup-libraries.sh index dc0ced33e..42c9ab108 100755 --- a/setup-libraries.sh +++ b/setup-libraries.sh @@ -51,7 +51,7 @@ set -u NODE=$(which node) NPM=$(which npm) -MP_HASH="e741a075d28812e5d16b581e1540248fe19c52ce" +MP_HASH="eb8c6d7e6bd6adb42c232ed806b889f3e6825bb5" DIR_HASH=$(echo `pwd` | git hash-object --stdin) if [ ! -d 'mapnik-packaging/' ]; then git clone https://github.com/mapnik/mapnik-packaging.git @@ -67,9 +67,13 @@ export CXX11=true if [ ${UNAME} = 'Darwin' ]; then if [ ! -z "${TRAVIS:-}" ]; then - if aws s3 cp s3://mapbox-gl-testing/dependencies/build-cpp11-libcpp-universal_${MP_HASH}_${DIR_HASH}.tar.gz ./out/ ; then - rm -rf out/build-cpp11-libcpp-universal - tar -xzf out/build-cpp11-libcpp-universal_${MP_HASH}_${DIR_HASH}.tar.gz + if aws s3 cp s3://mapbox-gl-testing/dependencies/build-cpp11-libcpp-osx_${MP_HASH}_${DIR_HASH}.tar.gz ./out/ ; then + if aws s3 cp s3://mapbox-gl-testing/dependencies/build-cpp11-libcpp-ios_${MP_HASH}_${DIR_HASH}.tar.gz ./out/ ; then + rm -rf out/build-cpp11-libcpp-x86_64-macosx + rm -rf out/build-cpp11-libcpp-universal + tar -xzf out/build-cpp11-libcpp-osx_${MP_HASH}_${DIR_HASH}.tar.gz + tar -xzf out/build-cpp11-libcpp-ios_${MP_HASH}_${DIR_HASH}.tar.gz + fi fi fi @@ -95,12 +99,10 @@ source iPhoneSimulator.sh if [ ! -f out/build-cpp11-libcpp-i386-iphonesimulator/lib/libuv.a ] ; then ./scripts/build_libuv.sh ; fi echo ' ...done' -# libs conflict with MacOSX build -# TODO: need to break apart targets -#source iPhoneSimulator64.sh -# if [ ! -f out/build-cpp11-libcpp-x86_64-iphonesimulator/lib/libpng.a ] ; then ./scripts/build_png.sh ; fi -# if [ ! -f out/build-cpp11-libcpp-x86_64-iphonesimulator/lib/libuv.a ] ; then ./scripts/build_libuv.sh ; fi -# echo ' ...done' +source iPhoneSimulator64.sh + if [ ! -f out/build-cpp11-libcpp-x86_64-iphonesimulator/lib/libpng.a ] ; then ./scripts/build_png.sh ; fi + if [ ! -f out/build-cpp11-libcpp-x86_64-iphonesimulator/lib/libuv.a ] ; then ./scripts/build_libuv.sh ; fi + echo ' ...done' source MacOSX.sh if [ ! -f out/build-cpp11-libcpp-x86_64-macosx/lib/libpng.a ] ; then ./scripts/build_png.sh ; fi @@ -111,21 +113,22 @@ source MacOSX.sh if [ ! -d out/build-cpp11-libcpp-x86_64-macosx/include/boost ] ; then ./scripts/build_boost.sh `pwd`/../../src/ `pwd`/../../include/ `pwd`/../../linux/ `pwd`/../../common/ ; fi echo ' ...done' +# setup iOS universal libs ./scripts/make_universal.sh if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - tar -zcf out/build-cpp11-libcpp-universal_${MP_HASH}_${DIR_HASH}.tar.gz out/build-cpp11-libcpp-universal - aws s3 cp --acl public-read out/build-cpp11-libcpp-universal_${MP_HASH}_${DIR_HASH}.tar.gz s3://mapbox-gl-testing/dependencies/ + tar -zcf out/build-cpp11-libcpp-ios_${MP_HASH}_${DIR_HASH}.tar.gz out/build-cpp11-libcpp-universal + aws s3 cp --acl public-read out/build-cpp11-libcpp-ios_${MP_HASH}_${DIR_HASH}.tar.gz s3://mapbox-gl-testing/dependencies/ + tar -zcf out/build-cpp11-libcpp-osx_${MP_HASH}_${DIR_HASH}.tar.gz out/build-cpp11-libcpp-x86_64-macosx + aws s3 cp --acl public-read out/build-cpp11-libcpp-osx_${MP_HASH}_${DIR_HASH}.tar.gz s3://mapbox-gl-testing/dependencies/ fi fi cd ../../ -./configure \ ---pkg-config-root=`pwd`/mapnik-packaging/osx/out/build-cpp11-libcpp-universal/lib/pkgconfig \ ---boost=`pwd`/mapnik-packaging/osx/out/build-cpp11-libcpp-universal \ ---npm=$NPM \ ---node=$NODE + +# default to OS X build product symlinking +./mapnik-packaging/osx/darwin_configure.sh osx elif [ ${UNAME} = 'Linux' ]; then From 647335c218632fb9c3dfab94230331b9f879e6e0 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 17 Sep 2014 18:51:55 -0700 Subject: [PATCH 6/8] bump Cocoa --- ios/mapbox-gl-cocoa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa index 16f6352d4..d4bc3c644 160000 --- a/ios/mapbox-gl-cocoa +++ b/ios/mapbox-gl-cocoa @@ -1 +1 @@ -Subproject commit 16f6352d4d53c5ca1bb46e3deb73fdddc1db4558 +Subproject commit d4bc3c644bb788fdbd0103af00607e73fcd047a1 From eb1f1a7052124b3cf5b107ff64338c3155a58410 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 18 Sep 2014 09:57:33 -0700 Subject: [PATCH 7/8] bump Cocoa for location fixes --- ios/mapbox-gl-cocoa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa index d4bc3c644..3cfa08163 160000 --- a/ios/mapbox-gl-cocoa +++ b/ios/mapbox-gl-cocoa @@ -1 +1 @@ -Subproject commit d4bc3c644bb788fdbd0103af00607e73fcd047a1 +Subproject commit 3cfa08163ae0dd1e1e29383973ba1f3bdb72854a From 0039479d6e8df0d0bb9a16a178baa54e5712b271 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 18 Sep 2014 10:29:25 -0700 Subject: [PATCH 8/8] bump Cocoa one more time --- ios/mapbox-gl-cocoa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa index 3cfa08163..461024ae4 160000 --- a/ios/mapbox-gl-cocoa +++ b/ios/mapbox-gl-cocoa @@ -1 +1 @@ -Subproject commit 3cfa08163ae0dd1e1e29383973ba1f3bdb72854a +Subproject commit 461024ae406fd98b7a27d3297298cf68284e32ad