Skip to content

Commit

Permalink
games/brainworkshop: update 5.0.git20191222 → 5.0.2
Browse files Browse the repository at this point in the history
- Switch to latest pyglet
  • Loading branch information
AMDmi3 committed Mar 16, 2022
1 parent 5dfe8ca commit b3eaf19
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 36 deletions.
15 changes: 7 additions & 8 deletions games/brainworkshop/Makefile
@@ -1,21 +1,20 @@
PORTNAME= brainworkshop
PORTVERSION= 5.0.git20191222
PORTREVISION= 1
DISTVERSIONPREFIX= v
DISTVERSION= 5.0.2
CATEGORIES= games python

MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Dual N-Back mental exercise

LICENSE= GPLv1+ # version not specified

RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pyglet/__init__.py:graphics/py-pyglet150@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pyglet/__init__.py:graphics/py-pyglet@${PY_FLAVOR}

USE_GITHUB= yes
GH_ACCOUNT= samcv
GH_TAGNAME= f1e28d0
GH_ACCOUNT= brain-workshop

USES= shebangfix python:run
SHEBANG_FILES= brainworkshop.pyw
SHEBANG_FILES= brainworkshop.py
NO_BUILD= yes
NO_ARCH= yes

Expand All @@ -33,10 +32,10 @@ DESKTOP_ENTRIES="Brain Workshop" \
OPTIONS_DEFINE= DOCS

post-patch:
@${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' ${WRKSRC}/brainworkshop.pyw
@${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' ${WRKSRC}/brainworkshop.py

do-install:
${INSTALL_SCRIPT} ${WRKSRC}/brainworkshop.pyw ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${INSTALL_SCRIPT} ${WRKSRC}/brainworkshop.py ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
@cd ${WRKSRC} && ${COPYTREE_SHARE} "res data" ${STAGEDIR}${DATADIR}/

do-install-DOCS-on:
Expand Down
6 changes: 3 additions & 3 deletions games/brainworkshop/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1576179420
SHA256 (samcv-brainworkshop-5.0.git20191222-f1e28d0_GH0.tar.gz) = cca9dde0780f2ba9eb59a6b64f690a27a15ddca37c30ea46dc88b1e1edcd5c2d
SIZE (samcv-brainworkshop-5.0.git20191222-f1e28d0_GH0.tar.gz) = 7998600
TIMESTAMP = 1647450762
SHA256 (brain-workshop-brainworkshop-v5.0.2_GH0.tar.gz) = 32e5e06908203d8de4353f8837830e583c2c94db4f6f33c33145b5875323561b
SIZE (brain-workshop-brainworkshop-v5.0.2_GH0.tar.gz) = 7998711
39 changes: 39 additions & 0 deletions games/brainworkshop/files/patch-brainworkshop.py
@@ -0,0 +1,39 @@
--- brainworkshop.py.orig 2021-05-08 11:38:01 UTC
+++ brainworkshop.py
@@ -41,7 +41,7 @@ def get_argv(arg):
error_msg("Expected an argument following %s" % arg)
exit(1)

-import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime, errno
+import random, os, sys, socket, webbrowser, time, math, traceback, datetime, errno
if sys.version_info >= (3,0):
import urllib.request, configparser as ConfigParser
from io import StringIO
@@ -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%%/res/i18n')
else:
- gettext.install('messages', localedir='res/i18n', unicode=True)
+ gettext.install('messages', localedir='%%DATADIR%%/res/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
@@ -137,14 +137,8 @@ def get_pyglet_media_Player():
return my_player

# some functions to assist in path determination
-def main_is_frozen():
- return (hasattr(sys, "frozen") or # new py2exe
- 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 '%%DATADIR%%'

def get_settings_path(name):
'''Get a directory to save user preferences.
25 changes: 0 additions & 25 deletions games/brainworkshop/files/patch-brainworkshop.pyw

This file was deleted.

0 comments on commit b3eaf19

Please sign in to comment.