From b3759489337edaa75e1d2733f58c7b6ce426512d Mon Sep 17 00:00:00 2001 From: Ypnose Date: Wed, 9 Jul 2014 00:27:15 +0200 Subject: [PATCH] crack-attack: rework the entire template. It's much more cleaner The music should be included in another pkg. And we need to fix cross-compilation. (It's required to fix the guys from this project too...) --- .../crack-attack-1.1.14-audio-ppc.patch | 12 ++++++ .../patches/crack-attack-1.1.14-audio.patch | 37 +++++++++++++++++ .../patches/crack-attack-1.1.14-gcc43.patch | 11 +++++ .../crack-attack-1.1.14-glutInit.patch | 11 +++++ srcpkgs/crack-attack/template | 41 ++++--------------- 5 files changed, 80 insertions(+), 32 deletions(-) create mode 100644 srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio-ppc.patch create mode 100644 srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio.patch create mode 100644 srcpkgs/crack-attack/patches/crack-attack-1.1.14-gcc43.patch create mode 100644 srcpkgs/crack-attack/patches/crack-attack-1.1.14-glutInit.patch diff --git a/srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio-ppc.patch b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio-ppc.patch new file mode 100644 index 00000000000..93a31f0b799 --- /dev/null +++ b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio-ppc.patch @@ -0,0 +1,12 @@ +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 ) diff --git a/srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio.patch b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio.patch new file mode 100644 index 00000000000..7235cc80efa --- /dev/null +++ b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-audio.patch @@ -0,0 +1,37 @@ +--- 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 + + #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; + } diff --git a/srcpkgs/crack-attack/patches/crack-attack-1.1.14-gcc43.patch b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-gcc43.patch new file mode 100644 index 00000000000..969e1b3f0ab --- /dev/null +++ b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-gcc43.patch @@ -0,0 +1,11 @@ +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 ++#include + + #include "glext.h" + #include "sstream.h" diff --git a/srcpkgs/crack-attack/patches/crack-attack-1.1.14-glutInit.patch b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-glutInit.patch new file mode 100644 index 00000000000..e55450a5768 --- /dev/null +++ b/srcpkgs/crack-attack/patches/crack-attack-1.1.14-glutInit.patch @@ -0,0 +1,11 @@ +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); + diff --git a/srcpkgs/crack-attack/template b/srcpkgs/crack-attack/template index 93433f3739c..48856ae2571 100644 --- a/srcpkgs/crack-attack/template +++ b/srcpkgs/crack-attack/template @@ -1,44 +1,21 @@ # Template file for 'crack-attack' pkgname=crack-attack version=1.1.14 -revision=1 -wrksrc=$pkgname-$version -create_wrksrc=yes -build_wrksrc=$wrksrc -#only_for_archs="i686 x86_64" +revision=2 build_style=gnu-configure configure_args="--enable-sound=yes" -#make_build_args="" -#make_install_args="" -#conf_files="" -#make_dirs="/var/log/sa 0755 root root" -hostmakedepends="pkg-config rpmextract - gtk+-devel SDL_mixer-devel libfreeglut-devel libXmu-devel" -makedepends="" -depends="" +hostmakedepends="pkg-config" +makedepends="gtk+-devel SDL_mixer-devel libfreeglut-devel libXmu-devel libGL + atk-devel gdk-pixbuf-devel libstdc++-devel SDL-devel" +only_for_archs="x86_64" short_desc="Tetris Attack clone" maintainer="Christian Neukirchen " license="GPL-2" homepage="http://www.nongnu.org/crack-attack/" -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-1.1.14.tar.bz2 - tar xf crack-attack-music.tar.gz - tar xf crack-attack-sounds.tar.gz - - cd $build_wrksrc - cat ../*.patch | patch -p1 -} +distfiles="http://download.savannah.gnu.org/releases/${pkgname}/${pkgname}-${version}.tar.gz" +checksum="75ca48e5cf7d49a301d0d6a4f61bf38c2d30308a1d4f7adacdab002c549253e9" post_install() { - 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 + vinstall data/crack-attack.desktop 644 usr/share/applications + vinstall data/crack-attack.xpm 644 usr/share/pixmaps }