From 0526aa45e7f51dd4534aa57a62778d620e255455 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Mon, 13 May 2013 18:57:03 -0400 Subject: [PATCH 1/3] Update libchromiumcontent to get its Python scripts * vendor/libchromiumcontent 3f6f01c...588f368 (17): > Merge pull request #8 from aroben/menu-controller > Merge pull request #6 from aroben/shell_dialogs > Fix typo in script/create-dist > Merge pull request #5 from aroben/python > Add libtest_support_chromiumcontent.a > Build and distribute libgtest.a > Stop trying to compile SQLitePersistentCookieStore separately > Update to latest Chromium trunk revision > Merge pull request #4 from aroben/atom > Actually compile the base/prefs code > Export symbols from base/prefs > Compile and export SQLitePersistentCookieStore > Export webkit/plugins headers > Export skia/ext headers > Export ui/surface headers, too > Export Skia symbols from libchromiumcontent > Update to match chrome/trunk --- brightray/vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index d5cef3b0fe5..588f36848bc 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit d5cef3b0fe5d3cf4360febbde1183447fc906aad +Subproject commit 588f36848bced9ff4f780d26d070a53443a5f230 From c29074ff943be188b8789537d9c02acb4460ea92 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Mon, 13 May 2013 18:53:23 -0400 Subject: [PATCH 2/3] Rewrite script/boostrap in Python This is the first step toward supporting Windows. --- brightray/script/bootstrap | 64 +++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/brightray/script/bootstrap b/brightray/script/bootstrap index c5ca741a412..57e28b33997 100755 --- a/brightray/script/bootstrap +++ b/brightray/script/bootstrap @@ -1,26 +1,52 @@ -#!/bin/sh -#/ Usage: bootstrap https://base.url.com/from/libchromiumcontent/script/upload -#/ Bootstrap this project. +#!/usr/bin/env python -set -e +import argparse +import errno +import os +import subprocess +import sys -usage() { - grep '^#/' <"$0"| cut -c4- -} -BASE_URL="${1}" +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor') +DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download') -if [ -z "${BASE_URL}" ]; then - usage - exit 1 -fi -cd "$(dirname "$0")/.." +def main(): + args = parse_args() + update_submodules() + download_libchromiumcontent(args.url) -git submodule sync --quiet -git submodule update --init --recursive -SOURCE_ROOT="$(pwd -P)" -DOWNLOAD_DIR="${SOURCE_ROOT}/vendor/download" -mkdir -p "${DOWNLOAD_DIR}" -vendor/libchromiumcontent/script/download -f "${BASE_URL}" "${DOWNLOAD_DIR}/libchromiumcontent" +def parse_args(): + parser = argparse.ArgumentParser(description='Bootstrap this project') + parser.add_argument('url', help='The base URL from which to download ' + 'libchromiumcontent (i.e., the URL you passed to ' + 'libchromiumcontent\'s script/upload script') + return parser.parse_args() + + +def update_submodules(): + subprocess.check_call(['git', 'submodule', 'sync', '--quiet']) + subprocess.check_call(['git', 'submodule', 'update', '--init', + '--recursive']) + + +def download_libchromiumcontent(url): + mkdir_p(DOWNLOAD_DIR) + download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script', + 'download') + subprocess.check_call([sys.executable, download, '-f', url, + os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')]) + + +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + +if __name__ == '__main__': + sys.exit(main()) From 46c887b62d6bff11634f9cf0ea9952738b3f13fd Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Mon, 13 May 2013 18:55:10 -0400 Subject: [PATCH 3/3] Rewrite script/build in Python The script is still Mac-specific, but this will make it easier to add Windows support later. --- brightray/script/build | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/brightray/script/build b/brightray/script/build index 515feb65f03..773b847aee0 100755 --- a/brightray/script/build +++ b/brightray/script/build @@ -1,8 +1,18 @@ -#!/bin/sh +#!/usr/bin/env python -set -e +import os +import subprocess -cd "$(dirname "$0")/.." -gyp --depth . brightray.gyp -xcodebuild +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) + + +def main(): + os.chdir(SOURCE_ROOT) + subprocess.check_call(['gyp', '--depth', '.', 'brightray.gyp']) + subprocess.check_call(['xcodebuild']) + + +if __name__ == '__main__': + import sys + sys.exit(main())