martes, 30 de agosto de 2011

Linux: Compilar aMule + Compilar WxWidgets

Va haver-hi un temps en que quan tancaves una finestra de cerca a l'aMule es tancava també tot el programa. Altrament quan minimitzavem a la System Tray el programa també petava. Si no recordo malament no era problema del mateix programa aMule si no d'unes llibreries que en depèn anomenades WxWidgets.

"Las wxWidgets son unas bibliotecas multiplataforma y libres, para el desarrollo de interfaces gráficas programadas en lenguaje C++." Wikipedia dixit.

Total que per solventar aquest problema vaig haver de compilar aMule i WxWidgets:

1. Ens baixem un aMule SVN de http://amule.sourceforge.net/tarballs/tarballs.xml

2. Ens baixem una versió estable de WxWidgets com en el meu cas era la versio 2.8.12: http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.8.12.tar.bz2

3. Descomprimim ambdos fitxers (tar zxfv fitxer.tar.gz i tar jxfv fitxer.tar.bz2)

4. Entrem lògicament primer al directori del WxWidgets i el configurem:

xddxdd@ubuntu:~$ ./configure --prefix=/usr --with-gtk --enable-unicode --disable-compat24 --enable-optimise

L'opció unicode es indispensable per a poder compilar l'aMule.

si tot va bé:

xddxdd@ubuntu:~$ make

xddxdd@ubuntu:~$ sudo make install

xddxdd@ubuntu:~$ sudo ldconfig

(per ajuntar comandes s'utilitza el simbol && de manera que ho podriem fer tot en una sola linia (com a ROOT) ./configure blalbalblal && make && make install && ldconfig però com és possible que el configure no configuri bé i el make doni algun error no sóc partidari, per si algú ho llegeix, de fer servir el && i posar-ho tot en una línia).

Recordar que l'únic que requereix identificar-se com a ROOT és el make install (també lògicament i apart del ldconfig).

5. Ara entrem al directori on hem descomprimit l'aMule

si executem configure així tal cual:

xddxdd@ubuntu:~$ ./configure

probablement tindrem un error:

checking for the --with-wxdebug option... will be automatically detected
checking for the --with-wxversion option... will be automatically detected
checking for wx-config... /usr/local/bin/wx-config
checking for wxWidgets version >= 2.8.12 (--unicode=yes)... no
configure: error:
The requested wxWidgets build couldn't be found.

The configuration you asked for aMule requires a wxWidgets
build with the following settings:
--unicode=yes
but such build is not available.

To see the wxWidgets builds available on this system, please use
'wx-config --list' command. To use the default build, returned by
'wx-config --selected-config', use the options with their 'auto'
default values.

If you still get this error, then check that 'wx-config' is
in path, the directory where wxWidgets libraries are installed
(returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
or equivalent variable and wxWidgets version is 2.8.12 or above.

Per resoldre aquest fastidiós error s'ha de posar un paràmetre amb la ruta on hem indicat que s'instalés WxWidgets :--with-wxdir=/usr/

(també adjunto 2 paràmetres més que solen utilitzar-se per compilar aMule):

xddxdd@ubuntu:~$ ./configure --with-wxdir=/usr/ --disable-debug --enable-optimize

xddxdd@ubuntu:~$ make

xddxdd@ubuntu:~$ make install


Si tot ha anat bé, ara ja podem executar aMule.

PD: Deixo aquí una seqüència de comandes d'interès per configurar WxWidgets quan hi ha més d'una versió instalada.

wx-config --list

wx-config --selected-config

update-alternatives --config wx-config

No hay comentarios: