User:Crb11/GuigutsExecutableBuildInstructions

From DPWiki

How to (hopefully) build a guiguts executable, on Windows and Mac OSX.

On Windows this has been a bit flaky, so need to try and get something reproduceable.


Requirements

  • A working copy of Guiguts.
  • On Windows, I think you need ActivePerl 5.8.8 build 822.

1. Take a copy of your entire guiguts directory

I'll call this folder "guiguts2"

2. Install PAR from cpan

For Windows (Note: 'cpan' here and below means "type this but without the quotes")

'cpan' then 'install PAR' and 'install PAR::Packer'.

For Mac OSX: replace 'cpan' by 'sudo cpan'.

It may give messages about unresolved dependencies and ask for them to be added to the list: select yes each time.

The second one may fail, complaining about an out-of-date version of "Win32". If so, try the next step as an alternative: (It requires you to have the same C compiler installed on your machine as was used to compile Perl originally. For Windows/ActiveState this is the Visual Studio compiler. I don't know what it is on Mac)

3. Install PAR::Packer (alternative method)

Download from here: http://par.perl.org/wiki/Main_Page

Unpack somewhere, go into that directory and type:

(Windows)

'perl Makefile.PL' 'nmake' 'nmake install'

(Mac OSX)

'perl Makefile.PL' 'sudo make' 'sudo make install'

4. Find the pp program

From a command prompt, type 'pp -version'. Hopefully it will print up some version information. If it doesn't find it, one option is that it may have installed it somewhere not on your path (one of my PCs did this, one not). If so, find where perl.exe is on your system and copy it into the same place.

5. Fix guiguts so it finds the Tk toolbar icons file

(The Tk::Toolbar module that Guiguts uses is not configured correctly to work with PAR::Packer, so we need to hack a bit.)

  • Find a file called "tkIcons" in your Perl installation. ActiveState will put it at c:\perl\site\lib\Tk\ToolBar\tkIcons by default.
  • Copy it into a subdirectory of your guiguts2 folder, so it is guiguts2\Tk\Toolbar\tkIcons. (Copying the entire Tk directory is safe.)
  • Edit your guiguts.pl and add the line 'push @INC, ".";' immediately after 'use Tk;'

6. Build an executable

Type 'pp -o guiguts.exe -a Tk\Toolbar\tkIcons guiguts.pl'

7. Test executable

Run guiguts.exe, and you should have a working guiguts!

8. Test zip

Zip up the entire directory (you don't need guiguts.pl or winguts.exe, but they're harmless), copy it somewhere else, unpack and run guiguts.exe and see if it works.