summaryrefslogtreecommitdiff
path: root/games-puzzle/concentration
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /games-puzzle/concentration
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'games-puzzle/concentration')
-rw-r--r--games-puzzle/concentration/Manifest4
-rw-r--r--games-puzzle/concentration/concentration-1.2-r2.ebuild28
-rw-r--r--games-puzzle/concentration/files/concentration-1.2-gentoo.patch155
-rw-r--r--games-puzzle/concentration/metadata.xml8
4 files changed, 195 insertions, 0 deletions
diff --git a/games-puzzle/concentration/Manifest b/games-puzzle/concentration/Manifest
new file mode 100644
index 000000000000..4af5be1be537
--- /dev/null
+++ b/games-puzzle/concentration/Manifest
@@ -0,0 +1,4 @@
+AUX concentration-1.2-gentoo.patch 4615 BLAKE2B 9057a3518a3f93d4db73019e3128d00deb5b578ff6dcda11a5a05d0cae6a48b40832c1e0dd638d32aef75d70f81f9c2d75404300c261f35f3c16e9ed2115b092 SHA512 a513b43e96e6d401ea705fc9ebcfb868c4680af117551b166c20900417e977a588ab12d19ee6d7e4f58cfea1dc3799845581fb122470093b6fdba187d73689c4
+DIST concentration-1.2.tar.gz 1044563 BLAKE2B 2bd6c36be747ab16c77e5a9d01d270d82674957d3e66c07571c5dc5edbcb86aae59213992fe7a2d8ee34bbbbe8ff32157b5f5dd3125acc0ab0726e977c28c119 SHA512 afa9007cfaaa9a1cedcbfc490cb63d93d8ed1e91230ee714cece481ed3a39b73c82ec4cda65b29a27e9e71a7d2215be7f476e3217b487af54716eb4d692ca005
+EBUILD concentration-1.2-r2.ebuild 650 BLAKE2B abc116b14da1f8cb4c34ebf80f927c462336f45176ee2173c351375f25e9b1bed91a28242c138ba3af9ab3e3407fb1fd1d24111e4ac101dbd19a94365de18d8e SHA512 58296e33b985c3f77f148e32c4934c8ea923ea2ba46d65586b05bf01f486c40e76539d66f7a7e16d755af8a77215728b35b8f178ac8a890026af1a98a85b9527
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-puzzle/concentration/concentration-1.2-r2.ebuild b/games-puzzle/concentration/concentration-1.2-r2.ebuild
new file mode 100644
index 000000000000..5233b13dc8d8
--- /dev/null
+++ b/games-puzzle/concentration/concentration-1.2-r2.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop
+
+DESCRIPTION="The classic memory game with some new life"
+HOMEPAGE="https://packages.gentoo.org/package/games-puzzle/concentration"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="media-libs/libsdl[sound,video]
+ media-libs/sdl-mixer[vorbis]
+ media-libs/sdl-image[jpeg,png]
+ media-libs/sdl-ttf"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+
+src_install() {
+ default
+ newicon pics/set1/19.png ${PN}.png
+ make_desktop_entry ${PN} Concentration
+}
diff --git a/games-puzzle/concentration/files/concentration-1.2-gentoo.patch b/games-puzzle/concentration/files/concentration-1.2-gentoo.patch
new file mode 100644
index 000000000000..759d068b5bae
--- /dev/null
+++ b/games-puzzle/concentration/files/concentration-1.2-gentoo.patch
@@ -0,0 +1,155 @@
+diff -ru concentration-1.2.orig/src/ShiftyEngine.c concentration-1.2/src/ShiftyEngine.c
+--- concentration-1.2.orig/src/ShiftyEngine.c 2004-09-20 21:08:59.000000000 -0400
++++ concentration-1.2/src/ShiftyEngine.c 2010-05-18 13:39:22.717713130 -0400
+@@ -61,13 +61,13 @@
+ int len = strlen(name);
+ assert(name);
+
+- gameName = (char *)malloc((sizeof(char) * len) + 1);
++ gameName = malloc(len + 1);
+ if(!gameName) {
+ fprintf(stderr, "Out Of Memory.");
+ exit(1);
+ }
+
+- strncpy(gameName, name, len);
++ snprintf(gameName, len + 1, "%s", name);
+ }
+
+ /*****************************************************
+@@ -87,13 +87,13 @@
+ int len = strlen(name);
+ assert(name);
+
+- backgroundName = (char *)malloc((sizeof(char) * len) + 1);
++ backgroundName = malloc(len + 1);
+ if(!backgroundName) {
+ fprintf(stderr, "Out Of Memory.");
+ exit(1);
+ }
+
+- strncpy(backgroundName, name, len);
++ snprintf(backgroundName, len + 1, "%s", name);
+ }
+
+ /*****************************************************
+@@ -175,7 +175,7 @@
+ exit(1);
+ }
+
+- strncpy(t->name, name, 16);
++ snprintf(t->name, 16, "%s", name);
+ t->x = x;
+ t->y = y;
+ t->w = w;
+diff -ru concentration-1.2.orig/src/concentration.c concentration-1.2/src/concentration.c
+--- concentration-1.2.orig/src/concentration.c 2005-11-09 11:05:02.000000000 -0500
++++ concentration-1.2/src/concentration.c 2010-05-18 13:42:19.688474410 -0400
+@@ -202,7 +202,7 @@
+
+ /*****************************************************
+ ****************************************************/
+-inline void drawText(char * str, SDL_Color color, int x, int y, TTF_Font * font)
++void drawText(char * str, SDL_Color color, int x, int y, TTF_Font * font)
+ {
+ static SDL_Rect dest;
+
+@@ -814,7 +814,7 @@
+ SE_Error("A blit failed.");
+ SDL_FreeSurface(text);
+
+- sprintf(str, "%d seconds", myclock);
++ snprintf(str, sizeof(str), "%d seconds", myclock);
+ text = TTF_RenderText_Blended(smallFont, str, black);
+ if(!text)
+ SE_Error("A render failed.");
+@@ -831,7 +831,7 @@
+ SE_Error("A blit failed.");
+ SDL_FreeSurface(text);
+
+- sprintf(str, "%d trys", hits + misses);
++ snprintf(str, sizeof(str), "%d trys", hits + misses);
+ text = TTF_RenderText_Blended(smallFont, str, black);
+ if(!text)
+ SE_Error("A render failed.");
+@@ -840,7 +840,7 @@
+ SE_Error("A blit failed.");
+ SDL_FreeSurface(text);
+
+- sprintf(str, "Total pairs: %d", (size == 2) ? 2 : (size == 4) ? 8 : 36);
++ snprintf(str, sizeof(str), "Total pairs: %d", (size == 2) ? 2 : (size == 4) ? 8 : 36);
+ text = TTF_RenderText_Blended(smallFont, str, black);
+ if(!text)
+ SE_Error("A render failed.");
+@@ -1327,7 +1327,7 @@
+ {
+ int x, makeFullScreen = 0;
+
+- char name[16];
++ char name[64];
+
+ SE_SetName("Concentration 1.2");
+ SE_SetBackground("pics/background.png");
+@@ -1395,13 +1395,13 @@
+
+ /* load icon set 1 */
+ for(x = 1; x <= 30; x++) {
+- sprintf(name, "pics/set1/%d.png", x);
++ snprintf(name, sizeof(name), "pics/set1/%d.png", x);
+ icons[x] = loadPNG(name);
+
+- sprintf(name, "pics/set2/%d.png", x);
++ snprintf(name, sizeof(name), "pics/set2/%d.png", x);
+ icons2[x] = loadPNG(name);
+
+- sprintf(name, "pics/set3/%d.png", x);
++ snprintf(name, sizeof(name), "pics/set3/%d.png", x);
+ icons3[x] = loadPNG(name);
+ }
+
+diff -ru concentration-1.2.orig/src/gfx.c concentration-1.2/src/gfx.c
+--- concentration-1.2.orig/src/gfx.c 2004-09-20 21:08:59.000000000 -0400
++++ concentration-1.2/src/gfx.c 2010-05-18 13:39:22.718722669 -0400
+@@ -39,8 +39,7 @@
+ exit(1);
+ }
+
+- strcpy(newname, sg_data_path);
+- strcat(newname, name);
++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name);
+
+ temp = IMG_Load(newname);
+ if (temp == NULL) {
+@@ -67,8 +66,7 @@
+ exit(1);
+ }
+
+- strcpy(newname, sg_data_path);
+- strcat(newname, name);
++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name);
+
+ temp = IMG_Load(newname);
+ if (temp == NULL) {
+@@ -99,8 +97,7 @@
+ exit(1);
+ }
+
+- strcpy(newname, sg_data_path);
+- strcat(newname, name);
++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name);
+
+ temp = TTF_OpenFont(newname, size);
+ if (temp == NULL) {
+diff -ru concentration-1.2.orig/src/sound.c concentration-1.2/src/sound.c
+--- concentration-1.2.orig/src/sound.c 2004-09-20 21:08:59.000000000 -0400
++++ concentration-1.2/src/sound.c 2010-05-18 13:39:22.718722669 -0400
+@@ -57,8 +57,7 @@
+ fprintf(stderr, "Out of memory!\n");
+ exit(1);
+ }
+- strcpy(newname, sg_data_path);
+- strcat(newname, name);
++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name);
+
+ temp = Mix_LoadWAV(newname);
+ if(!temp)
diff --git a/games-puzzle/concentration/metadata.xml b/games-puzzle/concentration/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-puzzle/concentration/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>