From acda1fcde8993c5abe4e4505c95bb2e7a53316b2 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Wed, 21 Jan 2015 12:55:52 +1100 Subject: [PATCH 1/5] Add imagemagic to OSX README brew command --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d1f5211c1..032848fad 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,14 @@ implemented in C++11, currently targeting iOS, OS X, and Ubuntu Linux. We try to link to as many system-provided libraries as possible. When these are unavailable or too outdated, we run a thin build-script layer called [Mason](https://github.com/mapbox/mason) to automate builds, and load precompiled binary packages when possible. -Be sure to pull down all submodules first: +Be sure to pull down all submodules first: git submodule init git submodule update ## OS X -On OS X, we are using `zlib`, `SQLite3`, `libcurl` and `libpng` provided by the operating system. In addition to that, you need to have the Boost headers installed. To install all prerequisites, use [Homebrew](http://brew.sh/) and type `brew install pkg-config boost`. +On OS X, we are using `zlib`, `SQLite3`, `libcurl` and `libpng` provided by the operating system. In addition to that, you need to have the Boost headers installed and ImageMagick for running tests. To install all prerequisites, use [Homebrew](http://brew.sh/) and type `brew install pkg-config boost imagemagick`. To create projects, you can run: From 161e187c6f31b48ec750b5f17efd17e88eadd809 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 14 Jan 2015 13:02:16 -0800 Subject: [PATCH 2/5] only run clear_xcode_cache on OS X --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 933fb1340..35a3d866e 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,7 @@ render: build/render/Makefile .PHONY: clear_xcode_cache clear_xcode_cache: +ifeq ($(PLATFORM), osx) @CUSTOM_DD=`defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation 2>/dev/null`; \ if [[ $$CUSTOM_DD ]]; then \ echo clearing files in $$CUSTOM_DD older than one day; \ @@ -130,6 +131,7 @@ clear_xcode_cache: echo 'removing ~/Library/Application\ Support/Mapbox\ GL/cache.db'; \ rm ~/Library/Application\ Support/Mapbox\ GL/cache.db; \ fi +endif xproj: build/macosx/mapboxgl-app.xcodeproj open ./build/macosx/mapboxgl-app.xcodeproj From bee9ada450ba0a436837bbff71f960454b231835 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 21 Jan 2015 14:29:41 -0500 Subject: [PATCH 3/5] clear sqlite cache --- Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 35a3d866e..bacf37355 100644 --- a/Makefile +++ b/Makefile @@ -127,10 +127,6 @@ ifeq ($(PLATFORM), osx) echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/mapboxgl-app-* older than one day'; \ find ~/Library/Developer/Xcode/DerivedData/mapboxgl-app-* -mtime +1 | xargs rm -rf; \ fi; \ - if [[ -e ~/Library/Application\ Support/Mapbox\ GL/cache.db ]]; then \ - echo 'removing ~/Library/Application\ Support/Mapbox\ GL/cache.db'; \ - rm ~/Library/Application\ Support/Mapbox\ GL/cache.db; \ - fi endif xproj: build/macosx/mapboxgl-app.xcodeproj @@ -149,7 +145,21 @@ lproj: build/linux/mapboxgl-app.xcodeproj ##### Maintenace operations #################################################### -clean: clear_xcode_cache +.PHONY: clear_sqlite_cache +clear_sqlite_cache: +ifeq ($(PLATFORM), osx) + if [ -e ~/Library/Application\ Support/Mapbox\ GL/cache.db ]; then \ + echo 'removing ~/Library/Application\ Support/Mapbox\ GL/cache.db'; \ + rm ~/Library/Application\ Support/Mapbox\ GL/cache.db; \ + fi +else + if [ -e /tmp/mbgl-cache.db ]; then \ + echo 'removing /tmp/mbgl-cache.db'; \ + rm /tmp/mbgl-cache.db; \ + fi +endif + +clean: clear_sqlite_cache clear_xcode_cache -find ./deps/gyp -name "*.pyc" -exec rm {} \; -rm -rf ./build/ -rm -rf ./macosx/build/ From c18089b6d7964fc62b9c0ce1c0521b9b55d5012b Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 21 Jan 2015 14:35:59 -0500 Subject: [PATCH 4/5] syntax fixes --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bacf37355..f760ccca7 100644 --- a/Makefile +++ b/Makefile @@ -119,14 +119,14 @@ render: build/render/Makefile clear_xcode_cache: ifeq ($(PLATFORM), osx) @CUSTOM_DD=`defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation 2>/dev/null`; \ - if [[ $$CUSTOM_DD ]]; then \ + if [ $$CUSTOM_DD ]; then \ echo clearing files in $$CUSTOM_DD older than one day; \ find $$CUSTOM_DD/mapboxgl-app-* -mtime +1 | xargs rm -rf; \ fi; \ - if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]] && [[ ! $$CUSTOM_DD ]]; then \ + if [ -d ~/Library/Developer/Xcode/DerivedData/ ] && [ ! $$CUSTOM_DD ]; then \ echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/mapboxgl-app-* older than one day'; \ find ~/Library/Developer/Xcode/DerivedData/mapboxgl-app-* -mtime +1 | xargs rm -rf; \ - fi; \ + fi endif xproj: build/macosx/mapboxgl-app.xcodeproj From ad7f68e3861e681e2847f608b7de2309edcc0484 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 21 Jan 2015 15:16:52 -0500 Subject: [PATCH 5/5] simplify clear_sqlite_cache --- Makefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f760ccca7..3bb8e2d8f 100644 --- a/Makefile +++ b/Makefile @@ -148,15 +148,9 @@ lproj: build/linux/mapboxgl-app.xcodeproj .PHONY: clear_sqlite_cache clear_sqlite_cache: ifeq ($(PLATFORM), osx) - if [ -e ~/Library/Application\ Support/Mapbox\ GL/cache.db ]; then \ - echo 'removing ~/Library/Application\ Support/Mapbox\ GL/cache.db'; \ - rm ~/Library/Application\ Support/Mapbox\ GL/cache.db; \ - fi + rm -f ~/Library/Application\ Support/Mapbox\ GL/cache.db else - if [ -e /tmp/mbgl-cache.db ]; then \ - echo 'removing /tmp/mbgl-cache.db'; \ - rm /tmp/mbgl-cache.db; \ - fi + rm -f /tmp/mbgl-cache.db endif clean: clear_sqlite_cache clear_xcode_cache