WxPerl bind magic

Posted by jerry@invidi.com on 2013-10-31 19:27

Thought I'd share what I did to get perlapp to fully package up my WxPerl application into an executable. This is for PerlApp 9.2.0 build 296171 and WxWidgets version 2.8.0.

Step 1: add this prior to 'use Wx'
use Wx::Perl::Packager;

Step 2: add the following binds to perlapp cmd:

--bind 'libwx_baseu-2.8.so[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu-2.8.so,extract]' \
--bind 'libwx_baseu-2.8.so.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu-2.8.so.0,extract]' \
--bind 'libwx_baseu-2.8.so.0.8.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu-2.8.so.0.8.0,extract]' \
--bind 'libwx_baseu-2.8.so[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu-2.8.so,extract]' \
--bind 'libwx_gtk2u_core-2.8.so[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_core-2.8.so,extract]' \
--bind 'libwx_gtk2u_core-2.8.so.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_core-2.8.so.0,extract]' \
--bind 'libwx_gtk2u_core-2.8.so.0.8.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_core-2.8.so.0.8.0,extract]' \
--bind 'libwx_gtk2u_adv-2.8.so[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_adv-2.8.so,extract]' \
--bind 'libwx_gtk2u_adv-2.8.so.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_adv-2.8.so.0,extract]' \
--bind 'libwx_gtk2u_adv-2.8.so.0.8.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_adv-2.8.so.0.8.0,extract]' \
--bind 'libwx_baseu_net-2.8.so[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu_net-2.8.so,extract]' \
--bind 'libwx_baseu_net-2.8.so.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu_net-2.8.so.0,extract]' \
--bind 'libwx_baseu_net-2.8.so.0.8.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_baseu_net-2.8.so.0.8.0,extract]' \
--bind 'libwx_gtk2u_html-2.8.so[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_html-2.8.so,extract]' \
--bind 'libwx_gtk2u_html-2.8.so.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_html-2.8.so.0,extract]' \
--bind 'libwx_gtk2u_html-2.8.so.0.8.0[file=/opt/ActivePerl-5.16/site/lib/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_html-2.8.so.0.8.0,extract]' \

One other thing that may be of use, if prior to adding the proper additional bindings (above) the resulting executable will fails to start and just 'Segmentation fault'. The trick is to use strace to see what dynamic library it failed to find, then add a --bind flags and retry. Rinse and repeat as necessary.

jerry