games/ltris: Updated for version 2.0, new maintainer.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2024-08-25 02:27:03 -04:00 committed by Willy Sudiarto Raharjo
parent 7a4d769d64
commit 5934dacf4e
No known key found for this signature in database
GPG key ID: 3F617144D7238786
6 changed files with 58 additions and 353 deletions

View file

@ -1,3 +1,13 @@
ltris (tetris clone)
LTris as a tetris clone which means you have a bowl with blocks
falling down. By rotating and moving the blocks you try to
to assemble whole lines which then disappear.
falling down. By rotating and moving the blocks, you try to
to assemble whole lines, which then disappear.
Note: the game has been slightly patched: the default is now windowed
mode, rather than fullscreen. This is because it doesn't work properly
on multi-head systems (at least, not the SlackBuild maintainer's). If
you enable fullscreen and the program locks up your X server, press
Ctrl-Alt-Backspace to get out of X, log in again, and run "rm -rf
~/.local/share/ltris2" to restore the default settings before running
ltris again.

View file

@ -1,4 +1,9 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi

View file

@ -1,31 +1,24 @@
#!/bin/bash
# Slackware build script for LTris
# Slackware build script for ltris
# Written by Bill Kirkpatrick <bkirkp@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Written by Bill Kirkpatrick <email removed>.
# Modified and now maintained by B. Watson <urchlay@slackware.uk>.
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20240825 bkw:
# - new maintainer.
# - relicense as WTFPL.
# - update for v2.0.
# - binary in /usr/games.
# - default windowed mode, not fullscreen.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ltris
VERSION=${VERSION:-1.0.19}
SRCNAM=ltris2
VERSION=${VERSION:-2.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -38,9 +31,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -52,16 +42,12 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
@ -69,34 +55,37 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
# Fix for gcc 5
patch -p1 < $CWD/removed_all_inline_keywords.patch
# 20240825 bkw: absolute path in .desktop. This looks it might not
# really be needed in 15.0, but it doesn't hurt anything.
sed -i '/Exec/s,=,=/usr/games/,' $SRCNAM.desktop
# 20240825 bkw: Make the default windowed, not fullscreen. See
# README for explanation.
sed -i '/fullscreen *= *1;/s,1,0,' src/vconfig.cpp
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--bindir=/usr/games \
--localstatedir=/var/lib/lgames \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
make install-strip DESTDIR=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# 20240825 bkw: in case someone's used to typing "ltris"...
ln -s ltris2 $PKG/usr/games/ltris
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING Changelog README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

View file

@ -1,10 +1,10 @@
PRGNAM="ltris"
VERSION="1.0.19"
HOMEPAGE="http://lgames.sourceforge.net/index.php?project=LTris"
DOWNLOAD="http://downloads.sourceforge.net/lgames/ltris-1.0.19.tar.gz"
MD5SUM="63486b90e59699823f7093bc9ab87725"
VERSION="2.0"
HOMEPAGE="https://lgames.sourceforge.io/LTris/"
DOWNLOAD="http://downloads.sourceforge.net/lgames/ltris2-2.0.tar.gz"
MD5SUM="ec0f6779e1de9d917ee84a4e0015fde2"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Bill Kirkpatrick"
EMAIL="bkirkp@gmail.com"
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

View file

@ -1,299 +0,0 @@
Index: ltris/src/sdl.c
===================================================================
--- ltris/src/sdl.c (revision 163)
+++ ltris/src/sdl.c (revision 164)
@@ -244,7 +244,7 @@
#endif
/* return full path of bitmap */
-inline void get_full_bmp_path( char *full_path, char *file_name )
+void get_full_bmp_path( char *full_path, char *file_name )
{
sprintf(full_path, "%s/gfx/%s", SRC_DIR, file_name );
}
@@ -330,7 +330,7 @@
/*
lock surface
*/
-inline void lock_surf(SDL_Surface *sur)
+void lock_surf(SDL_Surface *sur)
{
if (SDL_MUSTLOCK(sur))
SDL_LockSurface(sur);
@@ -339,7 +339,7 @@
/*
unlock surface
*/
-inline void unlock_surf(SDL_Surface *sur)
+void unlock_surf(SDL_Surface *sur)
{
if (SDL_MUSTLOCK(sur))
SDL_UnlockSurface(sur);
@@ -666,7 +666,7 @@
/*
lock font surface
*/
-inline void lock_font(Font *fnt)
+void lock_font(Font *fnt)
{
if (SDL_MUSTLOCK(fnt->pic))
SDL_LockSurface(fnt->pic);
@@ -675,7 +675,7 @@
/*
unlock font surface
*/
-inline void unlock_font(Font *fnt)
+void unlock_font(Font *fnt)
{
if (SDL_MUSTLOCK(fnt->pic))
SDL_UnlockSurface(fnt->pic);
@@ -905,7 +905,7 @@
/*
update rectangle (0,0,0,0)->fullscreen
*/
-inline void refresh_screen(int x, int y, int w, int h)
+void refresh_screen(int x, int y, int w, int h)
{
SDL_UpdateRect(sdl.screen, x, y, w, h);
}
@@ -1055,7 +1055,7 @@
/*
lock surface
*/
-inline void lock_screen()
+void lock_screen()
{
if (SDL_MUSTLOCK(sdl.screen))
SDL_LockSurface(sdl.screen);
@@ -1064,7 +1064,7 @@
/*
unlock surface
*/
-inline void unlock_screen()
+void unlock_screen()
{
if (SDL_MUSTLOCK(sdl.screen))
SDL_UnlockSurface(sdl.screen);
@@ -1073,7 +1073,7 @@
/*
flip hardware screens (double buffer)
*/
-inline void flip_screen()
+void flip_screen()
{
SDL_Flip(sdl.screen);
}
@@ -1132,7 +1132,7 @@
/*
get milliseconds since last call
*/
-inline int get_time()
+int get_time()
{
int ms;
cur_time = SDL_GetTicks();
@@ -1148,7 +1148,7 @@
/*
reset timer
*/
-inline void reset_timer()
+void reset_timer()
{
last_time = SDL_GetTicks();
}
Index: ltris/src/sdl.h
===================================================================
--- ltris/src/sdl.h (revision 163)
+++ ltris/src/sdl.h (revision 164)
@@ -41,8 +41,8 @@
SDL_Surface* load_surf(char *fname, int f);
SDL_Surface* create_surf(int w, int h, int f);
void free_surf( SDL_Surface **surf );
-inline void lock_surf(SDL_Surface *sur);
-inline void unlock_surf(SDL_Surface *sur);
+void lock_surf(SDL_Surface *sur);
+void unlock_surf(SDL_Surface *sur);
void blit_surf(void);
void alpha_blit_surf(int alpha);
void fill_surf(int c);
@@ -86,8 +86,8 @@
Font* load_fixed_font(char *fname, int off, int len, int w);
void free_font(Font **sfnt);
int write_text(Font *sfnt, SDL_Surface *dest, int x, int y, char *str, int alpha);
-inline void lock_font(Font *sfnt);
-inline void unlock_font(Font *sfnt);
+void lock_font(Font *sfnt);
+void unlock_font(Font *sfnt);
SDL_Rect last_write_rect(Font *fnt);
int text_width(Font *fnt, char *str);
@@ -132,14 +132,14 @@
char** get_mode_names( int *count );
int set_video_mode( Video_Mode mode );
void hardware_cap();
-inline void refresh_screen( int x, int y, int w, int h );
+void refresh_screen( int x, int y, int w, int h );
void refresh_rects();
void add_refresh_rect(int x, int y, int w, int h);
int wait_for_key();
void wait_for_click();
-inline void lock_screen();
-inline void unlock_screen();
-inline void flip_screen();
+void lock_screen();
+void unlock_screen();
+void flip_screen();
void fade_screen( int type, int ms );
void take_screenshot( int i );
@@ -148,8 +148,8 @@
SDL_Cursor* create_cursor( int width, int height, int hot_x, int hot_y, char *source );
/* timer */
-inline int get_time();
-inline void reset_timer();
+int get_time();
+void reset_timer();
#ifdef __cplusplus
};
Index: ltris/src/tools.c
===================================================================
--- ltris/src/tools.c (revision 163)
+++ ltris/src/tools.c (revision 164)
@@ -23,7 +23,7 @@
#include "ltris.h"
/* compares to strings and returns true if their first strlen(str1) chars are equal */
-inline int strequal( char *str1, char *str2 )
+int strequal( char *str1, char *str2 )
{
if ( strlen( str1 ) != strlen( str2 ) ) return 0;
return ( !strncmp( str1, str2, strlen( str1 ) ) );
@@ -30,7 +30,7 @@
}
/* set delay to ms milliseconds */
-inline void delay_set( Delay *delay, int ms )
+void delay_set( Delay *delay, int ms )
{
delay->limit = ms;
delay->cur = 0;
@@ -37,13 +37,13 @@
}
/* reset delay ( cur = 0 )*/
-inline void delay_reset( Delay *delay )
+void delay_reset( Delay *delay )
{
delay->cur = 0;
}
/* check if times out and reset */
-inline int delay_timed_out( Delay *delay, int ms )
+int delay_timed_out( Delay *delay, int ms )
{
delay->cur += ms;
if ( delay->cur >= delay->limit ) {
@@ -56,12 +56,12 @@
}
/* set timer so that we have a time out next call of delay_timed_out() */
-inline void delay_force_time_out( Delay *delay )
+void delay_force_time_out( Delay *delay )
{
delay->cur = delay->limit;
}
-inline void goto_tile( int *x, int *y, int d )
+void goto_tile( int *x, int *y, int d )
{
/* 0 -up, clockwise, 5 - left up */
switch ( d ) {
@@ -326,24 +326,24 @@
the target value until reached when counter_update() is called.
====================================================================
*/
-inline void counter_set( Counter *counter, double value )
+void counter_set( Counter *counter, double value )
{
counter->value = value;
counter->approach = value;
}
-inline void counter_add( Counter *counter, double add )
+void counter_add( Counter *counter, double add )
{
counter->value += add;
}
-inline double counter_get_approach( Counter counter )
+double counter_get_approach( Counter counter )
{
return counter.approach;
}
-inline double counter_get( Counter counter )
+double counter_get( Counter counter )
{
return counter.value;
}
-inline void counter_update( Counter *counter, int ms )
+void counter_update( Counter *counter, int ms )
{
double change;
if ( counter->approach == counter->value ) return;
Index: ltris/src/bowl.c
===================================================================
--- ltris/src/bowl.c (revision 163)
+++ ltris/src/bowl.c (revision 164)
@@ -333,7 +333,7 @@
Set a tile contents and pixel contents.
====================================================================
*/
-inline void bowl_set_tile( Bowl *bowl, int x, int y, int tile_id )
+void bowl_set_tile( Bowl *bowl, int x, int y, int tile_id )
{
int i, j = y * bowl->block_size;
bowl->contents[x][y] = tile_id;
Index: ltris/src/tools.h
===================================================================
--- ltris/src/tools.h (revision 163)
+++ ltris/src/tools.h (revision 164)
@@ -33,7 +33,7 @@
#define VEC_DIST( vec1, vec2 ) ( sqrt( ( vec1.x - vec2.x ) * ( vec1.x - vec2.x ) + ( vec1.y - vec2.y ) * ( vec1.y - vec2.y ) ) )
/* compares to strings and returns true if their first strlen(str1) chars are equal */
-inline int strequal( char *str1, char *str2 );
+int strequal( char *str1, char *str2 );
/* delete lines */
void delete_lines( char **lines, int line_number );
@@ -45,16 +45,16 @@
} Delay;
/* set delay to ms milliseconds */
-inline void delay_set( Delay *delay, int ms );
+void delay_set( Delay *delay, int ms );
/* reset delay ( cur = 0 )*/
-inline void delay_reset( Delay *delay );
+void delay_reset( Delay *delay );
/* check if time's out ( add ms milliseconds )and reset */
-inline int delay_timed_out( Delay *delay, int ms );
+int delay_timed_out( Delay *delay, int ms );
/* set timer so that we have a time out next call of delay_timed_out() */
-inline void delay_force_time_out( Delay *delay );
+void delay_force_time_out( Delay *delay );
/* return distance betwteen to map positions */
int get_dist( int x1, int y1, int x2, int y2 );
Index: ltris/ChangeLog
===================================================================
--- ltris/ChangeLog (revision 163)
+++ ltris/ChangeLog (revision 164)
@@ -1,3 +1,5 @@
+- removed all inline keywords to work with GCC 5 (2015/05/16 MS)
+
1.0.19:
- removed link to lib math as not needed (2013/10/29 MS)
- reset key states when unpausing to prevent unwanted movement (2013/10/29 MS)

View file

@ -9,10 +9,10 @@
ltris: ltris (tetris clone)
ltris:
ltris: LTris as a tetris clone which means you have a bowl with blocks
ltris: falling down. By rotating and moving the blocks you try to
ltris: to assemble whole lines which then disappear.
ltris: falling down. By rotating and moving the blocks, you try to
ltris: to assemble whole lines, which then disappear.
ltris:
ltris: Homepage: http://lgames.sourceforge.net/
ltris: Homepage: https://lgames.sourceforge.io/LTris/
ltris:
ltris:
ltris: