mercredi 16 décembre 2009

II. Compilation de libpod4

Dans le blog précédent, je vous ai montré comment on monte un iPhone/iTouch. Passons maintenant à quelque chose de plus sérieux.

Nous allons installer les paquets nécessaires à la compilation de libpod4. Ce qu'il faut juste savoir c'est que libgpod est une bibliothèque partagée pour accéder au contenu d'un iPod.


4. Installation des différents paquets nécessaires pour la compilation de libgpod4


Commençons par installer l'outil Git, qui est un logicile de gestion de version décentralisée. Par décentralisé, on entend que chaque personne peut développer son propre dépôt.

malagasy@malagasy-laptop:~$ sudo apt-get install git-core
The following extra packages will be installed:
libdigest-sha1-perl liberror-perl
Suggested packages:
git-doc git-arch git-cvs git-svn git-email git-daemon-run git-gui gitk
gitweb

Lors de l'installation du paquet git-core, d'autres paquets ont été suggérés à être installé, que je n'ai pas fait. Dans la suite de mes installations, je n'installe aucun autre paquet, sauf ceux que je vous vais vous indiquer.

Nous avons besoin d'installer les paquets suivant afin de pouvoir compiler le paquet libgpod4.
malagasy@malagasy-laptop:~$ sudo apt-get install autoconf libtool libglib2.0-dev intltool gtk-doc-tools sqlite3 libsqlite3-dev zlib1g-dev libxml2-dev checkinstall
The following extra packages will be installed:
automake autotools-dev cvs docbook docbook-dsssl docbook-to-man
docbook-xsl docbook-xsl-doc-html gettext gnome-common jade libltdl-dev
libruby1.8 libsp1c2 m4 ruby ruby1.8 sp
Suggested packages:
autoconf2.13 autobook autoconf-archive gnu-standards autoconf-doc psgml
docbook-defguide jadetex docbook-dsssl-doc libsaxon-java libxalan2-java
docbook-xsl-saxon fop xalan gettext-doc libtool-doc sqlite3-doc automaken
gfortran fortran95-compiler gcj ruby1.8-examples rdoc1.8 ri1.8
Puis installation du paquet libiphone-dev, puis de deux autres paquets optionnels libgdk-pixbuf2 et libgdk-pixbuf-dev pour pouvoir transférer des images (photos, couvertures d'album …).
malagasy@malagasy-laptop:~$ sudo apt-get install libiphone-dev libgdk-pixbuf2 libgdk-pixbuf-dev
E: Couldn't find package libgdk-pixbuf2
En effectuant quelques recherches sur le net, j'ai noté que “libgdk-pixbuf2″ et “libgdk-pixbuf-dev” sont inclus dans libgtk2.0-dev et libgtk2.0. J'ai effectué l'installation de ces derniers via synaptic puisqu'il m'est impossible des les installer via apt-get install.

Par contre, j'ai oublié d'installer le paquet libiphone-dev suite à cette erreur.


5. Compilation du paquet libgpod4


Pour compiler ligpod4, il faut taper les commandes suivantes :
$ git clone git://gitorious.org/~marcan/libgpod/marcan-sandbox/
$ cd marcan-sandbox/
$ git checkout origin/iphone30
$ CFLAGS="-g -O0" sh autogen.sh -prefix=/usr
En tapant ces commandes, je me suis apperçu par la suite qu'il me manquait des paquets, que j'installerai au fur et à mesure où cela est nécessaire comme vous pouvez le constater ci dessous.
malagasy@malagasy-laptop:~$ git clone git://gitorious.org/~marcan/libgpod/marcan-sandbox/
Initialized empty Git repository in /home/malagasy/marcan-sandbox/.git/
remote: Counting objects: 5282, done.
remote: Compressing objects: 100% (1522/1522), done.
remote: Total 5282 (delta 4015), reused 4925 (delta 3740)
Receiving objects: 100% (5282/5282), 1.66 MiB | 124 KiB/s, done.
Resolving deltas: 100% (4015/4015), done.
malagasy@malagasy-laptop:~$ cd marcan-sandbox/
malagasy@malagasy-laptop:~/marcan-sandbox$ ls
AUTHORS docs Makefile.am tests
autogen.sh gnome-autogen.sh NEWS tools
bindings INSTALL po TROUBLESHOOTING
ChangeLog INSTALL_SVN README
configure.ac libgpod-1.0.pc.in README.SysInfo
COPYING m4 src
malagasy@malagasy-laptop:~/marcan-sandbox$ git checkout origin/iphone30
Note: moving to 'origin/iphone30' which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at f324198... Debug SHA1 payload
malagasy@malagasy-laptop:~/marcan-sandbox$ CFLAGS="-g -O0" sh autogen.sh -prefix=/usr

checking for autoconf >= 2.53...
testing autoconf2.50... not found.
testing autoconf... found 2.64
checking for automake >= 1.7...
testing automake-1.11... found 1.11
checking for libtool >= 1.4.3...
testing libtoolize... found 2.2.6
checking for glib-gettext >= 2.2.0...
testing glib-gettextize... found 2.22.2
checking for intltool >= 0.25...
testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
testing pkg-config... found 0.22
checking for gtk-doc >= 1.0...
testing gtkdocize... found 1.11
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running libtoolize...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running glib-gettextize... Ignore non-fatal messages.
Copying file mkinstalldirs
Copying file po/Makefile.in.in

Please add the files
codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
progtest.m4
from the /aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

Running intltoolize...
Running gtkdocize...
Running aclocal-1.11...
Running autoconf...
Running autoheader...
Running automake-1.11...
configure.ac:45: installing `./compile'
configure.ac:52: installing `./config.guess'
configure.ac:52: installing `./config.sub'
configure.ac:36: installing `./install-sh'
configure.ac:36: installing `./missing'
bindings/python/Makefile.am: installing `./depcomp'
bindings/python/Makefile.am:39: installing `./py-compile'
Running ./configure --enable-maintainer-mode -prefix=/usr ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for ANSI C header files... (cached) yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether NLS is requested... yes
checking for intltool >= 0.21... 0.41.0 found
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.10.0
checking for XML::Parser... ok
checking for localtime_r... yes
checking for struct tm.tm_gmtoff... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBGPOD... yes
checking for GLIB... yes
checking for sg_ll_inquiry in -lsgutils2... no
checking for sg_ll_inquiry in -lsgutils... no
checking for inflate in -lz... yes
checking for HAL... no
checking for LIBIPHONE... no
checking for TAGLIB... no
checking for LIBXML... yes
checking for GDKPIXBUF... yes
checking for PYGOBJECT... no
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for catalogs to be installed... de es fr he it ja ro sv zh_CN
checking whether to build gtk-doc documentation... no
checking for gtkdoc-check... /usr/bin/gtkdoc-check
checking whether to build python bindings... yes
checking for python... /usr/bin/python
checking whether /usr/bin/python version >= 2.1.1... yes
checking for /usr/bin/python version... 2.6
checking for /usr/bin/python platform... linux2
checking for /usr/bin/python script directory... ${prefix}/lib/python2.6/dist-packages
checking for /usr/bin/python extension module directory... ${exec_prefix}/lib/python2.6/dist-packages
checking for python development headers... not found
checking for more warnings... yes
checking whether gcc understands -Wno-strict-aliasing... yes
checking whether gcc understands -Wno-sign-compare... yes
checking whether gcc understands -Wdeclaration-after-statement... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating bindings/Makefile
config.status: creating bindings/python/gpod.i
config.status: creating bindings/python/Makefile
config.status: creating bindings/python/examples/Makefile
config.status: creating bindings/python/tests/Makefile
config.status: creating docs/Makefile
config.status: creating docs/reference/Makefile
config.status: creating docs/reference/version.xml
config.status: creating m4/Makefile
config.status: creating po/Makefile.in
config.status: creating src/Makefile
config.status: creating tools/Makefile
config.status: creating tests/Makefile
config.status: creating libgpod-1.0.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands

Configuration for libgpod 0.7.3SVN :
--------------------------------

Host System Type .........: i686-pc-linux-gnu
Install path .............: /usr
Preprocessor .............: gcc
Compiler .................: gcc -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -std=c89 -g -O0 -Wno-strict-aliasing -Wno-sign-compare -Wdeclaration-after-statement -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
Linker ...................: gcc -lgobject-2.0 -lglib-2.0 -lsqlite3 -lxml2 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
Artwork support ..........: yes
Python bindings ..........: no
PyGObject support ........: no
iPhone/iPod Touch support.: no

Now type 'make' to build libgpod 0.7.3SVN,
and then 'make install' for installation.

Now type `make' to compile libgpod
Comme vous pouvez vous attendre l'iTouch n'est pas supporté, vu que j'ai oublié d'installer le paquet libiphone-dev, par contre la prise en charge des pochettes est bien supportée.

Dans le prochain billet, je vous vous donnerai les résultats de la manipulation si on essaye de compiler libgpod à ce stade, ie comme indiqué ci dessus "iPhone/iPod Touch support.: no", puis de synchroniser l'iTouch.


6. Compilation du paquet libgpod4 (suite)

Nous allons maintenant installer le paquet libiphone-dev.
malagasy@malagasy-laptop:~/marcan-sandbox$ sudo apt-get install libiphone-dev
The following packages were automatically installed and are no longer required:
media-player-info
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libgcrypt11-dev libgnutls-dev libgpg-error-dev libplist-dev libplist1
libtasn1-3-dev libusb-1.0-0-dev libusbmux-dev
Suggested packages:
libgcrypt11-doc gnutls-doc gnutls-bin guile-gnutls

malagasy@malagasy-laptop:~/marcan-sandbox$ git checkout origin/iphone30
HEAD is now at f324198... Debug SHA1 payload

malagasy@malagasy-laptop:~/marcan-sandbox$ CFLAGS="-g -O0" sh autogen.sh -prefix=/usr
(...)
Running automake-1.11...
Running ./configure --enable-maintainer-mode -prefix=/usr ...
checking for a BSD-compatible install... /usr/bin/install -c
(...)
checking for LIBIPHONE... yes
checking for iphone_device_new in -liphone... yes
(...)
Configuration for libgpod 0.7.3SVN :
--------------------------------
(...)
Artwork support ..........: yes
Python bindings ..........: no
PyGObject support ........: no
iPhone/iPod Touch support.: yes


7. Installation de paquets supplémentaires, mais pas forcément nécessaires pour la compilation de libgpod4

Le non support de PyGObject m'a perturbé, et donc j'étais allé cherché les paquets nécessaires pour pouvoir le faire, qui sont python-gobject et python-gobject-dev.
malagasy@malagasy-laptop:~/marcan-sandbox$ sudo apt-get install python-gobject python-gobject-dev
The following extra packages will be installed:
libffi-dev python-dev python2.6-dev
malagasy@malagasy-laptop:~/marcan-sandbox$ CFLAGS="-g -O0" sh autogen.sh -prefix=/usr
(...)
checking for python development headers... found
checking for python module mutagen >= 1.8... no
(...)
Configuration for libgpod 0.7.3SVN :
--------------------------------
(...)
Artwork support ..........: yes
Python bindings ..........: no
PyGObject support ........: yes
iPhone/iPod Touch support.: yes
J'ai effectué l'installation du paquet python-mutagen via synaptic. Après quelques recherches, j'ai appris que Mutagène est un module Python pour manipuler des métadonnées audio. Il supporte les formats FLAC,M 4A, MP3, Ogg FLAC, Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, et les fichiers audio WavPack.
malagasy@malagasy-laptop:~/marcan-sandbox$ CFLAGS="-g -O0" sh autogen.sh -prefix=/usr
(...)
checking for python development headers... found
checking for python module mutagen >= 1.8... yes
checking for swig... no
configure: WARNING: cannot find 'swig' program. You should look at http://www.swig.org
(...)
Configuration for libgpod 0.7.3SVN :
--------------------------------
(...)
Artwork support ..........: yes
Python bindings ..........:
PyGObject support ........: yes
iPhone/iPod Touch support.: yes
J'ai ensuite installé les paquets swig & swig1.3 via Synaptique. Swig1.3 étant l'upgrade du paquet swig.
malagasy@malagasy-laptop:~/marcan-sandbox$ CFLAGS="-g -O0" sh autogen.sh -prefix=/usr
(...)
checking for swig... /usr/bin/swig
checking for SWIG version... 1.3.36
(...)
Configuration for libgpod 0.7.3SVN :
--------------------------------
(...)
Artwork support ..........: yes
Python bindings ..........: yes
PyGObject support ........: yes
iPhone/iPod Touch support.: yes

Now type 'make' to build libgpod 0.7.3SVN,
and then 'make install' for installation.

Now type `make' to compile libgpod
Maintenant que tout à l'air bon, on peut lancer la commande 'make'.

La suite dans le prochain billet.

Aucun commentaire: