| 1 | Downloaden en standaard buildscript proberen: |
| 2 | {{{ |
| 3 | psy npl # mkdir X/libglew |
| 4 | psy npl # cd X/libglew/ |
| 5 | psy libglew # wget http://dfn.dl.sourceforge.net/sourceforge/glew/glew-1.4.0-src.tgz |
| 6 | --14:24:01-- http://dfn.dl.sourceforge.net/sourceforge/glew/glew-1.4.0-src.tgz |
| 7 | => `glew-1.4.0-src.tgz' |
| 8 | Resolving dfn.dl.sourceforge.net... 194.95.236.6 |
| 9 | Connecting to dfn.dl.sourceforge.net|194.95.236.6|:80... connected. |
| 10 | HTTP request sent, awaiting response... 200 OK |
| 11 | Length: 360,075 (352K) [application/x-gzip] |
| 12 | |
| 13 | 100%[===============================================================================================================>] 360,075 548.15K/s |
| 14 | |
| 15 | 14:24:03 (546.75 KB/s) - `glew-1.4.0-src.tgz' saved [360075/360075] |
| 16 | |
| 17 | psy libglew # cp ../../packagename.SlackBuild.example libglew.SlackBuild |
| 18 | psy libglew # cd ../.. |
| 19 | psy npl # ./rebuildcheck X/libglew/libglew.SlackBuild |
| 20 | REBUILD REQUIRED: ./glew-1.4.0-src.tgz has changed! |
| 21 | REBUILDING /home/psy/syn3/npl/X/libglew/libglew.SlackBuild: |
| 22 | Buildroot up-to-date check: ............................................................................................................DONE |
| 23 | Buildroot /home/psy/syn3/builder/buildroot0 repareren/syncen...OK |
| 24 | /home/psy/syn3/npl/X/libglew word gekopieerd naar werkdirectory /home/psy/syn3/builder/buildroot0/tmp/build |
| 25 | *** Chroot naar /home/psy/syn3/builder/buildroot0 en starten van libglew.SlackBuild in /tmp/build: |
| 26 | /dev/pts/43: No such file or directory |
| 27 | 1 /tmp/build > basename ./libglew.SlackBuild |
| 28 | 1 /tmp/build > sed s/.SlackBuild// |
| 29 | 26 /tmp/build > NAME=libglew |
| 30 | 1 /tmp/build > ls '*.tar.*' |
| 31 | ls: *.tar.*: No such file or directory |
| 32 | 29 /tmp/build > SRC_ARC= |
| 33 | 1 /tmp/build > echo |
| 34 | 1 /tmp/build > sed 's/.*-//g' |
| 35 | 1 /tmp/build > sed 's/\.tar\..*$//g' |
| 36 | 32 /tmp/build > VER= |
| 37 | 1 /tmp/build > echo |
| 38 | 1 /tmp/build > sed 's/\.tar\..*$//g' |
| 39 | 35 /tmp/build > SRC_DIR= |
| 40 | 1 /tmp/build > arch |
| 41 | 39 /tmp/build > ARCH=i586 |
| 42 | 47 /tmp/build > syn3_unpack |
| 43 | Usage: /bin/syn3_unpack <archive> |
| 44 | Unpacks specified archive in current directory. |
| 45 | Automaticly determins how to unpack the file. |
| 46 | 47 /tmp/build > exit 1 |
| 47 | *** Er ging iets mis tijdens het bakken in de buildroot! |
| 48 | }}} |
| 49 | |
| 50 | syn3_unpack herkend geen .tgz files, dus rename file naar .tar.gz met een nette naam zonder src erin: |
| 51 | {{{ |
| 52 | psy npl # cd X/libglew/ |
| 53 | psy libglew # mv glew-1.4.0-src.tgz glew-1.4.0.tar.gz |
| 54 | psy libglew # cd ../.. |
| 55 | psy npl # ./rebuildcheck X/libglew/libglew.SlackBuild |
| 56 | ... |
| 57 | 17 /tmp/build > cd glew-1.4.0 |
| 58 | /bin/syn3_build_automake: line 17: cd: glew-1.4.0: No such file or directory |
| 59 | |
| 60 | }}} |
| 61 | |
| 62 | In de source tarbal bevind zich een directory ''glew'', zonder versie nummer. Dus is het nodig SRC_DIR aan te passen in buildscript: |
| 63 | {{{ |
| 64 | psy npl # mcedit X/libglew/libglew.SlackBuild |
| 65 | |
| 66 | psy npl # ./rebuildcheck X/libglew/libglew.SlackBuild |
| 67 | ... |
| 68 | 18 /tmp/build/glew > ./configure --prefix=/usr --sysconfdir=/etc |
| 69 | /bin/syn3_build_automake: line 18: ./configure: No such file or directory |
| 70 | }}} |
| 71 | |
| 72 | Aiii...er is blijkbaar geen ./configure. We jumpen in de buildroot en kijken hoe we het pakketje moeten builden: |
| 73 | {{{ |
| 74 | psy npl # chroot ../builder/buildroot0/ |
| 75 | stderr is not a tty - where are you? |
| 76 | [Syn-3] root@darkstar.example.net /# ls |
| 77 | bin/ boot/ dev/ etc/ home/ lib/ mnt/ proc/ root/ sbin/ service/ sys/ tmp/ usr/ var/ |
| 78 | [Syn-3] root@darkstar.example.net /# cd /tmp/build/glew |
| 79 | glew glew-1.4.0.tar.gz |
| 80 | [Syn-3] root@darkstar.example.net /# cd /tmp/build/glew |
| 81 | [Syn-3] root@darkstar.example.net /tmp/build/glew# ls |
| 82 | Makefile README.txt auto/ bin/ build/ config/ doc/ include/ lib/ src/ |
| 83 | [Syn-3] root@darkstar.example.net /tmp/build/glew# cat README.txt |
| 84 | See doc/index.html for more information. |
| 85 | |
| 86 | If you downloaded the tarball from the GLEW website, you just need to: |
| 87 | |
| 88 | Unix: |
| 89 | |
| 90 | make |
| 91 | |
| 92 | Windows: |
| 93 | |
| 94 | use the project file in build/vc6/ |
| 95 | |
| 96 | If you wish to build GLEW from scratch (update the extension data from |
| 97 | the net or add your own extension information), you need a Unix |
| 98 | environment (including wget, perl, and GNU make). The extension data |
| 99 | is regenerated from the top level source directory with: |
| 100 | |
| 101 | make extensions |
| 102 | [Syn-3] root@darkstar.example.net /tmp/build/glew# make |
| 103 | cc -O2 -Wall -W -Iinclude -fPIC -o src/glew.pic_o -c src/glew.c |
| 104 | cc -O2 -Wall -W -Iinclude -o src/glew.o -c src/glew.c |
| 105 | In file included from src/glew.c:32: |
| 106 | include/GL/glew.h:1123:20: GL/glu.h: No such file or directory |
| 107 | }}} |
| 108 | |
| 109 | We hebben de opengl library nodig om tegen te compilen. Dit is libmesa. Als we in de makefile kijken zien we dit: |
| 110 | {{{ |
| 111 | ... |
| 112 | GLEW_DEST ?= /usr |
| 113 | BINDIR ?= $(GLEW_DEST)/bin |
| 114 | LIBDIR ?= $(GLEW_DEST)/lib |
| 115 | INCDIR ?= $(GLEW_DEST)/include/GL |
| 116 | ... |
| 117 | install: all |
| 118 | # directories |
| 119 | $(INSTALL) -d -m 0755 $(BINDIR) |
| 120 | $(INSTALL) -d -m 0755 $(INCDIR) |
| 121 | $(INSTALL) -d -m 0755 $(LIBDIR) |
| 122 | ... |
| 123 | }}} |
| 124 | |
| 125 | We hopen dat ''make && make GLEW_DEST=/tmp/pkg/usr install'' het pakketje build en op de goede plek pleurt, en voegen #NEED:libmesa toe aan de slackbuild: |
| 126 | {{{ |
| 127 | In de slackbuild, vervangen we syn3_build_automake door wat andere regels: |
| 128 | build and install sourcefiles |
| 129 | #(use one of the other syn3_build_* scripts when needed) |
| 130 | export CONFIGURE_OPTS="" |
| 131 | export MAKE_OPTS="" |
| 132 | #export NOTEST=1 |
| 133 | #syn3_build_automake $SRC_DIR /tmp/pkg || exit 1 |
| 134 | pushd $SRC_DIR || exit 1 |
| 135 | make -j1 || exit 1 |
| 136 | make -j1 GLEW_DIR=/tmp/pkg/usr install || exit 1 |
| 137 | popd |
| 138 | }}} |
| 139 | |
| 140 | Deze NEED zorgt ervoor dat libmesa en alle builddependencies hiervan in de buildroot geinstalled worden. |
| 141 | |
| 142 | Hierna build hij nog niet, en zeurt hij nog, terwijl de glu.h wel in de buildroot staat: |
| 143 | {{{ |
| 144 | ... |
| 145 | include/GL/glew.h:1123:20: GL/glu.h: No such file or directory |
| 146 | make: *** [src/glew.pic_o] Error 1 |
| 147 | 61 /tmp/build/glew > exit 1 |
| 148 | *** Er ging iets mis tijdens het bakken in de buildroot! |
| 149 | Error while rebuilding /home/psy/syn3/npl/X/libglew/libglew.SlackBuild! |
| 150 | psy npl # chroot ../builder/buildroot0/ |
| 151 | stderr is not a tty - where are you? |
| 152 | [Syn-3] root@darkstar.example.net /# find / |grep glu.h |
| 153 | /usr/X11R6/include/GL/glu.h |
| 154 | /usr/src/Mesa-6.5/docs/glu.html |
| 155 | /usr/src/Mesa-6.5/include/GL/glu.h |
| 156 | }}} |
| 157 | |
| 158 | Dit betekend dat de makefile niet op de goede plek kijkt. Dit noemen we vanaf nu officieel een 'kutpakket' om te compilen. ;) |
| 159 | |
| 160 | We kunnen verder kutten, maar es is veel kans dat de mensen van gentoo of debian al een patch hebben hiervoor. ff zoeken... |
| 161 | Mijn gentoo was nog bij 1.3.x, en van debian vond ik deze patch via google: http://ftp.debian.org/debian/pool/main/g/glew/glew_1.4.0-2.diff.gz |
| 162 | |
| 163 | Maar dit hielp ook niks, even googlen op de foutmelding...via http://www.google.com/search?hl=en&safe=off&q=glew++%2B+GL%2Fglu.h%3A+No+such+file+or+directory&btnG=Search vind je: |
| 164 | {{{ |
| 165 | Installation problem - Jahshaka Forums |
| 166 | include/GL/glew.h:1103:20: error: GL/glu.h: No such file or directory .... Is GLEW installed in /usr/include/GL? If installing openlibraries from cvs you ... |
| 167 | www.jahshaka.org/forum/installation-problem-t629.html - 81k - Cached - Similar pages |
| 168 | }}} |
| 169 | |
| 170 | Klinkt logisch, GL/glu.h moet gewoon in /usr/include staan ipv /usr/X11/include. Is dit een fout in een source pacakge van ons of is glew gewoon krikky? We maken ons niet druk en proberen het ff snel met een symlink in de buildroot: |
| 171 | {{{ |
| 172 | psy npl # chroot ../builder/buildroot0/ |
| 173 | stderr is not a tty - where are you? |
| 174 | [Syn-3] root@darkstar.example.net /# cd /tmp/build/glew |
| 175 | [Syn-3] root@darkstar.example.net /tmp/build/glew# ln -s /usr/X11/include/GL /usr/include/GL |
| 176 | [Syn-3] root@darkstar.example.net /tmp/build/glew# make -j1 |
| 177 | cc -O2 -Wall -W -Iinclude -fPIC -o src/glew.pic_o -c src/glew.c |
| 178 | cc -shared -Wl,-soname=libGLEW.so.1.4 -o lib/libGLEW.so.1.4.0 src/glew.pic_o -lXmu -lXi -lGLU -lGL -lXext -lX11 |
| 179 | /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: cannot find -lXmu |
| 180 | collect2: ld returned 1 exit status |
| 181 | make: *** [lib/libGLEW.so.1.4.0] Error 1 |
| 182 | }}} |
| 183 | |
| 184 | We komen weer een stap verder! Nu zijn we libXmu nog nodig zo te zien. We zoeken even in de filelist waar dat ding staat: |
| 185 | {{{ |
| 186 | psy npl # ./findpkg libXmu |
| 187 | Package libXmu not found! |
| 188 | psy npl # cat .tmp/files|grep -i libXmu |
| 189 | /home/psy/syn3/npl/X/xorg/lib/mods/libXmu-X11R7.1-1.0.1.tar.gz |
| 190 | }}} |
| 191 | |
| 192 | Ok, hij hoort onderdeel te zijn van xorg_lib, maar deze hebben we al. (kijk maar naar de output van rebuildcheck) |
| 193 | Dit komt omdat je normaal ook /etc/xorg_build.conf moet sourcen. Deze set een aantal omgevings variabellen, zodat bepaalde libraries gevonden kunnen worden. We passen de slackbuild aan zodat hij er ongeveer zo uit ziet en rebuilden nogmaals: |
| 194 | |
| 195 | {{{ |
| 196 | #syn3_build_automake $SRC_DIR /tmp/pkg || exit 1 |
| 197 | source /etc/xorg_build.conf || exit 1 |
| 198 | ln -s /usr/X11/include/GL /usr/include/GL || exit 1 |
| 199 | pushd $SRC_DIR || exit 1 |
| 200 | make -j1 || exit 1 |
| 201 | make -j1 GLEW_DIR=/tmp/pkg/usr install || exit 1 |
| 202 | popd |
| 203 | }}} |
| 204 | |
| 205 | rebuild: |
| 206 | {{{ |
| 207 | 62 /tmp/build/glew > make -j1 |
| 208 | cc -O2 -Wall -W -Iinclude -fPIC -o src/glew.pic_o -c src/glew.c |
| 209 | cc -shared -Wl,-soname=libGLEW.so.1.4 -o lib/libGLEW.so.1.4.0 src/glew.pic_o -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11 |
| 210 | ln -sf libGLEW.so.1.4.0 lib/libGLEW.so.1.4 |
| 211 | ln -sf libGLEW.so.1.4.0 lib/libGLEW.so |
| 212 | cc -O2 -Wall -W -Iinclude -o src/glew.o -c src/glew.c |
| 213 | ar cr lib/libGLEW.a src/glew.o |
| 214 | cc -O2 -Wall -W -Iinclude -o bin/glewinfo src/glewinfo.c -Llib -Wl,-Bdynamic -lGLEW -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11 |
| 215 | cc -O2 -Wall -W -Iinclude -o bin/visualinfo src/visualinfo.c -Llib -Wl,-Bdynamic -lGLEW -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11 |
| 216 | 63 /tmp/build/glew > make -j1 GLEW_DIR=/tmp/pkg/usr install |
| 217 | install -d -m 0755 /usr/bin |
| 218 | install -d -m 0755 /usr/include/GL |
| 219 | install -d -m 0755 /usr/lib |
| 220 | install -s -m 0644 lib/libGLEW.so.1.4.0 /usr/lib/ |
| 221 | ln -sf libGLEW.so.1.4.0 /usr/lib/libGLEW.so.1.4 |
| 222 | install -m 0644 include/GL/wglew.h /usr/include/GL/ |
| 223 | install -m 0644 include/GL/glew.h /usr/include/GL/ |
| 224 | install -m 0644 include/GL/glxew.h /usr/include/GL/ |
| 225 | install -s -m 0644 lib/libGLEW.a /usr/lib/ |
| 226 | ln -sf libGLEW.so.1.4.0 /usr/lib/libGLEW.so |
| 227 | install -s -m 0755 bin/glewinfo bin/visualinfo /usr/bin/ |
| 228 | 64 /tmp/build/glew > popd |
| 229 | /tmp/build |
| 230 | 68 /tmp/build > syn3_strip /tmp/pkg |
| 231 | /bin/syn3_strip: line 11: cd: /tmp/pkg: No such file or directory |
| 232 | 68 /tmp/build > exit 1 |
| 233 | *** Er ging iets mis tijdens het bakken in de buildroot! |
| 234 | }}} |
| 235 | |
| 236 | W00t! We zien dat het pakketje wel build, maar het installen gaat nog naar de verkeerde plek. Oops, we gebruiken GLEW_DIR, terwijl het GLEW_DEST moet zijn. (Dit had ik dus verkeerd gelezen ofzo) Dit corrigeren even en rebuilden nogmaals: |
| 237 | {{{ |
| 238 | 63 /tmp/build/glew > make -j1 GLEW_DEST=/tmp/pkg/usr install |
| 239 | install -d -m 0755 /tmp/pkg/usr/bin |
| 240 | install -d -m 0755 /tmp/pkg/usr/include/GL |
| 241 | install -d -m 0755 /tmp/pkg/usr/lib |
| 242 | install -s -m 0644 lib/libGLEW.so.1.4.0 /tmp/pkg/usr/lib/ |
| 243 | ln -sf libGLEW.so.1.4.0 /tmp/pkg/usr/lib/libGLEW.so.1.4 |
| 244 | install -m 0644 include/GL/wglew.h /tmp/pkg/usr/include/GL/ |
| 245 | install -m 0644 include/GL/glew.h /tmp/pkg/usr/include/GL/ |
| 246 | install -m 0644 include/GL/glxew.h /tmp/pkg/usr/include/GL/ |
| 247 | install -s -m 0644 lib/libGLEW.a /tmp/pkg/usr/lib/ |
| 248 | ln -sf libGLEW.so.1.4.0 /tmp/pkg/usr/lib/libGLEW.so |
| 249 | install -s -m 0755 bin/glewinfo bin/visualinfo /tmp/pkg/usr/bin/ |
| 250 | 64 /tmp/build/glew > popd |
| 251 | /tmp/build |
| 252 | 68 /tmp/build > syn3_strip /tmp/pkg |
| 253 | 71 /tmp/build > syn3_move_dev /tmp/pkg /tmp/pkgdev |
| 254 | 72 /tmp/build > syn3_makepkg /tmp/pkgdev libglew_dev 1.4.0 i586 |
| 255 | tar-1.13: libglew_dev.pkg.tar is the archive; not dumped |
| 256 | 75 /tmp/build > syn3_makepkg /tmp/pkg libglew 1.4.0 i586 |
| 257 | tar-1.13: libglew.pkg.tar is the archive; not dumped |
| 258 | *** Build gelukt. |
| 259 | * Packages terugmoven naar originele directory.. |
| 260 | /home/psy/syn3/builder/buildroot0/tmp/build/libglew.arch /home/psy/syn3/builder/buildroot0/tmp/build/libglew_dev.arch ... |
| 261 | /home/psy/syn3/builder/buildroot0/tmp/build/libglew.version /home/psy/syn3/builder/buildroot0/tmp/build/libglew_dev.version ... |
| 262 | /home/psy/syn3/builder/buildroot0/tmp/build/libglew.pkg /home/psy/syn3/builder/buildroot0/tmp/build/libglew_dev.pkg ... |
| 263 | |
| 264 | * Klaar ja! |
| 265 | Updating md5 for /home/psy/syn3/npl/X/libglew/libglew.SlackBuild... |
| 266 | Updating dependency information for /home/psy/syn3/npl/X/libglew/libglew.SlackBuild... |
| 267 | All rebuilds completed. |
| 268 | }}} |
| 269 | |
| 270 | Nu word het hele process doorlopen en lijkt alles goed te gaan. Even in het gemaakte pakketjes kijken of alles goed lijkt: |
| 271 | {{{ |
| 272 | psy npl # tar -tvzf X/libglew/libglew.pkg |
| 273 | drwxr-xr-x root/root 0 2007-08-25 16:01 ./ |
| 274 | drwxr-xr-x root/root 0 2007-08-25 16:01 install/ |
| 275 | -rw-r--r-- root/root 182 2007-08-25 16:01 install/doinst.sh |
| 276 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/ |
| 277 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/lib/ |
| 278 | -rw-r--r-- root/root 229040 2007-08-25 16:01 usr/lib/libGLEW.so.1.4.0 |
| 279 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/bin/ |
| 280 | -rwxr-xr-x root/root 198356 2007-08-25 16:01 usr/bin/glewinfo |
| 281 | -rwxr-xr-x root/root 10936 2007-08-25 16:01 usr/bin/visualinfo |
| 282 | psy npl # tar -tvzf X/libglew/libglew_dev.pkg |
| 283 | drwxr-xr-x root/root 0 2007-08-25 16:01 ./ |
| 284 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/ |
| 285 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/include/ |
| 286 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/include/GL/ |
| 287 | -rw-r--r-- root/root 41824 2007-08-25 16:01 usr/include/GL/wglew.h |
| 288 | -rw-r--r-- root/root 520342 2007-08-25 16:01 usr/include/GL/glew.h |
| 289 | -rw-r--r-- root/root 46077 2007-08-25 16:01 usr/include/GL/glxew.h |
| 290 | drwxr-xr-x root/root 0 2007-08-25 16:01 usr/lib/ |
| 291 | -rw-r--r-- root/root 114412 2007-08-25 16:01 usr/lib/libGLEW.a |
| 292 | |
| 293 | }}} |
| 294 | |
| 295 | Dit ziet er keurig uit...een mooie SO file en een keurig development pakketje met headers en de .a file. |
| 296 | |
| 297 | Nu nog toevoegen aan SVN en committen, en dan is dit pakketje klaar voor gebruik: |
| 298 | {{{ |
| 299 | psy npl # svn add X/libglew |
| 300 | A X/libglew |
| 301 | A X/libglew/libglew.SlackBuild |
| 302 | A (bin) X/libglew/glew-1.4.0.tar.gz |
| 303 | A X/libglew/libglew.arch |
| 304 | A X/libglew/libglew_dev.arch |
| 305 | A X/libglew/libglew.version |
| 306 | A X/libglew/libglew_dev.version |
| 307 | A (bin) X/libglew/libglew.pkg |
| 308 | A (bin) X/libglew/libglew_dev.pkg |
| 309 | A X/libglew/libglew.md5 |
| 310 | psy npl # svn commit -m 'libglew, nodig voor openmsx' X/libglew |
| 311 | Adding X/libglew |
| 312 | Adding (bin) X/libglew/glew-1.4.0.tar.gz |
| 313 | Adding X/libglew/libglew.SlackBuild |
| 314 | Adding X/libglew/libglew.arch |
| 315 | Adding X/libglew/libglew.md5 |
| 316 | Adding (bin) X/libglew/libglew.pkg |
| 317 | Adding X/libglew/libglew.version |
| 318 | Adding X/libglew/libglew_dev.arch |
| 319 | Adding (bin) X/libglew/libglew_dev.pkg |
| 320 | Adding X/libglew/libglew_dev.version |
| 321 | Transmitting file data ......... |
| 322 | Committed revision 3430. |
| 323 | }}} |
| 324 | |
| 325 | Nu kan ik verder met de volgende dependency voor openmsx. |