7
cachedir = "../pkg-cache"
8
srcdir = "../src-cache"
11
def gnome_bin_url(app, ver):
12
short_ver = "%s.%s" % (ver.split(".")[0], ver.split(".")[1])
13
return "http://ftp.gnome.org/pub/gnome/binaries/win32/%(app)s/%(short_ver)s/%(app)s_%(ver)s_win32.zip" % locals()
15
def gnome_src_url(app, ver):
16
short_ver = "%s.%s" % (ver.split(".")[0], ver.split(".")[1])
17
ver = ver.split("-")[0]
18
return"http://ftp.gnome.org/pub/gnome/sources/%(app)s/%(short_ver)s/%(app)s-%(ver)s.tar.bz2" % locals()
21
for app, ver in (("glib", "2.22.3-1"),
23
("pango", "1.26.1-1"),
25
urls[app] = {'bin': gnome_bin_url(app, ver),
26
'src': gnome_src_url(app, ver)}
28
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.8-3_win32.zip",
29
'src': "http://cairographics.org/releases/cairo-1.8.8.tar.gz"}
31
'bin': "http://www.zlib.net/zlib124-dll.zip",
32
'src': "http://www.zlib.net/zlib-1.2.4.tar.gz",
34
urls['fontconfig'] = {
35
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-1_win32.zip",
36
'src': "http://www.fontconfig.org/release/fontconfig-2.8.0.tar.gz",
39
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.3.11-1_win32.zip",
40
'src': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype-2.3.9.tar.bz2",
43
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.0.1-1_win32.zip",
44
'src': "http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz",
46
urls['gettext-runtime'] = {
47
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip",
48
'src': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-0.17.tar.gz"}
50
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.2.39-1_win32.zip",
51
'src': "http://download.sourceforge.net/libpng/libpng-1.2.39.tar.gz"
54
'bin': "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libtiff-3.8.2.zip",
55
'src': "ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.1.tar.gz"
59
def get_files(key, savedir):
60
if not os.path.exists(savedir):
63
if key not in urls[app]:
66
fn = os.path.join(savedir, url.split("/")[-1])
67
if not os.path.exists(fn):
68
print "Downloading:", fn
70
urllib.urlretrieve(url, fn)
72
print "File already here:", fn
76
f = os.path.join(cachedir, urls[app]['bin'].split("/")[-1])
79
z = zipfile.ZipFile(f)
80
for n in z.namelist():
83
dir = os.path.join("win32", os.path.dirname(n))
84
if not os.path.exists(dir):
86
outfile = open(os.path.join("win32", n), 'wb')
87
outfile.write(z.read(n))
90
if sys.argv[1] == 'bin':
91
get_files('bin', cachedir)
92
elif sys.argv[1] == 'src':
93
get_files('src', srcdir)
94
elif sys.argv[1] == 'unpack':