diff options
author | Eric Hameleers <alien@slackware.com> | 2006-10-09 13:54:48 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2006-10-09 13:54:48 +0000 |
commit | 21bf5c9a956c66b4c415ae0630145b08c7e92326 (patch) | |
tree | 9b2f055bdcd2ca50cf4633397d9cf0b6d1d42757 /frozen-bubble/build | |
parent | 6fa30e1b529affbe9ce7f79a830987a20682cab1 (diff) | |
download | asb-21bf5c9a956c66b4c415ae0630145b08c7e92326.tar.gz asb-21bf5c9a956c66b4c415ae0630145b08c7e92326.tar.xz |
Initial revision
Diffstat (limited to 'frozen-bubble/build')
-rw-r--r-- | frozen-bubble/build/frozen-bubble-editor-sdl_perl.patch | 63 | ||||
-rw-r--r-- | frozen-bubble/build/frozen-bubble-makefile.patch | 21 | ||||
-rw-r--r-- | frozen-bubble/build/frozen-bubble-sdl_perl.patch | 125 | ||||
-rwxr-xr-x | frozen-bubble/build/frozen-bubble.SlackBuild | 115 | ||||
-rw-r--r-- | frozen-bubble/build/frozen-bubble.desktop | 8 | ||||
-rw-r--r-- | frozen-bubble/build/slack-desc | 20 |
6 files changed, 352 insertions, 0 deletions
diff --git a/frozen-bubble/build/frozen-bubble-editor-sdl_perl.patch b/frozen-bubble/build/frozen-bubble-editor-sdl_perl.patch new file mode 100644 index 00000000..5532feaf --- /dev/null +++ b/frozen-bubble/build/frozen-bubble-editor-sdl_perl.patch @@ -0,0 +1,63 @@ +Based on upstream patch: +http://www.frozen-bubble.org/perl-SDL.patch + +This version of the patch works with both sdl-perl-1.x and sdl-perl-2.x + +--- c_stuff/lib/FBLE.pm ++++ c_stuff/lib/FBLE.pm +@@ -86,6 +86,25 @@ + + #- ----------- bubbles processing/drawing ----------------------------------------- + ++sub surf { ++ my ($surface) = @_; ++ if (ref($surface) eq 'HASH') { ++ return $surface->{-surface}; ++ } else { ++ return $$surface; ++ } ++} ++ ++sub rect { ++ my ($rect) = @_; ++ if (ref($rect) eq 'HASH') { ++ return $rect->{-rect}; ++ } else { ++ return $$rect; ++ } ++} ++ ++ + # subroutine to calculate the left corner x of the given bubble option column (based on 0 start) + sub bubble_optionx { + my ($col) = @_; +@@ -1094,11 +1113,11 @@ + $rect{screenshot} = SDL::Rect->new(-x => $POS_1P{p1}{left_limit} - 40, '-y' => 0, + -width => $POS_1P{p1}{right_limit} - $POS_1P{p1}{left_limit} + 80, + -height => $POS_1P{bottom_limit} - $POS_1P{init_top_limit} + 190); +- fb_c_stuff::shrink($app->{-surface}, +- $file_browser_screenshots[$list_browser_highlight_offset]->display_format()->{-surface}, ++ fb_c_stuff::shrink(surf($app), ++ surf($file_browser_screenshots[$list_browser_highlight_offset]->display_format()), + $rect{middle}->x + $rect{middle}->width - $rect{screenshot}->width/4 - 12, + $rect{middle}->y + $rect{middle}->height/2 - $rect{screenshot}->height/8 - 3, +- $rect{screenshot}{-rect}, 4); ++ rect($rect{screenshot}), 4); + } + + +@@ -1366,6 +1366,14 @@ + print_dialog_list_arrow($do_highlight, 'up'); + } + ++sub SDL_TEXTWIDTH { ++ if (defined(&SDL::App::SDL_TEXTWIDTH)) { ++ SDL::App::SDL_TEXTWIDTH(@_); # perl-sdl-1.x ++ } else { ++ SDL::SFont::SDL_TEXTWIDTH(@_); # perl-sdl-2.x ++ } ++} ++ + # subroutine to print out the levelset name at the top of the screen + sub print_levelset_name { + $rect{ls_name_erase} = SDL::Rect->new(-x => 195, '-y' => 0, -width => 445-195, -height => 35); diff --git a/frozen-bubble/build/frozen-bubble-makefile.patch b/frozen-bubble/build/frozen-bubble-makefile.patch new file mode 100644 index 00000000..88292a2b --- /dev/null +++ b/frozen-bubble/build/frozen-bubble-makefile.patch @@ -0,0 +1,21 @@ +Update the perl-SDL check to accept 2.x versions. + +Make sure we update the DATADIR stuff before building in +subdirs otherwise the lib file gets copied to blib first +and the final binary isn't fixed up properly. + +--- Makefile ++++ Makefile +@@ -11,6 +11,3 @@ + @if ! perl -e 'use SDL'; then echo -e "\n *** I need perl-SDL installed"; false; fi +- @if ! perl -e 'use SDL; ($$mj, $$mn, $$mc) = split /\./, $$SDL::VERSION; exit 1 if $$mj<1 || $$mn<19'; then echo -e "\n *** I need perl-SDL version 1.19.0 or upper"; false; fi ++ @if ! perl -e 'use SDL; ($$mj, $$mn, $$mc) = split /\./, $$SDL::VERSION; exit 1 if $$mj<1 || ($$mj==1 && $$mn<19)'; then echo -e "\n *** I need perl-SDL version 1.19.0 or upper"; false; fi +- @for n in . $(DIRS); do \ +- [ "$$n" = "." ] || $(MAKE) -C $$n ;\ +- done + @if [ ! -d save_virgin ]; then mkdir save_virgin; cp c_stuff/lib/fb_stuff.pm save_virgin; fi +@@ -18,2 +15,5 @@ + perl -pi -e 's|\@DATADIR\@|$(DATADIR)|' c_stuff/lib/fb_stuff.pm ++ @for n in . $(DIRS); do \ ++ [ "$$n" = "." ] || $(MAKE) -C $$n ;\ ++ done diff --git a/frozen-bubble/build/frozen-bubble-sdl_perl.patch b/frozen-bubble/build/frozen-bubble-sdl_perl.patch new file mode 100644 index 00000000..be3afe4d --- /dev/null +++ b/frozen-bubble/build/frozen-bubble-sdl_perl.patch @@ -0,0 +1,125 @@ +Based on upstream patch: +http://www.frozen-bubble.org/perl-SDL.patch + +This version of the patch works with both sdl-perl-1.x and sdl-perl-2.x + +--- frozen-bubble ++++ frozen-bubble +@@ -90,3 +90,4 @@ + + $version = '1.0.0'; ++$SDL_VER = substr($SDL::VERSION, 0, 1); # Extract sdl-perl's major num + +@@ -161,6 +161,19 @@ + + #- ----------- sound related stuff ---------------------------------------- + ++sub get_sound { ++ my ($sound) = @_; ++ if ($SDL_VER eq 1) { ++ if (ref($sound) eq 'SDL::Sound') { ++ return $sound{$_}{-data}; ++ } else { ++ return $sound->{-data}; ++ } ++ } else { ++ return $$sound; ++ } ++} ++ + sub play_sound($) { + $mixer_enabled && $mixer && !$sfx_disabled && $sound{$_[0]} and $mixer->play_channel(-1, $sound{$_[0]}, 0); + } +@@ -179,7 +188,7 @@ + $elem or return -1; + -f $elem or return 0; + $mus = SDL::Music->new($elem); +- if ($mus->{-data}) { ++ if (get_sound($mus)) { + print STDERR "[Playlist] playing `$elem'\n"; + $mixer->play_music($mus, 0); + return 1; +@@ -191,9 +200,9 @@ + while ($tryanother->() == 0) {}; + } else { + $mus = SDL::Music->new("$FPATH$musics{$name}"); +- $mus->{-data} or print STDERR "Warning, could not create new music from `$FPATH$musics{$name}' (reason: ", $app->error, ").\n"; ++ get_sound($mus) or print STDERR "Warning, could not create new music from `$FPATH$musics{$name}' (reason: ", $app->error, ").\n"; + if ($pos) { +- fb_c_stuff::fade_in_music_position($mus->{-data}, -1, 500, $pos); ++ fb_c_stuff::fade_in_music_position(get_sound($mus), -1, 500, $pos); + } else { + $mixer->play_music($mus, -1); + } +@@ -212,7 +221,7 @@ + foreach (@sounds) { + my $sound_path = "$FPATH/snd/$_.wav"; + $sound{$_} = SDL::Sound->new($sound_path); +- if ($sound{$_}{-data}) { ++ if (get_sound($sound{$_})) { + $sound{$_}->volume(80); + } else { + print STDERR "Warning, could not create new sound from `$sound_path'.\n"; +@@ -233,6 +233,14 @@ + + #- ----------- graphics related stuff -------------------------------------- + ++sub SDL_TEXTWIDTH { ++ if (defined(&SDL::App::SDL_TEXTWIDTH)) { ++ SDL::App::SDL_TEXTWIDTH(@_); # perl-sdl-1.x ++ } else { ++ SDL::SFont::SDL_TEXTWIDTH(@_); # perl-sdl-2.x ++ } ++} ++ + sub add_default_rect($) { + my ($surface) = @_; + $rects{$surface} = SDL::Rect->new(-width => $surface->width, -height => $surface->height); +@@ -304,10 +304,28 @@ + return $save; + } + ++sub surf { ++ my ($surface) = @_; ++ if (ref($surface) eq 'HASH') { ++ return $surface->{-surface}; ++ } else { ++ return $$surface; ++ } ++} ++ ++sub rect { ++ my ($rect) = @_; ++ if (ref($rect) eq 'HASH') { ++ return $rect->{-rect}; ++ } else { ++ return $$rect; ++ } ++} ++ + sub add_image($) { + my $file = "$FPATH/gfx/$_[0]"; + my $img = SDL::Surface->new(-name => $file); +- $img->{-surface} or die "FATAL: Couldn't load `$file' into a SDL::Surface.\n"; ++ surf($img) or die "FATAL: Couldn't load `$file' into a SDL::Surface.\n"; + add_default_rect($img); + return $img; + } +@@ -1473,7 +1491,7 @@ + } + + put_image($imgbin{hiscore_frame}, $high_posx - 7, $high_posy - 6); +- fb_c_stuff::shrink($app->{-surface}, $background->display_format->{-surface}, $high_posx, $high_posy, $high_rect->{-rect}, 4); ++ fb_c_stuff::shrink(surf($app), surf($background->display_format), $high_posx, $high_posy, rect($high_rect), 4); + $centered_print->($high_posx, $high_posy, $high->{name}); + $centered_print->($high_posx, $high_posy+20, $high->{level} eq 'WON' ? "WON!" : "LVL-".$high->{level}); + my $min = int($high->{time}/60); +@@ -1642,7 +1660,7 @@ + $background->blit($apprects{main}, $app, $apprects{main}); + $app->flip; + } else { +- fb_c_stuff::effect($app->{-surface}, $background->display_format->{-surface}); ++ fb_c_stuff::effect(surf($app), surf($background->display_format)); + } + + $display_on_app_disabled = 0; diff --git a/frozen-bubble/build/frozen-bubble.SlackBuild b/frozen-bubble/build/frozen-bubble.SlackBuild new file mode 100755 index 00000000..5cc68864 --- /dev/null +++ b/frozen-bubble/build/frozen-bubble.SlackBuild @@ -0,0 +1,115 @@ +#!/bin/sh +# $Id$ +# Copyright (c) 2006 Eric Hameleers <alien@slackware.com> +# ----------------------------------------------------------------------------- +# +# Slackware SlackBuild script +# =========================== +# By: Eric Hameleers <alien@slackware.com> +# For: Frozen Bubble +# Descr: Colorful Game +# URL: http://www.frozen-bubble.org +# Needs: SDL_perl >= 1.19.2 +# Changelog: +# 1.0.0-1: 09/oct/2006 by Eric Hameleers <alien@slackware.com> +# * Initial build. +# +# Run 'sh SlackBuild --cleanup' to build a Slackware package. +# The package (.tgz) plus descriptive .txt file are created in /tmp . +# Install using 'installpkg'. +# +# ----------------------------------------------------------------------------- + +CWD=`pwd` + +PRGNAM=frozen-bubble +VERSION=1.0.0 +ARCH=${ARCH:-i486} +BUILD=1 + +if ["$TMP" = ""]; then + TMP=/tmp +fi +PKG=$TMP/package-$PRGNAM + +DOCS="AUTHORS CHANGES COPYING INSTALL README $CWD/$PRGNAM.SlackBuild" + +if [ ! -d $TMP ]; then + mkdir -p $TMP +fi +if [ ! -d $PKG ]; then + mkdir -p $PKG +fi + +echo "++" +echo "|| Building $PRGNAM-$VERSION" +echo "++" + +cd $TMP +tar -jxvf $CWD/$PRGNAM-$VERSION.tar.bz2 + +cd $PRGNAM-$VERSION +# Make it work with SDL_perl 1.19 as well as 2.x +patch -p0 < $CWD/${PRGNAM}-makefile.patch 2>&1 | tee $TMP/patch-$PRGNAM.log +patch -p0 < $CWD/${PRGNAM}-sdl_perl.patch 2>&1 | tee -a $TMP/patch-$PRGNAM.log +patch -p0 < $CWD/${PRGNAM}-editor-sdl_perl.patch 2>&1 | tee -a $TMP/patch-$PRGNAM.log +sed -i -e 's#INSTALLDIRS=.*#PREFIX=${PKG}/usr#' c_stuff/Makefile \ + 2>&1 | tee -a $TMP/patch-$PRGNAM.log + +chown -R root:root . + +make \ + PREFIX=/usr \ + BINDIR=/usr/games \ + DATADIR=/usr/share/games \ + MANDIR=/usr/man \ + 2>&1 | tee $TMP/make-$PRGNAM.log + +mkdir -p $PKG/usr/{games,man,share} +make install \ + PREFIX=$PKG/usr \ + BINDIR=$PKG/usr/games \ + DATADIR=$PKG/usr/share/games \ + MANDIR=$PKG/usr/man \ + 2>&1 | tee $TMP/install-$PRGNAM.log + +# Remove 'special' files +find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" \ + | xargs rm -f +# No empty directories +find $PKG -type d -depth -exec rmdir {} \; + +mkdir -p $PKG/usr/share/applications +cp -a $CWD/${PRGNAM}.desktop $PKG/usr/share/applications/ + +mkdir -p $PKG/usr/share/icons/hicolor/16x16 +cp -a $TMP/$PRGNAM-$VERSION/icons/${PRGNAM}-icon-16x16.png $PKG/usr/share/icons/hicolor/16x16/${PRGNAM}.png + +mkdir -p $PKG/usr/share/icons/hicolor/32x32 +cp -a $TMP/$PRGNAM-$VERSION/icons/${PRGNAM}-icon-32x32.png $PKG/usr/share/icons/hicolor/32x32/${PRGNAM}.png + +mkdir -p $PKG/usr/share/icons/hicolor/48x48 +cp -a $TMP/$PRGNAM-$VERSION/icons/${PRGNAM}-icon-48x48.png $PKG/usr/share/icons/hicolor/48x48/${PRGNAM}.png + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION/ +chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +[ -d $PKG/usr/man ] && \ + find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; + +chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION + +cd $PKG +makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz +( + cd $TMP && md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5 +) + +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP/$PRGNAM-$VERSION + rm -rf $PKG +fi diff --git a/frozen-bubble/build/frozen-bubble.desktop b/frozen-bubble/build/frozen-bubble.desktop new file mode 100644 index 00000000..bf80f312 --- /dev/null +++ b/frozen-bubble/build/frozen-bubble.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Frozen Bubble +GenericName=Shooting Bubble Game +Exec=frozen-bubble +Icon=/usr/share/icons/hicolor/32x32/frozen-bubble.png +Type=Application +Categories=Application;Game;ArcadeGame diff --git a/frozen-bubble/build/slack-desc b/frozen-bubble/build/slack-desc new file mode 100644 index 00000000..eb133beb --- /dev/null +++ b/frozen-bubble/build/slack-desc @@ -0,0 +1,20 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------| +frozen-bubble: Frozen-Bubble (a colourful game) +frozen-bubble: +frozen-bubble: Full-featured, colorful animated penguin eyecandy, 100 levels +frozen-bubble: of single player fun, hours and hours of multiplayer. +frozen-bubble: +frozen-bubble: +frozen-bubble: +frozen-bubble: +frozen-bubble: frozen-bubble home: http://www.frozen-bubble.org +frozen-bubble: +frozen-bubble: + |