Création du paquet boswars 2.5
Toujours dans la démarche de passer en revue les paquets que j'avais créé sous archlinux, j'ai voulu vérifier la création du paquet boswars. Mais là, mauvaise surprise, car j'ai rencontré un problème de compilation (cf ERREURS COMPILATION). Après quelques recherches, j'ai découvert que mes problèmes étaient liés au passage à gcc 4.3.
Le test de qualité fait apparaitre un message d'erreur sans gravité.
Attention ce paquet contient une dépendance à catalyst-utils...
PKGBUILD
# $Id: PKGBUILD,v 1.00 2008/09/27 23:45:00 celmir Exp $
# Contributor: Celmir
# Maintainer: Celmir
pkgname=boswars
pkgver=2.5
pkgrel=1
pkgdesc="real time strategy game"
arch=(i686)
license=('GPL')
url="http://www.boswars.org/"
makedepends=('scons')
depends=('catalyst-utils' 'lua' 'sdl' 'libvorbis' 'libpng' 'libtheora')
source=(http://www.boswars.org/dist/releases/$pkgname-$pkgver-src.tar.gz astar.patch stratagus.patch)
md5sums=('9d280d086ccf81119f40bde98eb9a795' '9b463eb67db0638d17d61964fcc65655' '0d45c2de70b213e6bc14860a79adb74e')
install=boswars.install
build() {
cd $startdir/src/$pkgname-$pkgver-src
mkdir -p $startdir/pkg/usr/share/games/$pkgname
patch -p0 -i $startdir/astar.patch || return 1
patch -p0 -i $startdir/stratagus.patch || return 1
scons release || return 1
for _replist in campaigns doc engine graphics intro languages maps scripts sounds tools units
do
cp -r $startdir/src/$pkgname-$pkgver-src/$_replist $startdir/pkg/usr/share/games/$pkgname
done
chown -R root:root $startdir/pkg/usr/share/games/$pkgname
chmod -R ug=rwX,o=rX $startdir/pkg/usr/share/games/$pkgname
install -o root -g root -m 0755 $pkgname $startdir/pkg/usr/share/games/$pkgname/$pkgname
}
TEST DE QUALITE
namcap PKGBUILD
PKGBUILD (boswars) W: file referenced in $startdir outside of $startdir/src or $startdir/pkg
PKGBUILD (boswars) W: file referenced in $startdir outside of $startdir/src or $startdir/pkg
namcap boswars-2.5-1-i686.pkg.tar.gz
RAS
Vous pouvez lister le contenu du paquet avec les commandes suivantes:
- pacman -Qlp boswars-2.5-1-i686.pkg.tar.gz
- pacman -Qip boswars-2.5-1-i686.pkg.tar.gz
ERREURS COMPILATIONS
Les deux erreurs suivantes sont apparues avec le passage à gcc 4.3 et sont corrigées par deux patch.
g++ -o build/release/pathfinder/astar.o -c -fsigned-char -O2 -pipe -fomit-frame-pointer -fexpensive-optimizations -ffast-math -DUSE_VORBIS -DUSE_THEORA -DUSE_OGG -DHAVE_STRCASESTR -DHAVE_STRNLEN -DHAVE_X -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include -I/usr/include -I/usr/include/SDL -Iengine/include -Iengine/guichan/include engine/pathfinder/astar.cpp
engine/pathfinder/astar.cpp: In function 'int AStarAddNode(int, int, int, int)':
engine/pathfinder/astar.cpp:420: error: 'abs' was not declared in this scope
engine/pathfinder/astar.cpp: In function 'int AStarFindSimplePath(int, int, int, int, int, int, int, int, int, int, char*, int, void*)':
engine/pathfinder/astar.cpp:789: error: 'abs' was not declared in this scope
engine/pathfinder/astar.cpp: In function 'int AStarFindPath(int, int, int, int, int, int, int, int, int, int, char*, int, void*)':
engine/pathfinder/astar.cpp:884: error: 'abs' was not declared in this scope
scons: *** [build/release/pathfinder/astar.o] Error 1
scons: building terminated because of errors.
==> ERREUR: La compilation a échoué.
Abandon...
g++ -o build/release/stratagus/stratagus.o -c -fsigned-char -O2 -pipe -fomit-frame-pointer -fexpensive-optimizations -ffast-math -DUSE_VORBIS -DUSE_THEORA -DUSE_OGG -DHAVE_STRCASESTR -DHAVE_STRNLEN -DHAVE_X -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include -I/usr/include -I/usr/include/SDL -Iengine/include -Iengine/guichan/include engine/stratagus/stratagus.cpp
In file included from engine/stratagus/stratagus.cpp:201:
engine/include/results.h:43: warning: 'typedef' was ignored in this declaration
engine/stratagus/stratagus.cpp: In function 'void StartMap(const std::string&, bool)':
engine/stratagus/stratagus.cpp:410: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, gcn::Container*&)'
scons: *** [build/release/stratagus/stratagus.o] Error 1
scons: building terminated because of errors.
==> ERREUR: La compilation a échoué.
Abandon...
FICHIERS
Commentaires