Merge branch 'master' of git://github.com/kivy/kivy-ios
This commit is contained in:
commit
2b39d6d593
2 changed files with 31 additions and 2 deletions
26
recipes/libpng/__init__.py
Normal file
26
recipes/libpng/__init__.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
|
||||
class PngRecipe(Recipe):
|
||||
version = '1.6.26'
|
||||
url = 'http://downloads.sourceforge.net/sourceforge/libpng/libpng-{version}.tar.gz'
|
||||
depends = ["python"]
|
||||
library = '.libs/libpng16.a'
|
||||
|
||||
def build_arch(self, arch):
|
||||
build_env = arch.get_env()
|
||||
configure = sh.Command(join(self.build_dir, "configure"))
|
||||
shprint(configure,
|
||||
"CC={}".format(build_env["CC"]),
|
||||
"LD={}".format(build_env["LD"]),
|
||||
"CFLAGS={}".format(build_env["CFLAGS"]),
|
||||
"LDFLAGS={}".format(build_env["LDFLAGS"]),
|
||||
"--prefix=/",
|
||||
"--host={}".format(arch.triple),
|
||||
"--disable-shared")
|
||||
shprint(sh.make, "clean")
|
||||
shprint(sh.make, _env=build_env)
|
||||
|
||||
recipe = PngRecipe()
|
|
@ -19,9 +19,9 @@ import shutil
|
|||
import fnmatch
|
||||
from datetime import datetime
|
||||
try:
|
||||
from urllib.request import FancyURLopener
|
||||
from urllib.request import FancyURLopener, urlcleanup
|
||||
except ImportError:
|
||||
from urllib import FancyURLopener
|
||||
from urllib import FancyURLopener, urlcleanup
|
||||
|
||||
curdir = dirname(__file__)
|
||||
sys.path.insert(0, join(curdir, "tools", "external"))
|
||||
|
@ -410,6 +410,9 @@ class Recipe(object):
|
|||
if exists(filename):
|
||||
unlink(filename)
|
||||
|
||||
# Clean up temporary files just in case before downloading.
|
||||
urlcleanup()
|
||||
|
||||
print('Downloading {0}'.format(url))
|
||||
urlretrieve(url, filename, report_hook)
|
||||
return filename
|
||||
|
|
Loading…
Reference in a new issue