diff --git a/games/einstein/Makefile b/games/einstein/Makefile new file mode 100644 index 00000000000..fee8cf8b28a --- /dev/null +++ b/games/einstein/Makefile @@ -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 diff --git a/games/einstein/distinfo b/games/einstein/distinfo new file mode 100644 index 00000000000..058d29a83bc --- /dev/null +++ b/games/einstein/distinfo @@ -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 diff --git a/games/einstein/patches/patch-Makefile b/games/einstein/patches/patch-Makefile new file mode 100644 index 00000000000..b4dd8193ece --- /dev/null +++ b/games/einstein/patches/patch-Makefile @@ -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. + diff --git a/games/einstein/patches/patch-convert_cpp b/games/einstein/patches/patch-convert_cpp new file mode 100644 index 00000000000..b33b846486a --- /dev/null +++ b/games/einstein/patches/patch-convert_cpp @@ -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); diff --git a/games/einstein/patches/patch-utils_cpp b/games/einstein/patches/patch-utils_cpp new file mode 100644 index 00000000000..209f60f5641 --- /dev/null +++ b/games/einstein/patches/patch-utils_cpp @@ -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; diff --git a/games/einstein/pkg/DESCR b/games/einstein/pkg/DESCR new file mode 100644 index 00000000000..1e62968231c --- /dev/null +++ b/games/einstein/pkg/DESCR @@ -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. diff --git a/games/einstein/pkg/PLIST b/games/einstein/pkg/PLIST new file mode 100644 index 00000000000..e256b4bcad6 --- /dev/null +++ b/games/einstein/pkg/PLIST @@ -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