Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Revert "Enable npm install from source" #2349

Merged
merged 1 commit into from
Sep 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
path = platform/ios/vendor/SMCalloutView
url = https://github.com/nfarina/calloutview.git

[submodule "src/mbgl/util/geojsonvt"]
path = src/mbgl/util/geojsonvt
url = https://github.com/mapbox/geojson-vt-cpp
30 changes: 2 additions & 28 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ function abort { >&2 echo -e "\033[1m\033[31m$1\033[0m"; exit 1; }
function info { >&2 echo -e "\033[1m\033[33m$1\033[0m"; }
function warn { >&2 echo -e "\033[1m\033[33m$1\033[0m"; }

if [ -d "`pwd`/.git" ]; then
info "This build is within a git repository"
export MASON_DIR="`pwd`/.mason"
export PATH="${MASON_DIR}:${PATH}"
else
info "This build is NOT within a git repository"
which mason || abort "You must install mason to build mapbox-gl-native (https://github.com/mapbox/mason)"
export MASON_DIR="$(dirname $(readlink $(which mason)))"
fi
# Install mason
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

# You can override the function for a particular set of flags by defining a
# print_XXX_flags function in your dependencies.sh file
Expand All @@ -44,23 +37,6 @@ function print_flags {
fi
}

function print_build_flags {
local NAME=$1; shift
if [ "$(type -t print_${NAME}_flags)" = 'function' ]; then
print_${NAME}_flags
else
local VERSION=`echo "${NAME}_VERSION" | tr "[:lower:]" "[:upper:]"`
if [ ! -z ${!VERSION:-} ] ; then
mason build ${NAME} ${!VERSION}
for FLAGS in "$@" ; do
CONFIG+=" '${NAME}_${FLAGS}%': $(quote_flags $(mason ${FLAGS} ${NAME} ${!VERSION})),"$LN
done
else
warn "* Not using ${NAME}"
fi
fi
}

function print_default_flags {
:
}
Expand Down Expand Up @@ -117,8 +93,6 @@ print_flags libuv static_libs cflags ldflags
print_flags zlib static_libs cflags ldflags
print_flags nunicode static_libs cflags ldflags
print_flags libzip static_libs cflags ldflags
print_build_flags geojsonvt static_libs cflags ldflags
print_flags variant static_libs cflags ldflags

CONFIG+=" }
}
Expand Down
5 changes: 0 additions & 5 deletions gyp/core.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@
'<@(libuv_cflags)',
'<@(opengl_cflags)',
'<@(boost_cflags)',
'<@(geojsonvt_cflags)',
'<@(variant_cflags)',
],
'cflags': [
'<@(libuv_cflags)',
'<@(opengl_cflags)',
'<@(geojsonvt_cflags)',
'<@(variant_cflags)',
'-fPIC'
],
'ldflags': [
Expand All @@ -47,7 +43,6 @@
],
'libraries': [
'<@(libuv_static_libs)',
'<@(geojsonvt_static_libs)',
],
},

Expand Down
2 changes: 1 addition & 1 deletion gyp/version.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/include/mbgl/util/version.hpp',
],
'action': ['<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)'],
'action': ['<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)', '<!@(git describe --tags --always --abbrev=0)', '<!@(git rev-parse HEAD)'],
}
],
'direct_dependent_settings': {
Expand Down
2 changes: 0 additions & 2 deletions scripts/android/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ LIBUV_VERSION=1.4.0
ZLIB_VERSION=system
NUNICODE_VERSION=1.5.1
LIBZIP_VERSION=0.11.2
GEOJSONVT_VERSION=1.1.0
VARIANT_VERSION=1.0

export MASON_ANDROID_ABI=${MASON_PLATFORM_VERSION}
45 changes: 14 additions & 31 deletions scripts/build-version.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/usr/bin/env python

import sys, os, errno, re, subprocess
import sys, os, errno, re

DEFAULT_TAG = [0, 0, 0]
DEFAULT_REV = 'unknown'

def is_git_repo():
try:
subprocess.check_output("git rev-parse", shell=True)
return True
except subprocess.CalledProcessError as exc:
return False
output_dir = sys.argv[1]

def parse_tag(raw_tag):
return map(int, re.sub("[^0-9.]", "", raw_tag).split('.'))
if len(sys.argv) <= 3:
tag = [0, 0, 0]
rev = sys.argv[2][0:8]
else:
# When they're identical, the git describe can't find a tag and reports the rev instead.
if sys.argv[2] == sys.argv[3]:
tag = [0, 0, 0]
else:
ver = re.sub("[^0-9.]", "", sys.argv[2])
tag = map(int, ver.split('.'))
rev = sys.argv[3][0:8]

def parse_rev(raw_rev):
return raw_rev[0:8]

def mkdir_p(path):
try:
Expand All @@ -27,24 +27,6 @@ def mkdir_p(path):
else: raise


output_dir = sys.argv[1]

if is_git_repo():
raw_tag = subprocess.check_output("git describe --tags --always --abbrev=0", shell=True)
raw_rev = subprocess.check_output("git rev-parse HEAD", shell=True)

# When they're identical, the "git describe" can't find a tag and reports the rev instead.
if raw_tag == raw_rev:
tag = DEFAULT_TAG
rev = parse_rev(raw_rev)
else:
tag = parse_tag(raw_tag)
rev = parse_rev(raw_rev)
else:
tag = DEFAULT_TAG
rev = DEFAULT_REV


header = """// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#ifndef MBGL_UTIL_VERSION
#define MBGL_UTIL_VERSION
Expand Down Expand Up @@ -78,3 +60,4 @@ def mkdir_p(path):
header_path = os.path.join(output_dir, 'include/mbgl/util/version.hpp')
mkdir_p(os.path.dirname(header_path))
with open(header_path, 'w') as f: f.write(header)

2 changes: 0 additions & 2 deletions scripts/ios/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ BOOST_VERSION=1.57.0
SQLITE_VERSION=system
LIBUV_VERSION=0.10.28
ZLIB_VERSION=system
GEOJSONVT_VERSION=1.1.0
VARIANT_VERSION=1.0
6 changes: 2 additions & 4 deletions scripts/ios/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,12 @@ if [[ "${BUILD_FOR_DEVICE}" == true ]]; then
-o ${OUTPUT}/static/lib${NAME}.a \
${LIBS[@]/#/build/${BUILDTYPE}-iphoneos/libmbgl-} \
${LIBS[@]/#/build/${BUILDTYPE}-iphonesimulator/libmbgl-} \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a` \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a`
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a`
else
libtool -static -no_warning_for_no_symbols \
-o ${OUTPUT}/static/lib${NAME}.a \
${LIBS[@]/#/build/${BUILDTYPE}-iphonesimulator/libmbgl-} \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a` \
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a`
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a`
fi
echo "Created ${OUTPUT}/static/lib${NAME}.a"

Expand Down
2 changes: 0 additions & 2 deletions scripts/linux/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ LIBUV_VERSION=0.10.28
ZLIB_VERSION=system
NUNICODE_VERSION=1.5.1
LIBZIP_VERSION=0.11.2
GEOJSONVT_VERSION=1.1.0
VARIANT_VERSION=1.0

function print_opengl_flags {
CONFIG+=" 'opengl_cflags%': $(quote_flags $(pkg-config gl x11 --cflags)),"$LN
Expand Down
10 changes: 4 additions & 6 deletions scripts/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ HOST_VERSION ?= $(BUILD_VERSION)
export MASON_PLATFORM=$(HOST)
export MASON_PLATFORM_VERSION=$(HOST_VERSION)

ifneq (,$(wildcard scripts/$(HOST)/$(HOST_VERSION)/configure.sh))
CONFIGURE_FILES += scripts/$(HOST)/$(HOST_VERSION)/configure.sh
endif

HOST_SLUG = $(HOST)-$(HOST_VERSION)
CONFIGURE_FILES = scripts/$(HOST)/configure.sh
ifneq (,$(wildcard scripts/$(HOST)/$(HOST_VERSION)/configure.sh))
Expand All @@ -38,7 +34,6 @@ default: ;

#### Dependencies ##############################################################

ifneq (,$(wildcard .git/.))
SUBMODULES += .mason/mason.sh
.mason/mason.sh:
./scripts/flock.py .git/Submodule.lock git submodule update --init .mason
Expand All @@ -47,6 +42,10 @@ SUBMODULES += styles/styles
styles/styles:
./scripts/flock.py .git/Submodule.lock git submodule update --init styles

SUBMODULES += src/mbgl/util/geojsonvt/geojsonvt.hpp
src/mbgl/util/geojsonvt/geojsonvt.hpp:
./scripts/flock.py .git/Submodule.lock git submodule update --init src/mbgl/util/geojsonvt

ifeq ($(HOST),ios)
SUBMODULES += platform/ios/vendor/SMCalloutView/SMCalloutView.h
platform/ios/vendor/SMCalloutView/SMCalloutView.h:
Expand All @@ -56,7 +55,6 @@ SUBMODULES += test/ios/KIF/KIF.xcodeproj
test/ios/KIF/KIF.xcodeproj:
./scripts/flock.py .git/Submodule.lock git submodule update --init test/ios/KIF
endif
endif

# Wildcard targets get removed after build by default, but we want to preserve the config.
.PRECIOUS: config/%.gypi
Expand Down
2 changes: 0 additions & 2 deletions scripts/osx/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ LIBUV_VERSION=0.10.28
ZLIB_VERSION=system
NUNICODE_VERSION=1.5.1
LIBZIP_VERSION=0.11.2
GEOJSONVT_VERSION=1.1.0
VARIANT_VERSION=1.0
3 changes: 3 additions & 0 deletions scripts/osx/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ BUILDTYPE=${BUILDTYPE:-Release}
mapbox_time "checkout_styles" \
git submodule update --init styles

mapbox_time "checkout_geojsonvt" \
git submodule update --init src/mbgl/util/geojsonvt

mapbox_time "compile_program" \
make xosx -j${JOBS} BUILDTYPE=${BUILDTYPE}

Expand Down
3 changes: 1 addition & 2 deletions src/mbgl/map/annotation.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#include <mapbox/geojsonvt/geojsonvt_convert.hpp>

#include <mbgl/map/annotation.hpp>
#include <mbgl/annotation/point_annotation.hpp>
#include <mbgl/annotation/shape_annotation.hpp>
#include <mbgl/map/tile_id.hpp>
#include <mbgl/map/live_tile.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/geojsonvt/geojsonvt_convert.hpp>
#include <mbgl/util/ptr.hpp>
#include <mbgl/util/string.hpp>

Expand Down
3 changes: 1 addition & 2 deletions src/mbgl/map/annotation.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#ifndef MBGL_MAP_ANNOTATIONS
#define MBGL_MAP_ANNOTATIONS

#include <mapbox/geojsonvt/geojsonvt.hpp>

#include <mbgl/map/map.hpp>
#include <mbgl/map/geometry_tile.hpp>
#include <mbgl/map/tile_id.hpp>
#include <mbgl/style/style_properties.hpp>
#include <mbgl/style/types.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/geojsonvt/geojsonvt.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/vec.hpp>

Expand Down
1 change: 1 addition & 0 deletions src/mbgl/util/geojsonvt
Submodule geojsonvt added at 995ffc
3 changes: 0 additions & 3 deletions test/test.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,13 @@
'libraries': [
'<@(libuv_static_libs)',
'<@(sqlite_static_libs)',
'<@(geojsonvt_static_libs)',
],
'variables': {
'cflags_cc': [
'<@(libuv_cflags)',
'<@(opengl_cflags)',
'<@(boost_cflags)',
'<@(sqlite_cflags)',
'<@(geojsonvt_cflags)',
'<@(variant_cflags)',
],
'ldflags': [
'<@(libuv_ldflags)',
Expand Down