Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

113 lines (95 sloc) 4.104 kb
#!/usr/bin/env python
# This file has been modified from its orginal sources.
#
# Copyright (c) 2012 Software in the Public Interest Inc (SPI)
# Copyright (c) 2012 David Pratt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright (c) 2008-2012 Appcelerator Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import effess
import os
import sys
import inspect
import urllib
import tarfile
import os.path as path
import distutils.dir_util as dirutil
from progressbar import ProgressBar
Import('build')
revisions = {
"linux-x86": 1,
"linux-x86_64": 1,
"osx-x86": 1,
"win32-x86": 1
}
arch_name = '%s-%s-v%s' % (build.os, build.arch, revisions[build.os+'-'+build.arch])
if build.is_win32():
arch_name = '%s-%s-v%s' % ("win", build.arch, revisions[build.os+'-'+build.arch])
thirdparty_name = 'thirdparty-%s' % (arch_name)
url = 'http://tidesdk.multipart.net/thirdparty/tide-%s.tgz' % (arch_name)
build.third_party = path.join(build.cwd(), thirdparty_name)
rtdir = build.runtime_build_dir
def exists():
return path.isdir(build.third_party)
def fetch():
print "You don't seem to have the appropriate thirdparty files. I'll fetch them."
print "Downloading %s" % url
pbar = ProgressBar().start()
try:
def progress_callback(count, block_size, total_size):
if (total_size < 0):
raise Exception("Could not fetch archive! Does it exist on the server?")
percent = int(count * block_size * 100/total_size)
pbar.update(percent)
fname, msg = urllib.urlretrieve(url, reporthook=progress_callback)
print "Fetched it (%s). I'm going to unpack it now..." % (fname)
os.makedirs(build.third_party)
tfile = tarfile.open(fname, mode="r:gz")
tfile.extractall(path=build.third_party)
finally:
urllib.urlcleanup()
pbar.finish()
if not exists(): fetch()
if build.is_linux():
effess.copy_tree(path.join(build.third_party, 'webkit', 'lib'), rtdir)
effess.copy_tree(path.join(build.third_party, 'poco', 'lib'), rtdir)
elif build.is_win32():
effess.copy_tree(path.join(build.third_party, 'poco', 'bin'), rtdir)
effess.copy_tree(path.join(build.third_party, 'webkit', 'bin'), rtdir)
effess.copy_tree(path.join(build.third_party, 'libproxy', 'bin'), rtdir)
effess.copy_tree(path.join(build.third_party, 'sdk'), path.join(build.dir, 'sdk'))
elif build.is_osx():
excludes = ['.h', '.defs', 'JavaScriptGlue.framework']
if build.tidelite:
excludes.extend(['WebKit.framework', 'WebCore.framework', 'JavaScriptCore.framework'])
targets = []
for framework in Glob(path.join(build.third_party, '*/*.framework')):
t = build.utils.CopyToDir(framework, rtdir, exclude=excludes)
targets.append(t)
# PHP dependencies don't aren't distributed with the runtime, only Poco's.
# for libdir in Glob(path.join(build.third_party, '*/lib')):
libdir = path.join(build.third_party, "poco", "lib");
targets.append(build.utils.CopyTree(libdir, rtdir, exclude=excludes))
build.mark_build_target(targets)
Jump to Line
Something went wrong with that request. Please try again.