crack-attack: backport cross-build fix to original template

This commit is contained in:
Christian Neukirchen 2014-07-09 16:27:49 +02:00
parent 19fe5d9046
commit d66109cc54
5 changed files with 27 additions and 79 deletions

View File

@ -1,12 +0,0 @@
diff -up crack-attack-1.1.14/src/Sound.cxx~ crack-attack-1.1.14/src/Sound.cxx
--- src/Sound.cxx 2008-06-24 11:20:22.000000000 +0200
+++ src/Sound.cxx 2008-06-24 11:20:22.000000000 +0200
@@ -41,7 +41,7 @@ ChunkMap chunks;
int audio_rate = 22050;
int audio_channels = 2;
int audio_buffers = 1024; /* small enough buffer to get synchronized sound */
-Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */
+Uint16 audio_format = AUDIO_S16SYS; /* 16-bit stereo */
int has_audio_available = 0;
void Sound::initialize( void )

View File

@ -1,37 +0,0 @@
--- src/Music.h 2007-01-12 10:54:25.000000000 +0100
+++ src/Music.h 2007-01-12 10:54:25.000000000 +0100
@@ -34,10 +34,10 @@
#include <vector>
#define GC_MUSIC_FILENAME_LENGTH 128
-#define GC_MUSIC_PRELUDE_TRACK "prelude"
-#define GC_MUSIC_GAME_TRACK "game"
-#define GC_MUSIC_GAMEOVER_TRACK "gameover"
-#define GC_MUSIC_YOUWIN_TRACK "youwin"
+#define GC_MUSIC_PRELUDE_TRACK "prelude.xm"
+#define GC_MUSIC_GAME_TRACK "game.xm"
+#define GC_MUSIC_GAMEOVER_TRACK "gameover.xm"
+#define GC_MUSIC_YOUWIN_TRACK "youwin.xm"
class Music {
public:
--- src/Music.cxx 2007-01-12 11:23:15.000000000 +0100
+++ src/Music.cxx 2007-01-12 11:23:15.000000000 +0100
@@ -91,7 +91,7 @@
cout << "Playing " << music_filelist[current_track].c_str() << endl;
#endif
music = Mix_LoadMUS( music_filelist[current_track].c_str() );
- Mix_VolumeMusic( MIX_MAX_VOLUME / 4 );
+ Mix_VolumeMusic( (MIX_MAX_VOLUME * 8) / 10 );
Mix_PlayMusic( music , 0 );
Mix_HookMusicFinished(Music::finished);
keep_playing = 1;
@@ -126,7 +126,7 @@
cout << "Playing " << Track.c_str() << endl;
#endif
music = Mix_LoadMUS( Track.c_str() );
- Mix_VolumeMusic( MIX_MAX_VOLUME / 4 );
+ Mix_VolumeMusic( (MIX_MAX_VOLUME * 8) / 10 );
Mix_PlayMusic( music , 0 );
keep_playing = 0;
}

View File

@ -1,11 +0,0 @@
diff -up crack-attack-1.1.14/src/TextureLoader.h~ crack-attack-1.1.14/src/TextureLoader.h
--- src/TextureLoader.h 2008-01-04 23:07:02.000000000 +0100
+++ src/TextureLoader.h 2008-01-04 23:07:02.000000000 +0100
@@ -28,6 +28,7 @@
#define TEXTURELOADER_H
#include <GL/glut.h>
+#include <string.h>
#include "glext.h"
#include "sstream.h"

View File

@ -1,11 +0,0 @@
diff -ur crack-attack-1.1.14.vanilla/src/Attack.cxx crack-attack-1.1.14/src/Attack.cxx
--- src/Attack.cxx 2005-05-13 21:00:02.000000000 +0200
+++ src/Attack.cxx 2006-05-04 09:56:04.000000000 +0200
@@ -83,6 +83,7 @@
int height = -1, width = -1;
player_name[0] = '\0';
+ glutInit(&argc, argv);
parseCommandLine(argc, argv, mode, port, host_name, player_name, height, width);
run_crack_attack(mode, port, host_name, player_name, height, width);

View File

@ -1,20 +1,39 @@
# Template file for 'crack-attack'
pkgname=crack-attack
version=1.1.14
revision=4
revision=5
wrksrc=$pkgname-$version
create_wrksrc=yes
build_wrksrc=$wrksrc
build_style=gnu-configure
configure_args="--enable-sound=yes ac_cv_file__proc_self_maps=yes"
hostmakedepends="pkg-config"
makedepends="libXi-devel gtk+-devel glu-devel SDL_mixer-devel libfreeglut-devel libXmu-devel"
hostmakedepends="pkg-config rpmextract"
makedepends="gtk+-devel SDL_mixer-devel libfreeglut-devel glu-devel
libXmu-devel libXi-devel"
depends="desktop-file-utils"
short_desc="Tetris Attack clone"
maintainer="Christian Neukirchen <chneukirchen@gmail.com>"
license="GPL-2"
license="GPL-2,custom"
homepage="http://www.nongnu.org/crack-attack/"
distfiles="http://download.savannah.gnu.org/releases/${pkgname}/${pkgname}-${version}.tar.gz"
checksum="75ca48e5cf7d49a301d0d6a4f61bf38c2d30308a1d4f7adacdab002c549253e9"
distfiles="http://kojipkgs.fedoraproject.org/packages/${pkgname}/${version}/28.fc21/src/${pkgname}-${version}-28.fc21.src.rpm"
checksum="6fb2ad5a1dcdc590fcbeb4d1925a7e55f1af27780a5550cded280475d2c08b1d"
post_extract() {
tar xf crack-attack-${version}.tar.bz2
tar xf crack-attack-music.tar.gz
tar xf crack-attack-sounds.tar.gz
cd $build_wrksrc
cat ../*.patch | patch -p1
}
post_install() {
vinstall data/crack-attack.desktop 644 usr/share/applications
vinstall data/crack-attack.xpm 644 usr/share/pixmaps
vcopy ../music usr/share/${pkgname}
vcopy ../data/sounds usr/share/${pkgname}
vlicense ../music-sound-copyright.txt
vmkdir usr/share/applications
mv $DESTDIR/usr/share/${pkgname}/${pkgname}.desktop $DESTDIR/usr/share/applications/
vmkdir usr/share/pixmaps
cp $DESTDIR/usr/share/${pkgname}/crack-attack.xpm $DESTDIR/usr/share/pixmaps
}