Import einstein, a remake of old DOS game Sherlock which was inspired by

Albert Einstein's puzzle.
Submitted by Anton Yabchinskiy (thanks!) on ports@ plus some tweaks by me.
This commit is contained in:
landry 2009-04-03 17:56:41 +00:00
parent c2783d06d0
commit 16cf36d201
7 changed files with 135 additions and 0 deletions

29
games/einstein/Makefile Normal file
View File

@ -0,0 +1,29 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/04/03 17:56:41 landry Exp $
COMMENT = open source remake of old DOS game Sherlock
DISTNAME = einstein-2.0
CATEGORIES = games
HOMEPAGE = http://games.flowix.com/
# No license information in distfile. Homepage states that
# "you can download game for free under GPL license terms".
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB = c freetype m pthread stdc++ z
MASTER_SITES = ${HOMEPAGE}files/einstein/
EXTRACT_SUFX = -src.tar.gz
LIB_DEPENDS = SDL.>=8::devel/sdl \
SDL_mixer.>=3::devel/sdl-mixer \
SDL_ttf.>=7::devel/sdl-ttf
USE_GMAKE = Yes
.include <bsd.port.mk>

5
games/einstein/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (einstein-2.0-src.tar.gz) = wdmOdhwQr2PwNGLq1iX4DA==
RMD160 (einstein-2.0-src.tar.gz) = 8ZsfhrM9gFMAxEI66y2I8fXK48U=
SHA1 (einstein-2.0-src.tar.gz) = hmqaHBFQFNf2okG8IrJRkH9j+Lw=
SHA256 (einstein-2.0-src.tar.gz) = Dy0cfUbTbyeoVrmM1Lu5WBOXDI6ANER3K+e9m+xFpUg=
SIZE (einstein-2.0-src.tar.gz) = 722301

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2009/04/03 17:56:41 landry Exp $
--- Makefile.orig Sun Sep 25 23:20:30 2005
+++ Makefile Fri Apr 3 19:41:41 2009
@@ -5,7 +5,6 @@
########################################
# installation prefix
-PREFIX=/usr/local
########################################
#
@@ -16,7 +15,7 @@ PREFIX=/usr/local
OPTIMIZE=#-O6 -march=pentium4 -mfpmath=sse -fomit-frame-pointer -funroll-loops
PROFILER=#-pg
DEBUG=#-ggdb
-CXXFLAGS=-pipe -Wall $(OPTIMIZE) $(DEBUG) `sdl-config --cflags` -DPREFIX=L\"$(PREFIX)\" $(PROFILER)
+CXXFLAGS= $(CFLAGS) $(OPTIMIZE) $(DEBUG) `sdl-config --cflags` -DPREFIX=L\"$(PREFIX)\" $(PROFILER)
LNFLAGS=-pipe -lSDL_ttf -lfreetype `sdl-config --libs` -lz -lSDL_mixer $(PROFILER)
INSTALL=install
@@ -61,8 +60,9 @@ run: $(TARGET)
./$(TARGET)
install: $(TARGET)
- $(INSTALL) -s -D $(TARGET) $(PREFIX)/bin/$(TARGET)
- $(INSTALL) -D einstein.res $(PREFIX)/share/einstein/res/einstein.res
+ $(INSTALL) -s $(TARGET) $(PREFIX)/bin/$(TARGET)
+ $(INSTALL) -d $(PREFIX)/share/einstein/res
+ $(INSTALL) einstein.res $(PREFIX)/share/einstein/res/einstein.res
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-convert_cpp,v 1.1.1.1 2009/04/03 17:56:41 landry Exp $
--- convert.cpp.orig Sun Aug 14 06:40:58 2005
+++ convert.cpp Thu Apr 2 10:27:29 2009
@@ -28,7 +28,14 @@ std::wstring numToStr(int num)
#ifdef WIN32
swprintf(buf, L"%i", num);
#else
- swprintf(buf, 29, L"%i", num);
+ int c, i;
+ char buf2 [60];
+
+ c = snprintf (buf2, sizeof (buf2), "%i", num);
+ for (i = 0; i < c; ++i) {
+ buf [i] = (wchar_t) buf2 [i];
+ }
+ buf [i] = L'\0';
#endif
buf[29] = 0;
return std::wstring(buf);
@@ -40,7 +47,14 @@ std::wstring numToStr(unsigned int num)
#ifdef WIN32
swprintf(buf, L"%u", num);
#else
- swprintf(buf, 29, L"%i", num);
+ int c, i;
+ char buf2 [30];
+
+ c = snprintf (buf2, sizeof (buf2), "%i", num);
+ for (i = 0; i < c; ++i) {
+ buf [i] = (wchar_t) buf2 [i];
+ }
+ buf [i] = L'\0';
#endif
buf[29] = 0;
return std::wstring(buf);

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-utils_cpp,v 1.1.1.1 2009/04/03 17:56:41 landry Exp $
--- utils.cpp.orig Thu Apr 2 09:00:22 2009
+++ utils.cpp Thu Apr 2 09:14:42 2009
@@ -275,7 +275,16 @@ std::wstring secToStr(int time)
#ifdef WIN32
swprintf(buf, L"%02i:%02i:%02i", hours, minutes, seconds);
#else
- swprintf(buf, 50, L"%02i:%02i:%02i", hours, minutes, seconds);
+ int c, i;
+ char buf2 [50];
+
+ c = snprintf (buf2, sizeof (buf2), "%02i:%02i:%02i", hours, minutes,
+ seconds);
+
+ for (i = 0; i < c; ++i) {
+ buf [i] = (wchar_t) buf2 [i];
+ }
+ buf [i] = L'\0';
#endif
return buf;

8
games/einstein/pkg/DESCR Normal file
View File

@ -0,0 +1,8 @@
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.
The game goal is to open all cards in square of 6x6 cards. For this,
a number of hints describing relations between card positions are
given. Use them to find the correct layout.

5
games/einstein/pkg/PLIST Normal file
View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/04/03 17:56:41 landry Exp $
@bin bin/einstein
share/einstein/
share/einstein/res/
share/einstein/res/einstein.res