From e1ea50212b57c7c82e455548ea70fa2455259658 Mon Sep 17 00:00:00 2001 From: Erik Hanson Date: Wed, 12 May 2010 23:29:18 +0200 Subject: [PATCH] games/einstein: Added to 12.2 repository --- games/einstein/README | 4 + games/einstein/doinst.sh | 3 + games/einstein/einstein.SlackBuild | 62 +++++++++++++++ games/einstein/einstein.desktop | 10 +++ games/einstein/einstein.info | 8 ++ games/einstein/einstein.png | Bin 0 -> 914 bytes games/einstein/patches/01_sdl.diff | 108 ++++++++++++++++++++++++++ games/einstein/patches/02_prefix.diff | 11 +++ games/einstein/patches/06_srand.diff | 11 +++ games/einstein/patches/07_long.diff | 31 ++++++++ games/einstein/patches/09_colors.diff | 22 ++++++ games/einstein/slack-desc | 19 +++++ 12 files changed, 289 insertions(+) create mode 100644 games/einstein/README create mode 100644 games/einstein/doinst.sh create mode 100644 games/einstein/einstein.SlackBuild create mode 100644 games/einstein/einstein.desktop create mode 100644 games/einstein/einstein.info create mode 100644 games/einstein/einstein.png create mode 100644 games/einstein/patches/01_sdl.diff create mode 100644 games/einstein/patches/02_prefix.diff create mode 100644 games/einstein/patches/06_srand.diff create mode 100644 games/einstein/patches/07_long.diff create mode 100644 games/einstein/patches/09_colors.diff create mode 100644 games/einstein/slack-desc diff --git a/games/einstein/README b/games/einstein/README new file mode 100644 index 0000000000..c5e89afb57 --- /dev/null +++ b/games/einstein/README @@ -0,0 +1,4 @@ +Einstein puzzle is a free cross-platform open source remake of old +DOS game Sherlock which was inspired by Albert Einstein's puzzle. +Einstein said that only those with an intelligence quotient of 98 +percentile and higher should be able to solve it. diff --git a/games/einstein/doinst.sh b/games/einstein/doinst.sh new file mode 100644 index 0000000000..3857649f50 --- /dev/null +++ b/games/einstein/doinst.sh @@ -0,0 +1,3 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications &> /dev/null +fi diff --git a/games/einstein/einstein.SlackBuild b/games/einstein/einstein.SlackBuild new file mode 100644 index 0000000000..b3a53e319d --- /dev/null +++ b/games/einstein/einstein.SlackBuild @@ -0,0 +1,62 @@ +#!/bin/sh + +# Slackware build script for einstein +# Written by Erik Hanson erik@slackbuilds.org + +PRGNAM=einstein +VERSION=2.0 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +fi + +set -eu + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION-src.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Some patches from debian. +for PATCH in $CWD/patches/*.diff ; do + patch -p0 < $PATCH +done + +# Build +make PREFIX="/usr" OPTIMIZE="$SLKCFLAGS" + +# Install +install -D -s -m 0755 einstein $PKG/usr/games/einstein +install -D einstein.res $PKG/usr/share/einstein/res/einstein.res +install -D $CWD/einstein.desktop $PKG/usr/share/applications/einstein.desktop +install -D $CWD/einstein.png $PKG/usr/share/pixmaps/einstein.png + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README $CWD/patches $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/games/einstein/einstein.desktop b/games/einstein/einstein.desktop new file mode 100644 index 0000000000..6352d18bcf --- /dev/null +++ b/games/einstein/einstein.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=Einstein +Comment="Puzzle game inspired by Einstein's puzzle" +Exec=einstein +Icon=einstein +Terminal=false +Type=Application +Categories=Game;LogicGame; +StartupNotify=false diff --git a/games/einstein/einstein.info b/games/einstein/einstein.info new file mode 100644 index 0000000000..70c44e12ae --- /dev/null +++ b/games/einstein/einstein.info @@ -0,0 +1,8 @@ +PRGNAM="einstein" +VERSION="2.0" +HOMEPAGE="http://games.flowix.com/en/index.html" +DOWNLOAD="http://games.flowix.com/files/einstein/einstein-2.0-src.tar.gz" +MD5SUM="c1d98e761c10af63f03462ead625f80c" +MAINTAINER="Erik Hanson" +EMAIL="erik@slackbuilds.org" +APPROVED="rworkman" diff --git a/games/einstein/einstein.png b/games/einstein/einstein.png new file mode 100644 index 0000000000000000000000000000000000000000..529c8195673e5786243a3ce2b16e993eb6786ce9 GIT binary patch literal 914 zcmV;D18w|?P)cL_t(o!|j$`XjDfO$A5S3?q)Zd zL|5G;TD4M%8VSZgiXZVSRv(H~T_2*pYlV;&>XVTWCE$bjkcYM}Nee=${qPeCB1()O zSX$bR(Gm@6qNqh}SVMxwJK1~3hr7FGz1iz-)TibT!!Yx|Gv|NKxifQM9OL-EL(6tS z=w`nXhJ|jJ2pR83jJs>*WW8rbD7+q3pWZ#A{(81py|8o@Q>1N=pG{Hk)OgYLsQS3) zZ}l{m=W007+Ag3x6EhPbGBIxY1P#GP^7O%s1h=+8PQi4R)JNVZ!c{=gHQRW|e9XH1 z(wa znas>Dza~1Pj9tefR2*rdr{fMW@+d4>kB}z1v>20s(9M3O#T2@AWBw(~F3oj8C>-ROfzNsbwX=Hg0e5QO<1#f8i3KHxckP zB!Ku1g1z89or-xJb8 z7-JAHa)YVfJ~F|#-@xP#Dqo3@M^H#J?V7YHu)VN12*Q$ zhHzZGiEdcQXk;%S9y(!I_=I%utu3%?Clt)8WWo<~8GLY+f}$LPlNP>~0@F1GX$2&_ z*QJT3Igj#ptq@wYnUd;y`$tQJ{PjLAB(0;Fq`-*z9sKYx6fgKJdDfF5mm|DSrobG7 zfJ6$U#ek9T;Fm22Vd+Vuel^6Nx<(Eis7(?7rWB+V(7knzmUwRa2B$grefy!T_#{5l zpk#U%2OGX%MO8cV7j!W=ydx=INQG`|U9aLqDDOvSv#|J|6fPKq@0*VU#~tg! zHTO8te1ni@uB-R15di3{ov-QAqO*4~*`Q`C-2Lw~LRuW@4ZnSXvS#09)$?$YYYp(+ zK;7;|{q!rUdM(N;a^G!Hvh?%w%AZ%PfV53RR{_ryRTL;!Rl(gE3CKD;>$Y7~qt$|m o@h@E)-%m|Aj&Zy%yab;*=|pM45WWBa002ovPDHLkV1fWsgu>3P@c;k- literal 0 HcmV?d00001 diff --git a/games/einstein/patches/01_sdl.diff b/games/einstein/patches/01_sdl.diff new file mode 100644 index 0000000000..480a1a519d --- /dev/null +++ b/games/einstein/patches/01_sdl.diff @@ -0,0 +1,108 @@ +diff -ruN ../orig/einstein-2.0.dfsg.2/font.h ./font.h +--- ../orig/einstein-2.0.dfsg.2/font.h 2005-08-16 00:33:17.000000000 +0200 ++++ ./font.h 2007-08-31 10:00:33.000000000 +0200 +@@ -3,7 +3,7 @@ + + + #include +-#include ++#include + + + class Font +diff -ruN ../orig/einstein-2.0.dfsg.2/iconset.h ./iconset.h +--- ../orig/einstein-2.0.dfsg.2/iconset.h 2005-08-14 04:40:58.000000000 +0200 ++++ ./iconset.h 2007-08-31 09:51:37.000000000 +0200 +@@ -2,7 +2,7 @@ + #define __ICONSET_H__ + + +-#include ++#include + + + class IconSet +diff -ruN ../orig/einstein-2.0.dfsg.2/main.cpp ./main.cpp +--- ../orig/einstein-2.0.dfsg.2/main.cpp 2007-08-31 08:42:16.000000000 +0200 ++++ ./main.cpp 2007-08-31 10:06:07.000000000 +0200 +@@ -1,8 +1,8 @@ + #include + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include "main.h" + #include "utils.h" + #include "storage.h" +diff -ruN ../orig/einstein-2.0.dfsg.2/screen.cpp ./screen.cpp +--- ../orig/einstein-2.0.dfsg.2/screen.cpp 2005-09-24 07:17:30.000000000 +0200 ++++ ./screen.cpp 2007-08-31 09:52:07.000000000 +0200 +@@ -1,4 +1,4 @@ +-#include ++#include + #include "screen.h" + #include "exceptions.h" + #include "unicode.h" +diff -ruN ../orig/einstein-2.0.dfsg.2/screen.h ./screen.h +--- ../orig/einstein-2.0.dfsg.2/screen.h 2005-09-24 07:08:44.000000000 +0200 ++++ ./screen.h 2007-08-31 09:52:26.000000000 +0200 +@@ -2,7 +2,7 @@ + #define __SCREEN_H__ + + +-#include "SDL.h" ++#include "SDL/SDL.h" + #include + #include + +diff -ruN ../orig/einstein-2.0.dfsg.2/sound.cpp ./sound.cpp +--- ../orig/einstein-2.0.dfsg.2/sound.cpp 2005-09-24 08:32:07.000000000 +0200 ++++ ./sound.cpp 2007-08-31 10:07:35.000000000 +0200 +@@ -1,7 +1,7 @@ + #include "sound.h" + + #include +-#include ++#include + #include "resources.h" + + +diff -ruN ../orig/einstein-2.0.dfsg.2/sound.h ./sound.h +--- ../orig/einstein-2.0.dfsg.2/sound.h 2005-09-24 08:24:20.000000000 +0200 ++++ ./sound.h 2007-08-31 10:01:28.000000000 +0200 +@@ -4,7 +4,7 @@ + + #include + #include +-#include ++#include + + + class Sound +diff -ruN ../orig/einstein-2.0.dfsg.2/utils.h ./utils.h +--- ../orig/einstein-2.0.dfsg.2/utils.h 2005-08-14 04:40:58.000000000 +0200 ++++ ./utils.h 2007-08-31 09:52:39.000000000 +0200 +@@ -1,7 +1,7 @@ + #ifndef __UTILS_H__ + #define __UTILS_H__ + +-#include ++#include + #include + #ifdef WIN32 + #include +diff -ruN ../orig/einstein-2.0.dfsg.2/widgets.h ./widgets.h +--- ../orig/einstein-2.0.dfsg.2/widgets.h 2005-09-24 08:11:11.000000000 +0200 ++++ ./widgets.h 2007-08-31 09:59:58.000000000 +0200 +@@ -4,7 +4,7 @@ + #include + #include + #include +-#include ++#include + #include "font.h" + + diff --git a/games/einstein/patches/02_prefix.diff b/games/einstein/patches/02_prefix.diff new file mode 100644 index 0000000000..3ba7833bb2 --- /dev/null +++ b/games/einstein/patches/02_prefix.diff @@ -0,0 +1,11 @@ +--- ../orig/einstein-2.0.dfsg.2/main.cpp 2007-08-31 08:42:16.000000000 +0200 ++++ main.cpp 2007-08-31 10:39:20.000000000 +0200 +@@ -70,7 +70,7 @@ + #ifdef __APPLE__ + dirs.push_back(getResourcesPath(selfPath)); + #else +- dirs.push_back(PREFIX L"/share/einstein/res"); ++ dirs.push_back("/usr" L"/share/einstein/res"); + dirs.push_back(fromMbcs(getenv("HOME")) + L"/.einstein/res"); + #endif + #endif diff --git a/games/einstein/patches/06_srand.diff b/games/einstein/patches/06_srand.diff new file mode 100644 index 0000000000..fff82848bd --- /dev/null +++ b/games/einstein/patches/06_srand.diff @@ -0,0 +1,11 @@ +--- ../orig/einstein-2.0/puzgen.cpp 2005-08-14 04:40:58.000000000 +0200 ++++ puzgen.cpp 2007-08-31 08:42:16.000000000 +0200 +@@ -313,6 +313,8 @@ + + void genPuzzle(SolvedPuzzle &puzzle, Rules &rules) + { ++ srand(time(NULL)); ++ + for (int i = 0; i < PUZZLE_SIZE; i++) { + for (int j = 0; j < PUZZLE_SIZE; j++) + puzzle[i][j] = j + 1; diff --git a/games/einstein/patches/07_long.diff b/games/einstein/patches/07_long.diff new file mode 100644 index 0000000000..76a35c4288 --- /dev/null +++ b/games/einstein/patches/07_long.diff @@ -0,0 +1,31 @@ +--- ../orig/einstein-2.0/formatter.cpp 2005-08-14 04:40:58.000000000 +0200 ++++ formatter.cpp 2007-08-31 08:42:16.000000000 +0200 +@@ -58,7 +58,7 @@ + if ((c.type == INT_ARG) || (c.type == STRING_ARG) || + (c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG)) + { +- int no = (int)c.data; ++ long no = (long)c.data; + args[no - 1] = c.type; + } + } +@@ -123,7 +123,7 @@ + std::wstring Formatter::format(std::vector &argValues) const + { + std::wstring s; +- int no; ++ long no; + + for (int i = 0; i < commandsCnt; i++) { + Command *cmd = &commands[i]; +@@ -135,8 +135,8 @@ + + case STRING_ARG: + case INT_ARG: +- no = (int)cmd->data - 1; +- if (no < (int)argValues.size()) ++ no = (long)cmd->data - 1; ++ if (no < (long)argValues.size()) + s += argValues[no]->format(cmd); + break; + diff --git a/games/einstein/patches/09_colors.diff b/games/einstein/patches/09_colors.diff new file mode 100644 index 0000000000..5f1ddcebc3 --- /dev/null +++ b/games/einstein/patches/09_colors.diff @@ -0,0 +1,22 @@ +--- ../orig/einstein-2.0.dfsg.2/descr.cpp 2007-08-31 11:02:45.000000000 +0200 ++++ descr.cpp 2007-08-31 13:48:19.000000000 +0200 +@@ -11,6 +11,7 @@ + #include "convert.h" + #include "utils.h" + #include "tokenizer.h" ++#include "storage.h" + + + #define WIDTH 600 +@@ -259,7 +260,10 @@ + { + if (0 < line.length()) { + page->add(new Label(&font, offsetX, offsetY + curPosY, +- 255,255,255, line, false)); ++ getStorage()->get(L"text_red", 0), ++ getStorage()->get(L"text_green", 0), ++ getStorage()->get(L"text_blue", 100), ++ line, false)); + line.clear(); + curPosY += 10 + charHeight; + lineWidth = 0; diff --git a/games/einstein/slack-desc b/games/einstein/slack-desc new file mode 100644 index 0000000000..0357ab377c --- /dev/null +++ b/games/einstein/slack-desc @@ -0,0 +1,19 @@ +# 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-----------------------------------------------------| +einstein: Einstein (Puzzle game inspired by Einstein's puzzle) +einstein: +einstein: Einstein puzzle is a free cross-platform open source remake of old +einstein: DOS game Sherlock which was inspired by Albert Einstein's puzzle. +einstein: Einstein said that only those with an intelligence quotient of 98 +einstein: percentile and higher should be able to solve it. +einstein: +einstein: +einstein: +einstein: +einstein: