예제 #1
0
def downloadAll(targets):
    version = "6c4af62b8c9853bfca1166d672a16abdbf9f0d26"
    url = "https://github.com/teeworlds/teeworlds-libs/archive/{}.zip".format(
        version)

    # download and unzip
    src_package_libs = twlib.fetch_file(url)
    if not src_package_libs:
        print("couldn't download libs")
        sys.exit(-1)
    libs_dir = unzip(src_package_libs, ".")
    if not libs_dir:
        print("couldn't unzip libs")
        sys.exit(-1)
    libs_dir = "teeworlds-libs-{}".format(version)

    if "sdl" in targets:
        copy_tree(libs_dir + "/sdl/", "other/sdl/")
    if "freetype" in targets:
        copy_tree(libs_dir + "/freetype/", "other/freetype/")

    # cleanup
    try:
        shutil.rmtree(libs_dir)
        os.remove(src_package_libs)
    except:
        pass
예제 #2
0
def downloadAll(arch, conf, targets):
    url = "https://github.com/teeworlds/teeworlds-libs/archive/master.zip"
    if arch == "x86_64":
        _arch = "64"
    else:
        _arch = "32"
    builddir = "build/" + arch + "/" + conf + "/"

    # download and unzip
    src_package_libs = twlib.fetch_file(url)
    if not src_package_libs:
        print("couldn't download libs")
        sys.exit(-1)
    libs_dir = unzip(src_package_libs, ".")
    if not libs_dir:
        print("couldn't unzip libs")
        sys.exit(-1)
    libs_dir = "teeworlds-libs-master"

    if "sdl" in targets:
        copy_tree(libs_dir + "/sdl/", "other/sdl/")
    if "freetype" in targets:
        copy_tree(libs_dir + "/freetype/", "other/freetype/")

    # cleanup
    try:
        shutil.rmtree(libs_dir)
        os.remove(src_package_libs)
    except:
        pass
예제 #3
0
def downloadAll(arch, conf, targets):
	url = "https://github.com/teeworlds/teeworlds-libs/archive/master.zip"
	if arch == "x86_64":
		_arch = "x64"
	else:
		_arch = arch
	builddir = "build/" + arch + "/" + conf + "/"
	
	# download and unzip
	src_package_libs = twlib.fetch_file(url)
	if not src_package_libs:
		print("couldn't download libs")
		sys.exit(-1)
	libs_dir = unzip(src_package_libs, ".")
	if not libs_dir:
		print("couldn't unzip libs")
		sys.exit(-1)
	libs_dir = "teeworlds-libs-master"

	if "SDL2.dll" in targets:
		shutil.copy(libs_dir + "/sdl/windows/lib/" + _arch + "/SDL2.dll", builddir)
	if "freetype.dll" in targets:
		shutil.copy(libs_dir + "/freetype/windows/lib/" + _arch + "/freetype.dll", builddir)
	if "sdl" in targets:
		copy_tree(libs_dir + "/sdl/windows/", "other/sdl/")
	if "freetype" in targets:
		copy_tree(libs_dir + "/freetype/windows/", "other/freetype/")

	# cleanup
	try:
		shutil.rmtree(libs_dir)
		os.remove(src_package_libs)
	except: pass
예제 #4
0
파일: download.py 프로젝트: BotoX/teeworlds
def downloadAll(targets):
	version = "4bf6dbc8c9f9b2fa89b2b5be1928f5e85bca01e6"
	url = "https://github.com/teeworlds/teeworlds-libs/archive/{}.zip".format(version)

	# download and unzip
	src_package_libs = twlib.fetch_file(url)
	if not src_package_libs:
		print("couldn't download libs")
		sys.exit(-1)
	libs_dir = unzip(src_package_libs, ".")
	if not libs_dir:
		print("couldn't unzip libs")
		sys.exit(-1)
	libs_dir = "teeworlds-libs-{}".format(version)

	if "sdl" in targets:
		copy_tree(libs_dir + "/sdl/", "other/sdl/")
	if "freetype" in targets:
		copy_tree(libs_dir + "/freetype/", "other/freetype/")

	# cleanup
	try:
		shutil.rmtree(libs_dir)
		os.remove(src_package_libs)
	except: pass
예제 #5
0
def downloadAll(targets):
	version = "9e78876d7a7ebb66807b2f09207d4211d2265de8"
	url = "https://github.com/teeworlds/teeworlds-libs/archive/{}.zip".format(version)

	# download and unzip
	src_package_libs = twlib.fetch_file(url)
	if not src_package_libs:
		print("couldn't download libs")
		sys.exit(-1)
	libs_dir = unzip(src_package_libs, ".")
	if not libs_dir:
		print("couldn't unzip libs")
		sys.exit(-1)
	libs_dir = "teeworlds-libs-{}".format(version)

	if "sdl" in targets:
		copy_tree(libs_dir + "/sdl/", "other/sdl/")
	if "freetype" in targets:
		copy_tree(libs_dir + "/freetype/", "other/freetype/")

	# cleanup
	try:
		shutil.rmtree(libs_dir)
		os.remove(src_package_libs)
	except: pass
예제 #6
0
def downloadAll():
    version = "4bf6dbc8c9f9b2fa89b2b5be1928f5e85bca01e6"
    url = "https://github.com/teeworlds/teeworlds-libs/archive/{}.zip".format(
        version)

    # download and unzip
    src_package_libs = twlib.fetch_file(url)
    if not src_package_libs:
        print("couldn't download libs")
        sys.exit(-1)
    libs_dir = unzip(src_package_libs, ".")
    if not libs_dir:
        print("couldn't unzip libs")
        sys.exit(-1)
    libs_dir = "teeworlds-libs-{}".format(version)

    # cleanup
    try:
        shutil.rmtree(libs_dir)
        os.remove(src_package_libs)
    except:
        pass
예제 #7
0
# clean
if flag_clean:
	clean()

# make dir
try: os.mkdir(work_dir)
except: pass

# change dir
os.chdir(work_dir)

# download
if flag_download:
	print("*** downloading bam source package ***")
	src_package_bam = twlib.fetch_file(options.url_bam)
	if src_package_bam:
		if version_bam == 'trunk':
			version = re.search(r"-[^-]*?([^-]*?)\.[^.]*$", src_package_bam)
			if version:
				version_bam = version.group(1)
	else:
		bail("couldn't find bam source package and couldn't download it")

	print("*** downloading %s source package ***" % name)
	src_package_teeworlds = twlib.fetch_file(options.url_teeworlds)
	if src_package_teeworlds:
		if version_teeworlds == 'trunk':
			version = re.search(r"-[^-]*?([^-]*?)\.[^.]*$", src_package_teeworlds)
			if version:
				version_teeworlds = version.group(1)
예제 #8
0
	
package = "%s-%s-%s" %(name, version, platform)
package_dir = package

source_package_dir = "build/"
if platform == 'win32' or platform == 'linux_x86':
	source_package_dir += "x86/release/"
else:
	source_package_dir += "x86_64/release/"

print("cleaning target")
shutil.rmtree(package_dir, True)
os.mkdir(package_dir)

print("download and extract languages")
src_package_languages = twlib.fetch_file(options.url_languages)
if not src_package_languages:
	print("couldn't download languages")
	sys.exit(-1)
languages_dir = unzip(src_package_languages, ".")
if not languages_dir:
	print("couldn't unzip languages")
	sys.exit(-1)

print("download and extract maps")
src_package_maps = twlib.fetch_file(options.url_maps)
if not src_package_maps:
	print("couldn't download maps")
	sys.exit(-1)
maps_dir = unzip(src_package_maps, ".")
if not maps_dir:
예제 #9
0
        shutil.rmtree(maps_dir)
        os.remove(src_package_languages)
        os.remove(src_package_maps)
    except:
        pass


package = "%s-%s-%s" % (name, version, platform)
package_dir = package

print("cleaning target")
shutil.rmtree(package_dir, True)
os.mkdir(package_dir)

print("download and extract languages")
src_package_languages = twlib.fetch_file(options.url_languages)
if not src_package_languages:
    print("couldn't download languages")
    sys.exit(-1)
languages_dir = unzip(src_package_languages, ".")
if not languages_dir:
    print("couldn't unzip languages")
    sys.exit(-1)

print("download and extract maps")
src_package_maps = twlib.fetch_file(options.url_maps)
if not src_package_maps:
    print("couldn't download maps")
    sys.exit(-1)
maps_dir = unzip(src_package_maps, ".")
if not maps_dir: