Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'elif': 0.05; 'distutils': 0.07; 'none:': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:\\ 40': 0.09; 'def': 0.12; 'amd64': 0.16; 'msvc_version': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skipped': 0.16; 'subject:distutils': 0.16; 'subject:making': 0.16; 'subject:patch': 0.16; 'suffix:': 0.16; 'fix': 0.17; 'bit': 0.19; 'work,': 0.20; 'seems': 0.21; 'command': 0.22; 'aug': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'tue': 0.24; '---': 0.24; 'header:X-Complaints-To:1': 0.27; 'correct': 0.29; '----': 0.29; 'patch': 0.29; 'dec': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'initialized': 0.31; 'supposed': 0.32; 'skip:s 30': 0.35; 'but': 0.35; 'next': 0.36; 'skip:o 20': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:* 10': 0.61; 'name': 0.63; '****': 0.68; 'received:109': 0.72; '***': 0.95; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robin Becker Subject: patch for making distutils cross compile on win32 Date: Tue, 17 Dec 2013 13:51:20 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 109.174.168.73 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 74 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387288290 news.xs4all.nl 2870 [2001:888:2000:d::a6]:39026 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62187 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