Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Windows install to custom location after building from source (http://www.velocityreviews.com/forums/t674560-windows-install-to-custom-location-after-building-from-source.html)

dan.erik.petersen@gmail.com 03-06-2009 08:52 AM

Windows install to custom location after building from source
 
Hi all -

I have succeeded in building Python 2.6.1 from source under Windows XP
by running Visual C++ 2008 Express on the PCbuild/pcbuild.sln file
both from the Visual C++ application as well as from the commandline
using :

vcbuild pcbuild.sln 'Release|Win32'

This builds fine (allowing for errors in the build of modules like
sql3 and the like where I have not fetched source code), and creates
its products "in-place" in the source directory.

My question/desire is :

I would like to move this Python installation in a clean manner over
to another location outside the unpackaged source directory (e.g. from
C:\Python-2.6.1 to C:\custom_path\python). Is there already some
automatic command that can perform this? If not, which files do I move
where and what should the structure be? How do ensure all the Python
code related to the install is byte-compiled and ready for use?

I have Googled as best as I can but no luck.

Thanks,

Dan

dan.erik.petersen@gmail.com 03-06-2009 08:59 AM

Re: Windows install to custom location after building from source
 
I suppose that what I am looking for is the Windows version of "make
install" as we know it after running configure with --
prefix=custom_location --exec-prefix=custom_location flags and make on
the Linux platform.

Dan

Gabriel Genellina 03-06-2009 10:32 AM

Re: Windows install to custom location after building from source
 
En Fri, 06 Mar 2009 06:52:00 -0200, <dan.erik.petersen@gmail.com> escribiˇ:

> I have succeeded in building Python 2.6.1 from source under Windows XP
> by running Visual C++ 2008 Express on the PCbuild/pcbuild.sln file
> both from the Visual C++ application as well as from the commandline
> [...]
> I would like to move this Python installation in a clean manner over
> to another location outside the unpackaged source directory (e.g. from
> C:\Python-2.6.1 to C:\custom_path\python). Is there already some
> automatic command that can perform this? If not, which files do I move
> where and what should the structure be? How do ensure all the Python
> code related to the install is byte-compiled and ready for use?


Create an installer (pythonXXX.msi) and use it to install wherever you
want. See Tools\msi in the source tree.

If you built using VS2008 Express Edition, probably don't have cabarc.exe
- download it from http://support.microsoft.com/kb/310618/en-us and make
sure the bin directory is in your PATH before running msi.py

--
Gabriel Genellina


dan.erik.petersen@gmail.com 03-06-2009 11:50 AM

Re: Windows install to custom location after building from source
 
On Mar 6, 11:21*am, Christian Heimes <li...@cheimes.de> wrote:
> dan.erik.peter...@gmail.com schrieb:
>
> > I suppose that what I am looking for is the Windows version of "make
> > install" as we know it after running configure with --
> > prefix=custom_location --exec-prefix=custom_location flags and make on
> > the Linux platform.

>
> The Windows build system doesn't have anything related to "make
> install". You have to assemble a distribution yourself or you have to
> create a MSI package. See Tools/msi/
>
> Christian


Thanks guys -

Looks like I'll have to settle on building a distribution myself, as a
solution based on MSI isn't in the cards ... so far, so good.

Dan;

Tim Golden 03-08-2009 05:48 PM

Re: Windows install to custom location after building from source
 
Gabriel Genellina wrote:
> En Fri, 06 Mar 2009 06:52:00 -0200, <dan.erik.petersen@gmail.com> escribiˇ:
>
>> I have succeeded in building Python 2.6.1 from source under Windows XP
>> by running Visual C++ 2008 Express on the PCbuild/pcbuild.sln file
>> both from the Visual C++ application as well as from the commandline
>> [...]
>> I would like to move this Python installation in a clean manner over
>> to another location outside the unpackaged source directory (e.g. from
>> C:\Python-2.6.1 to C:\custom_path\python). Is there already some
>> automatic command that can perform this? If not, which files do I move
>> where and what should the structure be? How do ensure all the Python
>> code related to the install is byte-compiled and ready for use?

>
> Create an installer (pythonXXX.msi) and use it to install wherever you
> want. See Tools\msi in the source tree.
>
> If you built using VS2008 Express Edition, probably don't have
> cabarc.exe - download it from
> http://support.microsoft.com/kb/310618/en-us and make sure the bin
> directory is in your PATH before running msi.py
>


A small caveat here: I've just done this myself and I had to
patch one or two things very slightly. I have the htmlhelp
libraries in a non-standard place and the make.bat helper
file in the doc\ directory hardcodes its location. The
patch from this tracker issue:

http://bugs.python.org/issue2421

solves that (with the help of an env var).

The other thing is that the instructions in the pcbuild/readme.txt
and the corresponding code in Tools\buildbot\external-common.bat
export the external tcl/tk libraries under the name tcl-8* and tk-8*
whereas the msi.py code is expecting to find them under tcl8*
and tk8*. In addition, msi.py is looking for a tix-* directory
which doesn't seem to come from anywhere.

I don't know if that constitutes a bug in msi.py or one in
the pcbuild / external-common.bat or neither of the two.
Happy to produce a patch if needed.

In addition, the CVS version of pywin32 which I built in
order to run the msi.py script has a small bug in genpy
which prevents it from generating COM support in the way
in which msi.py does it. I've reported it as issue 2672514
on the pywin32 tracker:

http://sourceforge.net/tracker/index...18&atid=551954

Anyhow, at the end I have a working Python 2.7a0 running
under Windows.

TJG

Martin v. L÷wis 03-08-2009 07:51 PM

Re: Windows install to custom location after building from source
 
> In addition, the CVS version of pywin32 which I built in
> order to run the msi.py script has a small bug in genpy
> which prevents it from generating COM support in the way
> in which msi.py does it.


I'm using Python 2.4 to run msi.py; that has always worked
fine for me.

Regards,
Martin

P.S. Don't forget to run merge.py after msi.py

Martin v. L÷wis 03-08-2009 07:51 PM

Re: Windows install to custom location after building from source
 
> Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
> of the time machine, as it is expected to be 3 months out.


The current trunk calls itself 2.7a0. I think you might be referring
to 3.0a1.

Regards,
Martin

Tim Golden 03-08-2009 07:58 PM

Re: Windows install to custom location after building from source
 
Martin v. L÷wis wrote:
>> In addition, the CVS version of pywin32 which I built in
>> order to run the msi.py script has a small bug in genpy
>> which prevents it from generating COM support in the way
>> in which msi.py does it.

>
> I'm using Python 2.4 to run msi.py; that has always worked
> fine for me.


Interesting. Didn't even think of that. Well, it works ok
with my micro-patches anyway.
>
> Regards,
> Martin
>
> P.S. Don't forget to run merge.py after msi.py


What does the merge do? I can't find mention of it
in the docs.

Thanks for the input, by the way.

TJG

Tim Golden 03-08-2009 07:58 PM

Re: Windows install to custom location after building from source
 
Scott David Daniels wrote:
> Tim Golden wrote:
>> ... Anyhow, at the end I have a working Python 2.7a0 running
>> under Windows.

>
> Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
> of the time machine, as it is expected to be 3 months out.


No; 2.7a0 is the version number of the svn HEAD.

> If you do get an installer built, even having a semi-official copy
> around for those of us not on the MS compiler upgrade train to
> do a little alpha (and/or beta) testing as well.


There used to be nightly .msi builds, don't remember where;
if Martin (or someone) doesn't chip in with something, I'll
happily provide an unofficial build. In fact, I might do it
anyway if I can get my act together.

TJG

Martin v. L÷wis 03-08-2009 08:08 PM

Re: Windows install to custom location after building from source
 
> What does the merge do? I can't find mention of it
> in the docs.


It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to integrate it originally as a step
after creating the msi. Unfortunately, the merge object refused
to open the database, claiming that the file is in use (even
though I had closed it). Hence I need to processes. If you
can figure out how to combine them into one, again, that
would be much appreciated.

If you don't merge the CRT, the resulting Python installation
will fail on systems were
a) VS 2008 is not installed (nor has the stand-alone CRT installer
been run, nor has anything else been installed that comes
with the CRT), and
b) Python is installed "for all users" (else a private copy of
msvcr90.dll gets installed)

Regards,
Martin


All times are GMT. The time now is 05:38 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.