wiki:npl/mediabox/libsdl-image

Downloaden en standaard buildscript proberen:

psy npl # mkdir mediabox/libsdl_image
psy npl # cd mediabox/libsdl_image/
psy libsdl_image # wget http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.6.tar.gz
--16:10:58--  http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.6.tar.gz
           => `SDL_image-1.2.6.tar.gz'
Resolving www.libsdl.org... 208.97.185.109
Connecting to www.libsdl.org|208.97.185.109|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,308,812 (1.2M) [application/x-tar]

100%[===============================================================================================================>] 1,308,812    350.32K/s    ETA 00:00

16:11:05 (194.10 KB/s) - `SDL_image-1.2.6.tar.gz' saved [1308812/1308812]

psy libsdl_image # cp ../../.SlackBuild.example libglew.SlackBuild
psy libsdl_image # cp ../../packagename.SlackBuild.example libsdl_image.SlackBuild
psy libsdl_image # cd ../..
psy npl # ./rebuildcheck libsdl_image
REBUILD REQUIRED: ./SDL_image-1.2.6.tar.gz has changed!
REBUILDING /home/psy/syn3/npl/mediabox/libsdl_image/libsdl_image.SlackBuild:
Buildroot up-to-date check: ............................................................................................................DONE
Buildroot /home/psy/syn3/builder/buildroot0 repareren/syncen...OK
/home/psy/syn3/npl/mediabox/libsdl_image word gekopieerd naar werkdirectory /home/psy/syn3/builder/buildroot0/tmp/build
*** Chroot naar /home/psy/syn3/builder/buildroot0 en starten van libsdl_image.SlackBuild in /tmp/build:
/dev/pts/43: No such file or directory
1 /tmp/build > basename ./libsdl_image.SlackBuild
1 /tmp/build > sed s/.SlackBuild//
26 /tmp/build > NAME=libsdl_image
1 /tmp/build > ls SDL_image-1.2.6.tar.gz
...
checking for sdl-config... no
checking for SDL - version >= 1.2.10... no
*** The sdl-config script installed by SDL could not be found
*** If SDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the SDL_CONFIG environment variable to the
*** full path to sdl-config.
configure: error: *** SDL version 1.2.10 not found!
18 /tmp/build/SDL_image-1.2.6 > exit 1
57 /tmp/build > exit 1
*** Er ging iets mis tijdens het bakken in de buildroot!
Error while rebuilding /home/psy/syn3/npl/mediabox/libsdl_image/libsdl_image.SlackBuild!
psy npl #     

Het lijkt er op dat we libsdl nodig zijn als dependency. (best logisch ook). We zetten #NEED:libsdl in de slackbuild en proberen het nog eens. Deze heeft zeer veel diepere dependencies, dus het duurt even om de buildroot te vullen. Koffie dus! Sterker nog het is zaterdag, dus even een lekker Bitburger biertje er bij:

checking for SDL - version >= 1.2.10... no
*** Could not run SDL test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means SDL was incorrectly installed
*** or that you have moved SDL since it was installed. In the latter case, you
*** may want to edit the sdl-config script: /usr/bin/sdl-config
configure: error: *** SDL version 1.2.10 not found!
psy npl # ./findpkg libsdl
/home/psy/syn3/npl/.tmp/D/libsdl-1.2.11-i586-3073.tgz

Aiiii...het werkt nog niet, we hebben versie 1.2.11, dus het moet werken zou je zeggen. We duiken de buildroot in en gaan op onderzoek uit:

psy npl # chroot ../builder/buildroot0/
stderr is not a tty - where are you?
[Syn-3] root@darkstar.example.net /# cd /tmp/build/
SDL_image-1.2.6          SDL_image-1.2.6.tar.gz   libsdl_image.SlackBuild
[Syn-3] root@darkstar.example.net /# cd /tmp/build/SDL_image-1.2.6
[Syn-3] root@darkstar.example.net /tmp/build/SDL_image-1.2.6# cat config.
config.guess  config.log    config.sub
[Syn-3] root@darkstar.example.net /tmp/build/SDL_image-1.2.6# cat config.log
...
configure:20120: result: no
configure:20159: gcc -o conftest -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   conftest.c  -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread >&5
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: warning: libdirectfb-0.9.so.25, needed by /usr/lib/libSDL.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: warning: libfusion-0.9.so.25, needed by /usr/lib/libSDL.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: warning: libdirect-0.9.so.25, needed by /usr/lib/libSDL.so, not found (try using -rpath or -rpath-link)
/usr/lib/libSDL.so: undefined reference to `DirectFBCreate'
/usr/lib/libSDL.so: undefined reference to `DirectFBErrorString'
/usr/lib/libSDL.so: undefined reference to `DirectFBError'
/usr/lib/libSDL.so: undefined reference to `DirectFBInit'
collect2: ld returned 1 exit status
...

We zien in de config.log, een stuk vanaf het einde van de file dat libSDL.so de dependency libdirectfb nodig is. Vreemd, want deze moet automatisch geinstalled worden. We onderenzoeken libSDL.so wat beter:

[Syn-3] root@darkstar.example.net /tmp/build/SDL_image-1.2.6# ldd /usr/lib/libSDL.so
        libm.so.6 => /lib/libm.so.6 (0xb7e48000)
        libX11.so.6 => /usr/X11/lib/libX11.so.6 (0xb7d5b000)
        libXext.so.6 => /usr/X11/lib/libXext.so.6 (0xb7d4d000)
        libXrandr.so.2 => /usr/X11/lib/libXrandr.so.2 (0xb7d49000)
        libXrender.so.1 => /usr/X11/lib/libXrender.so.1 (0xb7d3f000)
        libdirectfb-0.9.so.25 => not found
        libfusion-0.9.so.25 => not found
        libdirect-0.9.so.25 => not found
        libz.so.1 => /usr/lib/libz.so.1 (0xb7d2d000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7d2a000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7cd8000)
        libc.so.6 => /lib/libc.so.6 (0xb7ba9000)
        libXau.so.6 => /usr/X11/lib/libXau.so.6 (0xb7ba6000)
        libXdmcp.so.6 => /usr/X11/lib/libXdmcp.so.6 (0xb7ba1000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
[Syn-3] root@darkstar.example.net /tmp/build/SDL_image-1.2.6# find / |grep libdirectfb
...
/usr/lib/libdirectfb-1.0.so.0.0.0
/usr/lib/libdirectfb.so
/usr/lib/libdirectfb-1.0.so.0
/usr/lib/libdirectfb.la

Shit...libsdl is gelinked tegen libdirectfb 0.9, terwijl libdirectfb 1.0 geinstalleerd is! Dit betekend dat iemand ooit een nieuwe versie voor libdirectfb gebuild heeft en dat libsdl niet gerebuild is. We kijken in libsdl en veranderen de #NEED in #DEP. Zo zorgen we ervoor dat libsdl automatisch gerebuild word bij een andere versie van libdirectfb. Ook zetten we in ons eigen script een #DEP, zodat we zeker weten dat deze ook rebuild als libsdl ooit vernieuwd word..

We doen een rebuildcheck op libsdl_image, waardoor libsdl nu automatisch gerebuild word en daarna libsdl_image nogmaals. (hopenlijk;). Dit gaat allemaal nog langer duren, dus we lurken rustig van ons bier en wachten af:

psy npl # mcedit mediabox/libsdl/libsdl.SlackBuild

psy npl # mcedit -dc mediabox/libsdl_image/libsdl_image.SlackBuild

psy npl # ./rebuildcheck libsdl_image
Dependency check libsdl (use ignoredep to skip)
|-Dependency check DirectFB (use ignoredep to skip)
|-REBUILD REQUIRED: ./libsdl.SlackBuild has changed!
|-Rebuild required: Dependency MD5 changed /home/psy/syn3/npl/mediabox/DirectFB/DirectFB!
|-(use ignoredep to ignore dependency changes)
|-Was builded against:
cat: /home/psy/syn3/npl/mediabox/libsdl/libsdl.depver: No such file or directory
|-REBUILDING /home/psy/syn3/npl/mediabox/libsdl/libsdl.SlackBuild:
...
*** Build gelukt.
* Packages terugmoven naar originele directory..
/home/psy/syn3/builder/buildroot0/tmp/build/libsdl.arch /home/psy/syn3/builder/buildroot0/tmp/build/libsdl_dev.arch ...
/home/psy/syn3/builder/buildroot0/tmp/build/libsdl.version /home/psy/syn3/builder/buildroot0/tmp/build/libsdl_dev.version ...
/home/psy/syn3/builder/buildroot0/tmp/build/libsdl.pkg /home/psy/syn3/builder/buildroot0/tmp/build/libsdl_dev.pkg ...

* Klaar ja!
|-Updating md5 for /home/psy/syn3/npl/mediabox/libsdl/libsdl.SlackBuild...
|-Updating dependency information for /home/psy/syn3/npl/mediabox/libsdl/libsdl.SlackBuild...
REBUILD REQUIRED: ./SDL_image-1.2.6.tar.gz has changed!
...
*** Build gelukt.
* Packages terugmoven naar originele directory..
/home/psy/syn3/builder/buildroot0/tmp/build/libsdl_image.arch /home/psy/syn3/builder/buildroot0/tmp/build/libsdl_image_dev.arch ...
/home/psy/syn3/builder/buildroot0/tmp/build/libsdl_image.version /home/psy/syn3/builder/buildroot0/tmp/build/libsdl_image_dev.version ...
/home/psy/syn3/builder/buildroot0/tmp/build/libsdl_image.pkg /home/psy/syn3/builder/buildroot0/tmp/build/libsdl_image_dev.pkg ...

* Klaar ja!
Updating md5 for /home/psy/syn3/npl/mediabox/libsdl_image/libsdl_image.SlackBuild...
Updating dependency information for /home/psy/syn3/npl/mediabox/libsdl_image/libsdl_image.SlackBuild...
All rebuilds completed.


Het rebuilden van libsdl EN libsdl_image gaat nu goed! Het probleem lag dus bij een ander pakketje. We zijn er in geslaagd om libsdl_image simpelweg te builden door het standaard buildscript te gebruiken met 1 DEP er in voor libsdl.

We bekijken de inhoud van het pakketje:

psy npl # tar -tzf mediabox/libsdl_image/libsdl_image.pkg
./
install/
install/doinst.sh
usr/
usr/lib/
usr/lib/libSDL_image-1.2.so.0.1.5
psy npl # tar -tzf mediabox/libsdl_image/libsdl_image_dev.pkg
./
usr/
usr/lib/
usr/lib/libSDL_image.la
usr/lib/libSDL_image.a
usr/include/
usr/include/SDL/
usr/include/SDL/SDL_image.h

Dit ziet er goed uit. Tijd om toe te voegen aan SVN:

psy npl # svn add mediabox/libsdl_image
A         mediabox/libsdl_image
A  (bin)  mediabox/libsdl_image/SDL_image-1.2.6.tar.gz
A         mediabox/libsdl_image/libsdl_image.SlackBuild
A         mediabox/libsdl_image/libsdl_image.arch
A         mediabox/libsdl_image/libsdl_image_dev.arch
A         mediabox/libsdl_image/libsdl_image.version
A         mediabox/libsdl_image/libsdl_image_dev.version
A  (bin)  mediabox/libsdl_image/libsdl_image.pkg
A  (bin)  mediabox/libsdl_image/libsdl_image_dev.pkg
A         mediabox/libsdl_image/libsdl_image.md5
A         mediabox/libsdl_image/libsdl_image.depver
psy npl # svn commit -m 'libsdl_image,nodig voor openmsx' mediabox/libsdl_image/
Adding         mediabox/libsdl_image
Adding  (bin)  mediabox/libsdl_image/SDL_image-1.2.6.tar.gz
Adding         mediabox/libsdl_image/libsdl_image.SlackBuild
Adding         mediabox/libsdl_image/libsdl_image.arch
Adding         mediabox/libsdl_image/libsdl_image.depver
Adding         mediabox/libsdl_image/libsdl_image.md5
Adding  (bin)  mediabox/libsdl_image/libsdl_image.pkg
Adding         mediabox/libsdl_image/libsdl_image.version
Adding         mediabox/libsdl_image/libsdl_image_dev.arch
Adding  (bin)  mediabox/libsdl_image/libsdl_image_dev.pkg
Adding         mediabox/libsdl_image/libsdl_image_dev.version
Transmitting file data ..........
Committed revision 3431.

Zo, nu kunnen we weer verder met openmsx. En het mooiste is: ons biertje is nog niet eens op!

Last modified 16 years ago Last modified on 08/08/08 00:10:42