Hi,
On 07/06/2012 21:53, Steve Cookson wrote:
1) I had an old Wx installation which had been installed with
Alien-wxWidgets and I upgraded with:
cpan -i Text::Patch
cpan -i Wx::PdfDocument
It said the install was too old and upgraded the 2.8.11 Wx::Perl to 2.9.3
and ignored my wxWidgets installation.
I'm not quite sure how this might happen. Because of the use of some
recently added printer commands and richtext commands, the released
Wx::PdfDocument does require the latest Wx 0.9909 - but this should not
have required an Alien::wxWidgets upgrade?
I deleted everything and reinstalled
with:
#!/bin/sh
#
# Reinstall Wx::Perl - first reinstall wxWidgets
#
cd ~
# Remove previous version
rm -rf Alien-wxWidgets
# Download current version
svn co
https://wxperl.svn.sourceforge.net/svnroot/wxperl/Alien-wxWidgets/trunk
Alien-wxWidgets
# Switch to Alien directory
cd Alien-wxWidgets
# Create build script wxWidgets 2.8.11
perl Build.PL --wxWidgets-extraflags="--enable-graphics_ctx
--disable-compat26 --enable-mediactrl --with-libjpeg=builtin
--with-libpng=builtin --with-regex=builtin --with-libtiff=builtin
--with-zlib=builtin --with-expat=builtin --with-libxpm=builtin
--with-gnome-print --with-gnomeprintui" --wxWidgets-build='yes'
--wxWidgets-source='tar.gz' --wxWidgets-unicode=1 --wx-unicode='yes'
--wxWidgets-build-opengl=0 --wxWidgets-version=2.8.11
perl Build # Download and compile wxWidgets.
perl Build install
ldconfig
cd ..
There is no need run ldconfig. I know that wxWidgets throws out a
message telling you to do this, but you are installing wxWidgets to a
custom directory for use by wxPerl alone so I don't think anything is
achieved in this case by running ldconfig.
# Reinstall wxPerl
rm -rf /home/image/wxPerl
svn co https://wxperl.svn.sourceforge.net/svnroot/wxperl/wxPerl/trunk
/home/image/wxPerl
cd /home/image/wxPerl
perl Makefile.PL
make
perl Build install
# Install predecessor for Wx::PdfDocuments
cpan -i Text::Patch
cpan -i Wx::PdfDocuments
But it never uninstalled the 2.9.3 and everything got confused. In the end
I did a clean rebuild of Kubuntu 11.10 reran the script above and everything
worked fine,
I wounder if there could be some sort of warning here or question here and
the user given the option to manually upgrade his installation with his own
version of Alien?
I'm sorry something went wrong along the way. I assume the above install
line for wxPerl is a typo (should be 'make install').
Doing an 'uninstall' could only work within some cpan client or other
wrapper for some ExUtils:: modules that had the appropriate settings for
uninstalling conflicting modules. It isn't something that will happen by
doing make, make install.
I'm fairly sure that if you have all the pre-requisites (gtk etc)
installed for building wxWidgets, (which you're familiar with), then
cpan -i Wx
should work just fine installing Alien::wxWidgets - that will pick up
the system wxWidgets and build nicely.
In your case you want something different to happen (custom wxWidgets
build) and I think the best improvement would be additions to the POD
for Alien::wxWidgets to explain how to get your own required flavour of
wxWidgets installed if that is what you want so I'll take a look at
that. I know that you know how to do this but I think the best
improvement to the Alien::wxWidgets module would be in updated POD.
As you are building out of SVN the experience you meet isn't quite what
a standard cpan installer comes across.
Now that I think all of the printing and richtext updates needed are in
the CPAN releases, you may have a better experience building from CPAN
rather than the wxPerl svn repository.
Building Wx just picks up the first Alien::wxWidgets in @INC so all
variations and customisations take place at the Alien::wxWidgets install
stage.
But your question is a fair one and I think the main underlying question
is 'how do I get a Wx + wxWidgets install that suits my application'. I
don't really have a good answer for this where a base cpan install to
the system Perl is concerned - especially on popular Linux
distributions. It seems to me that if you wanted to approach it in a
standard Linux distro way then you would need to create an application
rpm/deb with the correct dependencies for the distro wxwidgets and Perl
modules - and use whatever flavour of wxWidgets the distro provides.
Even then, you are still at the mercy of whatever else the user may do
with their system Perl.
For example, Unbuntu LTS 12.04 comes with a .deb for Padre - which is
built against the Ubuntu provided Wx and wxWidgets. Installing wxWidgets
2.9.3 into the system Perl will almost certainly break that. It is
extremely difficult to maintain the sort of absolute backwards
compatibility common in Perl modules when your Perl module (Wx) is a
wrapper for an entire GUI framework like wxWidgets.
This was one of the main reasons behind the creation of Citrus Perl. A
binary distribution that you can use to support a wxPerl application. It
is also an attractive feature of Cava Packager - you are in control of
the wxWidgets + wxPerl backend for your application.
2) I had a pre-release Wx::PdfDocument test installation. I re-ran the
above script and the issue seems to be that the old binary has not been
removed or over-written and also occurs earlier in $PATH. The I get:
Undefined subroutine&Wx::PdfDocument::PaperDatabase::GetDefaultPaper called
at /usr/local/lib/perl/5.12.4/Wx/PdfDocument/SetupInfo.pm line 283.
I can do a total rebuild, but how hard would it be to unpick manually?
Thanks and regards.
Wx::PdfDocument::SetupInfo has been removed from the cpan release.
Working with Ulrich, much of the previously pure Perl code was converted
to a C++ implementation in wxPdfDocument. I can only apologise for this
but it was interim code. So you don't need a rebuild - just remove use
of Wx::PdfDocument::SetupInfo.
It should be very simple to replace with Wx::PdfPrintData. There is
quite a lot of stuff in the Wx::Demo module.
Regards
Mark