Index: head/games/brainworkshop/Makefile =================================================================== --- head/games/brainworkshop/Makefile (revision 519944) +++ head/games/brainworkshop/Makefile (revision 519945) @@ -1,44 +1,48 @@ # Created by: Dmitry Marakasov # $FreeBSD$ PORTNAME= brainworkshop -PORTVERSION= 4.4 -PORTREVISION= 2 -CATEGORIES= games -MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/Brain%20Workshop%20${PORTVERSION} +PORTVERSION= 5.0.git20191222 +CATEGORIES= games python MAINTAINER= amdmi3@FreeBSD.org -COMMENT= Free open-source version of the Dual N-Back mental exercise +COMMENT= Dual N-Back mental exercise +LICENSE= GPLv1+ # version not specified + RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pyglet/__init__.py:graphics/py-pyglet@${PY_FLAVOR} -USES= dos2unix python:2.7,run shebangfix zip -NO_BUILD= yes -DOS2UNIX_FILES= brainworkshop.pyw +USE_GITHUB= yes +GH_ACCOUNT= samcv +GH_TAGNAME= f1e28d0 + +USES= shebangfix python:run SHEBANG_FILES= brainworkshop.pyw +NO_BUILD= yes +NO_ARCH= yes -WRKSRC= ${WRKDIR}/${PORTNAME} - -PORTSCOUT= skipv:4.22 - PLIST_FILES= bin/${PORTNAME} PORTDATA= * +PORTDOCS= * DESKTOP_ENTRIES="Brain Workshop" \ - "Dual N-Back mental exercise" \ - "${DATADIR}/brain.png" \ + "" \ + "${DATADIR}/res/misc/brain/brain.png" \ "brainworkshop" \ "Game;LogicGame;" \ false +OPTIONS_DEFINE= DOCS + post-patch: - @${REINPLACE_CMD} -e '/^FOLDER_RES = / s|res|${DATADIR}|; \ - /^FOLDER_DATA = / s|.data.|os.environ["HOME"]+"/.brainworkshop"|' \ - ${WRKSRC}/brainworkshop.pyw + @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' ${WRKSRC}/brainworkshop.pyw do-install: ${INSTALL_SCRIPT} ${WRKSRC}/brainworkshop.pyw ${STAGEDIR}${PREFIX}/bin/${PORTNAME} - ${MKDIR} ${STAGEDIR}${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/res/* ${STAGEDIR}${DATADIR}/ + @cd ${WRKSRC} && ${COPYTREE_SHARE} "res data" ${STAGEDIR}${DATADIR}/ + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/Readme* ${WRKSRC}/data/Readme* ${STAGEDIR}${DOCSDIR}/ .include Index: head/games/brainworkshop/distinfo =================================================================== --- head/games/brainworkshop/distinfo (revision 519944) +++ head/games/brainworkshop/distinfo (revision 519945) @@ -1,2 +1,3 @@ -SHA256 (brainworkshop-4.4.zip) = f3bdee10499f02d8d3505690172bf540f9e70b32b9ae8117464a9b02a874b505 -SIZE (brainworkshop-4.4.zip) = 11829491 +TIMESTAMP = 1576179420 +SHA256 (samcv-brainworkshop-5.0.git20191222-f1e28d0_GH0.tar.gz) = cca9dde0780f2ba9eb59a6b64f690a27a15ddca37c30ea46dc88b1e1edcd5c2d +SIZE (samcv-brainworkshop-5.0.git20191222-f1e28d0_GH0.tar.gz) = 7998600 Index: head/games/brainworkshop/files/patch-brainworkshop.pyw =================================================================== --- head/games/brainworkshop/files/patch-brainworkshop.pyw (revision 519944) +++ head/games/brainworkshop/files/patch-brainworkshop.pyw (revision 519945) @@ -1,42 +1,25 @@ ---- brainworkshop.pyw.orig 2009-01-17 21:01:40.000000000 +0300 -+++ brainworkshop.pyw 2009-01-19 22:41:15.000000000 +0300 -@@ -49,9 +49,7 @@ +--- brainworkshop.pyw.orig 2019-11-18 21:08:09 UTC ++++ brainworkshop.pyw +@@ -56,9 +56,9 @@ from datetime import date + import gettext + if sys.version_info >= (3,0): + # TODO check if this is right +- gettext.install('messages', localedir='res/i18n') ++ gettext.install('messages', localedir='%%DATADIR%%/i18n') + else: +- gettext.install('messages', localedir='res/i18n', unicode=True) ++ gettext.install('messages', localedir='%%DATADIR%%/i18n', unicode=True) + + # Clinical mode? Clinical mode sets cfg.JAEGGI_MODE = True, enforces a minimal user + # interface, and saves results into a binary file (default 'logfile.dat') which +@@ -142,9 +142,7 @@ def main_is_frozen(): hasattr(sys, "importers") # old py2exe or imp.is_frozen("__main__")) # tools/freeze def get_main_dir(): - if main_is_frozen(): - return os.path.dirname(sys.executable) -- return sys.path[0] -+ return '/' - def get_data_dir(): - try: - return sys.argv[sys.argv.index('--datadir') + 1] -@@ -355,6 +353,9 @@ - except: - pass +- return sys.path[0] ++ return '%%DATADIR%%' -+if not os.path.exists(FOLDER_DATA): -+ os.mkdir(FOLDER_DATA) -+ - if not os.path.isfile(os.path.join(get_data_dir(), CONFIGFILE)): - newconfigfile = open(os.path.join(os.path.join(get_data_dir(), CONFIGFILE)), 'w') - newconfigfile.write(CONFIGFILE_DEFAULT_CONTENTS) -@@ -643,17 +644,7 @@ - print >> sys.stderr, ''.join(str_list) - sys.exit(1) - --if USE_MUSIC: -- try: -- from pyglet.media import avbin -- except: -- USE_MUSIC = False -- str_list = [] -- str_list.append('\nAVBin not detected. Music disabled.\n') -- str_list.append('Download AVBin from: http://code.google.com/p/avbin/\n\n') -- #str_list.append(str(sys.exc_info())) -- #print >> sys.stderr, ''.join(str_list) -- print ''.join(str_list) -+USE_MUSIC = False - - # Initialize resources (sounds and images) - # + def get_settings_path(name): + '''Get a directory to save user preferences. Index: head/games/brainworkshop/pkg-descr =================================================================== --- head/games/brainworkshop/pkg-descr (revision 519944) +++ head/games/brainworkshop/pkg-descr (revision 519945) @@ -1,18 +1,18 @@ What if a simple mental exercise could improve your memory and intelligence? A recent study published in PNAS, an important scientific journal, shows that a particular memory task called Dual N-Back actually improves working memory (short term memory) and fluid intelligence. This finding is important because fluid intelligence was previously thought to be unchangeable. The game involves remembering a sequence of spoken letters and a sequence of positions of a square at the same time. In addition to its ability to closely replicate the conditions of the original study by Jaeggi et al. (2008), Brain Workshop includes optional extended game modes such as Triple N-Back and Arithmetic N-Back. It also includes features such as statistics tracking, graphs and easy configurability. -WWW: http://brainworkshop.sourceforge.net/ +WWW: https://github.com/samcv/brainworkshop