From 886983ad09edd97504d714017bd02ed92ce0f401 Mon Sep 17 00:00:00 2001 From: pin Date: Tue, 25 May 2010 10:44:48 +0000 Subject: [PATCH] =?utf8?q?hack=20pour=20que=20la=20lib=20sdl=20soit=20bien?= =?utf8?q?=20install=C3=A9e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@188 fe552daf-6dbe-4428-90eb-1537e0879342 --- setup_win_exe.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup_win_exe.py b/setup_win_exe.py index c903cd9..0f29257 100755 --- a/setup_win_exe.py +++ b/setup_win_exe.py @@ -18,6 +18,15 @@ try: except ImportError, message: raise SystemExit, "Unable to load module. %s" % message + +origIsSystemDLL = py2exe.build_exe.isSystemDLL +def isSystemDLL(pathname): + if os.path.basename(pathname).lower() in ["sdl_ttf.dll"]: + return 0 + return origIsSystemDLL(pathname) +py2exe.build_exe.isSystemDLL = isSystemDLL + + class pygame2exe(py2exe.build_exe.py2exe): #This hack make sure that pygame default font is copied: no need to modify code for specifying default font def copy_extensions(self, extensions): #Get pygame default font @@ -110,6 +119,10 @@ class BuildExe: if os.path.isdir(self.dist_dir): #Erase previous destination dir shutil.rmtree(self.dist_dir) + if os.path.isdir('build'): #Clean up build dir + shutil.rmtree('build') + + #Use the default pygame icon, if none given if self.icon_file == None: path = os.path.split(pygame.__file__)[0] @@ -123,6 +136,7 @@ class BuildExe: else: extra_datas.append(('.', [data])) + setup( cmdclass = {'py2exe': pygame2exe}, version = self.project_version, -- 2.20.1