2012-04-18 12:15:52 +00:00
|
|
|
build_version = "1.4.0-dev"
|
2010-10-29 09:11:40 +00:00
|
|
|
python_path = "C:\\Python26\\"
|
2010-03-26 20:14:51 +00:00
|
|
|
|
2012-04-18 12:15:52 +00:00
|
|
|
import os, glob
|
2010-10-29 09:11:40 +00:00
|
|
|
import shutil
|
2012-04-18 12:15:52 +00:00
|
|
|
shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge.py")
|
|
|
|
shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge-debug.py")
|
2010-10-29 09:11:40 +00:00
|
|
|
shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged.py")
|
|
|
|
shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web.py")
|
2012-04-18 12:15:52 +00:00
|
|
|
shutil.copy(python_path + "Scripts\deluge-gtk-script.pyw", python_path + "Scripts\deluge-gtk.py")
|
2010-10-29 09:11:40 +00:00
|
|
|
shutil.copy(python_path + "Scripts\deluge-console-script.py", python_path + "Scripts\deluge-console.py")
|
|
|
|
|
2012-04-18 12:15:52 +00:00
|
|
|
includes=("libtorrent", "gzip", "zipfile", "re", "socket", "struct", "cairo", "pangocairo", "atk", "pango", "twisted.internet.utils", "gio", "gtk.glade", "email.mime")
|
|
|
|
excludes=("numpy", "OpenGL", "psyco", "win32ui")
|
|
|
|
|
|
|
|
dst = "..\\build-win32\\deluge-bbfreeze-" + build_version + "\\"
|
2010-10-29 09:11:40 +00:00
|
|
|
|
|
|
|
from bbfreeze import Freezer
|
2012-04-18 12:15:52 +00:00
|
|
|
f = Freezer(dst, includes=includes, excludes=excludes)
|
|
|
|
f.include_py = False
|
|
|
|
f.addScript(python_path + "Scripts\deluge.py", gui_only=True)
|
|
|
|
f.addScript(python_path + "Scripts\deluge-debug.py", gui_only=False)
|
2010-10-29 09:11:40 +00:00
|
|
|
f.addScript(python_path + "Scripts\deluged.py", gui_only=False)
|
|
|
|
f.addScript(python_path + "Scripts\deluge-web.py", gui_only=False)
|
2012-04-18 12:15:52 +00:00
|
|
|
f.addScript(python_path + "Scripts\deluge-gtk.py", gui_only=True)
|
2010-10-29 09:11:40 +00:00
|
|
|
f.addScript(python_path + "Scripts\deluge-console.py", gui_only=False)
|
2010-03-26 20:14:51 +00:00
|
|
|
f() # starts the freezing process
|
2010-10-29 09:11:40 +00:00
|
|
|
|
|
|
|
# add icons to the exe files
|
|
|
|
import icon
|
|
|
|
|
|
|
|
icon_path = os.path.join(os.path.dirname(__file__), "deluge.ico")
|
|
|
|
icon.CopyIcons(dst+"deluge.exe", icon_path)
|
|
|
|
icon.CopyIcons(dst+"deluge-debug.exe", icon_path)
|
2012-04-18 12:15:52 +00:00
|
|
|
icon.CopyIcons(dst+"deluged.exe", icon_path)
|
|
|
|
icon.CopyIcons(dst+"deluge-web.exe", icon_path)
|
|
|
|
icon.CopyIcons(dst+"deluge-gtk.exe", icon_path)
|
|
|
|
icon.CopyIcons(dst+"deluge-console.exe", icon_path)
|
2010-10-29 09:11:40 +00:00
|
|
|
|
|
|
|
# exclude files which are already included in GTK or Windows
|
2012-04-18 12:15:52 +00:00
|
|
|
excludeFiles = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll")
|
2010-10-29 09:11:40 +00:00
|
|
|
for file in excludeFiles:
|
|
|
|
for filename in glob.glob(dst + file):
|
|
|
|
print "removing file:", filename
|
|
|
|
os.remove(filename)
|