Skip to content

Commit

Permalink
Changed py2exe build process to start from dist rather than remaking …
Browse files Browse the repository at this point in the history
…the dist on windows

* moved helper files into py2exe directory so they get included in source dist
* added checks to make sure not attempting to build py2exe in a copy of the code that's under version control
* note: the process is still started from build-archives.sh, it's just reworked

svn-revision: r2390
  • Loading branch information
robmcmullen committed Nov 12, 2009
1 parent 74b5dba commit f84acf8
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 25 deletions.
6 changes: 3 additions & 3 deletions build-archives.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [ -f archive/$PEPPYWIN ]
then then
echo FOUND $PEPPYWIN echo FOUND $PEPPYWIN
else else
rsync -av -e 'ssh -p 2222' --exclude="archive" --exclude="api" --exclude="dist" --exclude="peppy-*" ~/src/peppy rob@localhost:/home/Rob/ scp -P 2222 archive/$PEPPYSRC py2exe/build-over-ssh.sh localhost:
ssh -p 2222 localhost bash peppy/build-peppy-for-windows-over-ssh.sh ssh -p 2222 localhost bash build-over-ssh.sh peppy-$VERSION
scp -P 2222 localhost:peppy/peppy-$VERSION/py2exe/$PEPPYWIN archive scp -P 2222 localhost:peppy-$VERSION/py2exe/$PEPPYWIN archive
fi fi
18 changes: 0 additions & 18 deletions build-peppy-for-windows-over-ssh.sh

This file was deleted.

26 changes: 26 additions & 0 deletions py2exe/build-over-ssh.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Designed to be called from an ssh session. An argument must be passed to the
# script indicating the root of the compressed archive.


ROOT=$1

if [ ! -f $ROOT.tar.* ]
then
echo "Source archive for $ROOT doesn't exist. Not building."
exit -1
fi

if rm -rf $ROOT
then
:
else
echo "Failed removing $ROOT. Someone using that directory?"
exit -1
fi

bzcat $ROOT.* | tar xf -
cd $ROOT
bash py2exe/prepare-distdir.sh
bash py2exe/build-py2exe.sh
9 changes: 9 additions & 0 deletions py2exe/build-py2exe.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
python setup.py py2exe

# The following DLLs are needed for Vista support
cp c:/python25/lib/site-packages/wx-2.8-msw-unicode/wx/MSVCP71.dll dist
cp c:/python25/lib/site-packages/wx-2.8-msw-unicode/wx/gdiplus.dll dist

/program-files/NSIS/makensis py2exe/win-installer.nsi
chmod 755 py2exe/*.exe
File renamed without changes.
57 changes: 57 additions & 0 deletions py2exe/prepare-distdir.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
#
# Modify the distdir in preparation for a py2exe

# First, verify that we are being called in the root directory, not the py2exe
# directory.

if [ ! -f setup.py ]
then
cd ..
if [ ! -f setup.py ]
then
echo "Must be called from inside root peppy directory"
exit 1
fi
fi
echo "Found working directory $PWD"

# Don't run this on the version control directory; only run this on a directory
# that has a version number -- i.e. one that has been created by 'make distdir'

if [ -d .git -o -d .svn -o -d .peppy-project -o -d i18n.in ]
then
echo
echo "ERROR! Don't call this from a version that you are editing!"
echo "This is designed to modify an unzipped source distribution in place"
echo "to create the directory structure needed to build a one-off py2exe"
echo "installer."
exit 2
fi

mv peppy/hsi/hsi_plugin.py peppy/plugins
mv peppy/hsi/hsi_plugin.peppy-plugin peppy/plugins
mv peppy/project/project_plugin.py peppy/plugins
mv peppy/project/project_plugin.peppy-plugin peppy/plugins

# Create the eggs directory that will be used to store plugins
mkdir eggs
touch eggs/__init__.py

# Unzip the platform independent eggs
ls -1 peppy/plugins/eggs/*py2.5.egg | while read EGG; do
unzip -o $EGG -d eggs
done

# add the platform independent eggs to the py2exe include list
./py2exe/prepare-plugin-list.py -i . -d peppy/major_modes -d peppy/plugins -e eggs

# Handle eggs with compiled objects. They don't seem to do well when placed in
# the eggs directory -- they need to be in the top level directory
ls -1 peppy/plugins/eggs/*win32.egg | while read EGG; do
unzip -o $EGG
cat EGG-INFO/top_level.txt | while read TOPLEVEL; do
echo "import $TOPLEVEL" >> peppy/py2exe_plugins.py
done
done
rm peppy/plugins/eggs/*.egg
File renamed without changes.
2 changes: 1 addition & 1 deletion py2exe/win-executable.nsi
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetCompressor lzma
Name 'Peppy' Name 'Peppy'
OutFile ${exe} OutFile ${exe}
SilentInstall silent SilentInstall silent
Icon '..\..\graphics\peppy48.ico' Icon 'peppy48.ico'
RequestExecutionLevel user RequestExecutionLevel user


Section Section
Expand Down
4 changes: 2 additions & 2 deletions py2exe/win-installer.nsi.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ SetCompressor lzma


; MUI Settings ; MUI Settings
!define MUI_ABORTWARNING !define MUI_ABORTWARNING
!define MUI_ICON "..\..\graphics\peppy48.ico" !define MUI_ICON "peppy48.ico"
!define MUI_UNICON "..\..\graphics\peppy48.ico" !define MUI_UNICON "peppy48.ico"


; Welcome page ; Welcome page
!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_WELCOME
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def findHelpBooks():
platform_kwargs['windows'] = [ platform_kwargs['windows'] = [
{"script": "py2exe/peppy.py", {"script": "py2exe/peppy.py",
"other_resources": [(24,1,manifest)], "other_resources": [(24,1,manifest)],
"icon_resources": [(2, "../graphics/peppy48.ico")], "icon_resources": [(2, "py2exe/peppy48.ico")],
} }
] ]
platform_kwargs['zip_safe'] = False platform_kwargs['zip_safe'] = False
Expand Down

0 comments on commit f84acf8

Please sign in to comment.