commit:     b72fe89da02876fcaa8387754553b717c894e0ae
Author:     Samuel Bauer <samuel.bauer <AT> yahoo <DOT> fr>
AuthorDate: Thu Jun 10 19:09:09 2021 +0000
Commit:     Samuel Bauer <samuel.bauer <AT> yahoo <DOT> fr>
CommitDate: Thu Jun 10 19:09:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b72fe89d

games-puzzle/atris: new ebuild for old game

Signed-off-by: Samuel Bauer <samuel.bauer <AT> yahoo.fr>

 games-puzzle/atris/Manifest                        |   2 +
 games-puzzle/atris/atris-1.0.7.ebuild              |  59 +++++++++
 .../atris/files/atris-1.0.7-fno-common.patch       | 147 +++++++++++++++++++++
 .../files/atris-1.0.7-path-and-fullscreen.patch    |  63 +++++++++
 games-puzzle/atris/metadata.xml                    |  11 ++
 5 files changed, 282 insertions(+)

diff --git a/games-puzzle/atris/Manifest b/games-puzzle/atris/Manifest
new file mode 100644
index 000000000..dc64febe4
--- /dev/null
+++ b/games-puzzle/atris/Manifest
@@ -0,0 +1,2 @@
+DIST atris-1.0.7.tar.gz 441642 BLAKE2B 
1ab97d88ad768568b8b2a2f3d4d5229b05c4f934ab48afee1a45ccba970b72b4fcbcbbae6d05b39854a63af309a4bc186f5b90fbaec926d525a3bef31bc0bd42
 SHA512 
501632d51e5c86a13805f7501ccf2c2f6bb3e840421ac5879453a3bd2f7f9188a1a25598db0ddbad4e4ce6d747df57c1904fa84812362d5cc6597b74aadacf48
+DIST atris-sounds-1.0.1.tar.gz 653737 BLAKE2B 
1de104f86490b0fc292275ab3140e60c26e46f577fa21d45f4c50d43d3f7fa55cd99b9b54340e7aaffd35edb19f31aa3e4ac93b3204eb076679c06d57250c7b3
 SHA512 
50f056309401a1e71cebc198e44219fca39694e031400988becb08dcfb41f91916b1f22f7a2f67d332384bb77333678cb6c00e2819ee3144e8f9fd0361f8b704

diff --git a/games-puzzle/atris/atris-1.0.7.ebuild 
b/games-puzzle/atris/atris-1.0.7.ebuild
new file mode 100644
index 000000000..dc61f8b20
--- /dev/null
+++ b/games-puzzle/atris/atris-1.0.7.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit desktop
+
+DESCRIPTION="Alizarin tetris"
+HOMEPAGE="https://www.wkiri.com/projects/atris/";
+SRC_URI="http://www.gnu-darwin.org/distfiles/${P}.tar.gz
+       http://www.gnu-darwin.org/distfiles/${PN}-sounds-1.0.1.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="doc +sound"
+DEPEND="
+       acct-group/gamestat
+       media-libs/freetype
+       media-libs/libsdl
+       media-libs/sdl-ttf
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-fno-common.patch
+       "${FILESDIR}"/${P}-path-and-fullscreen.patch
+)
+
+src_install() {
+       dobin atris
+       insinto /usr/share/${PN}
+       doins -r styles graphics
+
+       if use sound; then
+               cd "${WORKDIR}"/${PN}-sounds-1.0.1
+               doins -r sounds
+               cd "${S}"
+       fi
+
+       if use doc; then
+               dodoc -a html,jpg Docs
+       fi
+       dodoc AUTHORS NEWS README
+
+       newicon icon.xpm ${PN}.xpm
+       make_desktop_entry ${PN} Atris ${PN} BlocksGame
+
+       echo "CONFIG_PROTECT=/var/games/${PN}/" > 99${PN}
+       doenvd 99${PN}
+
+       keepdir /var/games/${PN}
+       insinto /var/games/${PN}
+       doins Atris.*
+
+       fowners :gamestat /var/games/${PN}/Atris.{Players,Scores}
+       fperms 664 /var/games/${PN}/Atris.{Players,Scores}
+}

diff --git a/games-puzzle/atris/files/atris-1.0.7-fno-common.patch 
b/games-puzzle/atris/files/atris-1.0.7-fno-common.patch
new file mode 100644
index 000000000..397bffc1a
--- /dev/null
+++ b/games-puzzle/atris/files/atris-1.0.7-fno-common.patch
@@ -0,0 +1,147 @@
+diff --git a/atris.c b/atris.c
+index dbdc258..61ed4b9 100644
+--- a/atris.c
++++ b/atris.c
+@@ -48,6 +48,8 @@ static sound_style *event_ss[2];
+ static AI_Player *event_ai[2];
+ static char *event_name[2];
+ extern int Score[2];
++GT gametype;
++struct option_struct Options;
+ 
+ /***************************************************************************
+  *      Panic()
+diff --git a/atris.h b/atris.h
+index 4dc4d5b..19cc456 100644
+--- a/atris.h
++++ b/atris.h
+@@ -67,7 +67,7 @@ typedef enum {
+     QUIT              =6,
+     DEMO              =7
+ } GT;
+-GT gametype;
++extern GT gametype;
+ 
+ #ifndef min
+ #define min(a,b)      ((a)<(b)?(a):(b))
+diff --git a/display.c b/display.c
+index cbbca0d..f63f5cf 100644
+--- a/display.c
++++ b/display.c
+@@ -14,6 +14,25 @@
+ 
+ #include "xflame.pro"
+ 
++SDL_Color color_white;
++SDL_Color color_black;
++SDL_Color color_red;
++SDL_Color color_blue;
++SDL_Color color_purple;
++
++Uint32        int_black;
++Uint32  int_white;
++Uint32        int_grey;
++Uint32        int_blue;
++Uint32        int_med_blue;
++Uint32        int_dark_blue;
++Uint32        int_purple;
++Uint32  int_dark_purple;
++Uint32  int_solid_black;
++
++SDL_Surface *screen, *widget_layer, *flame_layer;
++TTF_Font *font, *sfont, *lfont, *hfont;       /* normal, small , large, huge 
font */
++
+ struct layout_struct {
+     /* the whole board layout */
+     SDL_Rect grid_border[2];
+diff --git a/display.h b/display.h
+index db4d68a..6d71b9d 100644
+--- a/display.h
++++ b/display.h
+@@ -9,24 +9,24 @@
+ 
+ #include "SDL/SDL_ttf.h"
+ 
+-SDL_Color color_white;
+-SDL_Color color_black;
+-SDL_Color color_red;
+-SDL_Color color_blue;
+-SDL_Color color_purple;
++extern SDL_Color color_white;
++extern SDL_Color color_black;
++extern SDL_Color color_red;
++extern SDL_Color color_blue;
++extern SDL_Color color_purple;
+ 
+-Uint32        int_black;
+-Uint32  int_white;
+-Uint32        int_grey;
+-Uint32        int_blue;
+-Uint32        int_med_blue;
+-Uint32        int_dark_blue;
+-Uint32        int_purple;
+-Uint32  int_dark_purple;
+-Uint32  int_solid_black;
++extern Uint32 int_black;
++extern Uint32  int_white;
++extern Uint32 int_grey;
++extern Uint32 int_blue;
++extern Uint32         int_med_blue;
++extern Uint32         int_dark_blue;
++extern Uint32 int_purple;
++extern Uint32  int_dark_purple;
++extern Uint32  int_solid_black;
+ 
+-SDL_Surface *screen, *widget_layer, *flame_layer;
+-TTF_Font *font, *sfont, *lfont, *hfont;       /* normal, small , large, huge 
font */
++extern SDL_Surface *screen, *widget_layer, *flame_layer;
++extern TTF_Font *font, *sfont, *lfont, *hfont;        /* normal, small , 
large, huge font */
+ 
+ #define int_border_color      int_grey
+ #define int_button_face1      int_dark_blue
+diff --git a/options.h b/options.h
+index 575fc1a..cf38b40 100644
+--- a/options.h
++++ b/options.h
+@@ -25,6 +25,7 @@ struct option_struct {
+     int named_sound;
+     int named_piece;
+     int named_game;
+-} Options;
++};
++extern struct option_struct Options;
+ 
+ #endif
+diff --git a/piece.c b/piece.c
+index 4c08eaf..6944165 100644
+--- a/piece.c
++++ b/piece.c
+@@ -33,6 +33,9 @@
+ #include "piece.h"
+ #include "options.h"
+ 
++color_style special_style;
++SDL_Surface *edge[4]; /* hikari to kage */
++
+ /***************************************************************************
+  *      load_piece_style()
+  * Load a piece style from the given file.
+diff --git a/piece.h b/piece.h
+index bc4226c..a47abbe 100644
+--- a/piece.h
++++ b/piece.h
+@@ -67,13 +67,11 @@ typedef struct color_style_struct {
+     int h;                    /* height of each color block */
+ } color_style;
+ 
+-color_style special_style;
+-
+ #define HORIZ_LIGHT   0
+ #define VERT_LIGHT    1
+ #define HORIZ_DARK    2
+ #define VERT_DARK     3
+-SDL_Surface *edge[4]; /* hikari to kage */
++extern SDL_Surface *edge[4];  /* hikari to kage */
+ 
+ /* this structure holds all of the color styles we have been able to load
+  * for this game */

diff --git a/games-puzzle/atris/files/atris-1.0.7-path-and-fullscreen.patch 
b/games-puzzle/atris/files/atris-1.0.7-path-and-fullscreen.patch
new file mode 100644
index 000000000..b5fabe6d1
--- /dev/null
+++ b/games-puzzle/atris/files/atris-1.0.7-path-and-fullscreen.patch
@@ -0,0 +1,63 @@
+diff --git a/atris.c b/atris.c
+index a621e22..234b05f 100644
+--- a/atris.c
++++ b/atris.c
+@@ -947,7 +947,6 @@ main(int argc, char *argv[])
+     /* Initialize the display in a 640x480 native-depth mode */
+     flags = // SDL_HWSURFACE |  
+             SDL_SWSURFACE | 
+-          SDL_FULLSCREEN | 
+             // SDL_SRCCOLORKEY | 
+             // SDL_ANYFORMAT |
+             0; 
+diff --git a/configure b/configure
+index 9411dd5..7d3af0c 100755
+--- a/configure
++++ b/configure
+@@ -6044,7 +6044,7 @@ case "$target" in
+       CFLAGS="$CFLAGS -s"
+       ;;
+     *)
+-      GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
++      GAME_INSTALLDIR="/usr/share/atris"
+       ;;
+ esac
+ 
+diff --git a/highscore.c b/highscore.c
+index 003e8f4..28c069d 100644
+--- a/highscore.c
++++ b/highscore.c
+@@ -59,9 +59,9 @@ save_high_scores()
+     if (!loaded) 
+       return;
+ 
+-    fout = fopen("Atris.Scores","wt");
++    fout = fopen("/var/games/atris/Atris.Scores","wt");
+     if (!fout) {
+-      Debug("Unable to write High Score file [Atris.Scores]: %s\n", 
strerror(errno));
++      Debug("Unable to write High Score file [/var/games/atris/Atris.Scores]: 
%s\n", strerror(errno));
+       return;
+     }
+ 
+@@ -94,7 +94,7 @@ load_high_scores()
+       loaded = TRUE;
+     }
+ 
+-    fin = fopen("Atris.Scores", "r");
++    fin = fopen("/var/games/atris/Atris.Scores", "r");
+     if (fin) {
+ 
+       for (i=0; !feof(fin) && i < NUM_HIGH_SCORES; i++) {
+diff --git a/identity.c b/identity.c
+index 941ab57..f3dc160 100644
+--- a/identity.c
++++ b/identity.c
+@@ -17,7 +17,7 @@
+ #include "xflame.pro"
+ #include "display.pro"
+ 
+-#define ID_FILENAME   "Atris.Players"
++#define ID_FILENAME   "/var/games/atris/Atris.Players"
+ 
+ /***************************************************************************
+  *      input_string()

diff --git a/games-puzzle/atris/metadata.xml b/games-puzzle/atris/metadata.xml
new file mode 100644
index 000000000..68c4ef50a
--- /dev/null
+++ b/games-puzzle/atris/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<maintainer type="person">
+       <name>mazes-80</name>
+       <email>mazes...@none.org</email>
+</maintainer>
+<use>
+       <flag name="sound">Enable atris sound pack</flag>
+</use>
+</pkgmetadata>

Reply via email to