Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] SWISH-E Perl Support on Windows

From: at <Kruno>
Date: Fri, 01 Mar 2013 15:05:24 +0100
Am 01.03.2013 10:25, schrieb Thomas den Braber:
> Kruno
> I have a version for Windows build for ActiveState Perl 5.14 32bit.
> It is not a ppm but needs to be manually installed.
> If you are interested I can put it on a server somewhere.

Sure, I'd be interested.

Nonetheless I am also interested in figuring out how to compile it 
myself. I have now completed the cross-compiling instructions from an 
Ubuntu machine for Swish-Versions 2.4.3 to 2.4.7, against ActiveState 
Perl 5.8, as distributed in the swish-build archive. I will attempt to 
use other ActiveState Perl versions some time next week.

I only managed to successfully compile 2.4.5 and 2.4.7, i.e. I got a 
swishsetup.exe - in both cases I haven't yet tried to install, though.

In case it is of interest to the list, I will add some comments with my 
experiences to the build instructions.

Feel free to point out any better solutions you have.

> Cross-compiling for Windows on Debian or Ubuntu
> Required Tools
> Install a native Windows cross-compiler such as Mingw32 in addition to your normal build
> tools:
> sudo apt-get install mingw32 mingw32-binutils mingw32-runtime subversion make

Just some tidbits: mingw32 should automatically get the other mingw32-* 
packages here. subversion is only needed if you want to compile the 
trunk version from svn.

> If you want to generate the pretty wizard-like installation program then install tofrodos
> and NSIS (From Debian main or Ubuntu universe):
> sudo apt-get install tofrodos nsis
> If you intend to compile the Perl SWISH::API module then install XVFB (X Virtual Framebuffer):
> sudo apt-get install xvfb

I am not sure if this is really needed, my fix for the 2.4.5 compile 
below is to *not* use xvfb-run.

> Dependencies
> Build libxml2, pcre, and zlib libraries. You will also need catdoc and xpdf if you plan to
> build the NSIS installation wizard. You may use the prebuilt dependencies (libraries and
> filters) for Swish-e.
> wget

This was a little unclear, since I was not sure if I have to build those 
components myself. The swish-build provides those directories, so I 
think the following steps will compile these components.

> Extract the build environment
> tar xzf swish-build-2008-03-09.tar.gz
> Change to the work directory
> cd swish-build
> Configuring Perl (optional)
> I have included a copy of ActivePerl 5.8 in the swish-build archive. You probably will
> need to run reloc_perl.bat. Make sure wine is installed and works properly. Run the
> following commands:
>   pushd perl/bin
>   wine cmd
> Now you will find yourself in Wine's NT command interpreter with the working directory set
> to perl/bin. Look at everything before bin. That's what you'll want to set for your
> topath. Here is how I would run that command (leave off the .bat file extension):
>   reloc_perl -a -i Z:\home\kg9ae\Projects\SWISHE\swish-build\perl
> Once that is complete and, hopefully, completes without any errors close the NT command shell:
>   exit
> Now switch back to your swish-build work directory:
>   popd

I had a number of FIXME warnings produced by wine here, but they should 
be harmless. Wine debugging can be disabled by starting wine with 
WINEDEBUG=-all set, there should be no need for recompiling wine (as 
suggested in Makefile.mingw below).

> Building Swish-e for Windows
> Grab the latest Swish-e revision from SVN
> svn co swish-e
> Run the script to generate the Swish-e executable and libswish-e libraries
> pushd swish-e
> sh ./src/win32/

I did this on Ubuntu 12.04.1:

This failed for me initially, so I switched to the 2.4.x sources.

Version 2.4.3 didn't compile at all, compiler complains

... /src/http.c:418: undefined reference to `_sleep'

Might be a known problem + fix here.

Version 2.4.4 compiled, but the final part of for compiling the 
perl modules failed, since pushd/popd are not recognized as commands for 
some reason (normal shell accepts them, though). This problem arises for 
all the following versions and is resolved by just running

cd perl
make -f Makefile.mingw
cd ..

manually instead. For 2.4.4 this Makefile is missing, though, so no 
success as well. I didn't try to copy the versions from 2.4.5+, which 
might just work (modulo my additional comments below).

Versions 2.4.5+ have this Makefile but in my setup, in each version the 
make command messes up the creation of API.c for me, since some error 
causes xvfb-run (I think) to write an error message at the end. It might 
be that my xvfb is setup incorrectly, I just used the default install here.

I found two potential solutions:
1) manually add WINEDEBUG=-all into the API.c make instruction
2) remove xvfb-run from PERL_BIN in the Makefile.

For 2.4.5 only the remove works, for 2.4.6 neither works, for 2.4.7 the 
WINEDEBUG=-all works (didn't try the remove here).

I assume that with these findings it will be possibly to have the trunk 
compile as well, but I didn't try (yet).

> Note
> You may see make: *** [API.c] Error 127 when it tries to build SWISH::API Perl module.
> This means you haven't built the SWISH::API module. You can safely ignore this unless you
> intended to build the perl module. If you did want the perl module then make sure you
> following the instructions in the previous section (Configuring Perl).
> Packaging Swish-e for Installation on Windows
> If you have not built SWISH::API you may do the following to appease NSIS
> mkdir -p perl/blib/arch/auto
> touch perl/blib/arch/auto/dummy
> Now all you need to do is run to build your NSIS installation wizard
> sh ./src/win32/
> Now you should have a Windows installer named ./src/win32/swishsetup.exe
> $ ls -lah src/win32/swishsetup.exe

I got a single warning here:

install function "DownloadActivePerl" not referenced - zeroing code out

That's probably harmless.

Users mailing list
Received on Fri Mar 01 2013 - 14:05:12 GMT