Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62187 > unrolled thread

patch for making distutils cross compile on win32

Started byRobin Becker <robin@reportlab.com>
First post2013-12-17 13:51 +0000
Last post2013-12-17 13:51 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  patch for making distutils cross compile on win32 Robin Becker <robin@reportlab.com> - 2013-12-17 13:51 +0000

#62187 — patch for making distutils cross compile on win32

FromRobin Becker <robin@reportlab.com>
Date2013-12-17 13:51 +0000
Subjectpatch for making distutils cross compile on win32
Message-ID<mailman.4282.1387288290.18130.python-list@python.org>
I have struggled to get Python-3.3.3 distutils to cross compile win-amd64 on 
win32. For the specific command (bdist_wininst) I am using the patch below seems 
to fix things so I can build amd64 binaries on win32. The code seems a bit 
schizophrenic about whether this is supposed to work, but without the patch it 
certainly doesn't.

*** \python33\lib\distutils\command\bdist_wininst.py    Wed Aug 01 10:05:14 2012
--- distutils\command\bdist_wininst.py  Tue Dec 17 13:14:02 2013
***************
*** 72,88 ****


       def finalize_options(self):
-         self.set_undefined_options('bdist', ('skip_build', 'skip_build'))
-
           if self.bdist_dir is None:
!             if self.skip_build and self.plat_name:
                   # If build is skipped and plat_name is overridden, bdist will
                   # not see the correct 'plat_name' - so set that up manually.
!                 bdist = self.distribution.get_command_obj('bdist')
!                 bdist.plat_name = self.plat_name
                   # next the command will be initialized using that name
               bdist_base = self.get_finalized_command('bdist').bdist_base
               self.bdist_dir = os.path.join(bdist_base, 'wininst')

           if not self.target_version:
               self.target_version = ""
--- 72,89 ----


       def finalize_options(self):
           if self.bdist_dir is None:
!             if self.plat_name:
                   # If build is skipped and plat_name is overridden, bdist will
                   # not see the correct 'plat_name' - so set that up manually.
!                 self.distribution.get_command_obj('build').plat_name = 
self.plat_name
!                 self.distribution.get_command_obj('build_py').plat_name = 
self.plat_name
!                 self.distribution.get_command_obj('build_ext').plat_name = 
self.plat_name
!                 self.distribution.get_command_obj('bdist').plat_name = 
self.plat_name
                   # next the command will be initialized using that name
               bdist_base = self.get_finalized_command('bdist').bdist_base
               self.bdist_dir = os.path.join(bdist_base, 'wininst')
+         self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

           if not self.target_version:
               self.target_version = ""
*** \python33\lib\distutils\command\build_ext.py        Sun Oct 27 17:02:50 2013
--- distutils\command\build_ext.py      Tue Dec 17 12:48:51 2013
***************
*** 218,224 ****
                   new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
                   if suffix:
                       new_lib = os.path.join(new_lib, suffix)
!                 self.library_dirs.append(new_lib)

               elif MSVC_VERSION == 8:
                   self.library_dirs.append(os.path.join(sys.exec_prefix,
--- 218,226 ----
                   new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
                   if suffix:
                       new_lib = os.path.join(new_lib, suffix)
!                     self.library_dirs.insert(0,new_lib)
!                 else:
!                     self.library_dirs.append(new_lib)

               elif MSVC_VERSION == 8:
                   self.library_dirs.append(os.path.join(sys.exec_prefix,
-- 
Robin Becker

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web