diff options
-rw-r--r-- | games/pysolfc/Makefile | 83 | ||||
-rw-r--r-- | games/pysolfc/distinfo | 12 | ||||
-rw-r--r-- | games/pysolfc/files/patch-pysollib_mfxutil.py | 21 | ||||
-rw-r--r-- | games/pysolfc/files/patch-setup.py | 36 | ||||
-rw-r--r-- | games/pysolfc/pkg-message | 25 |
5 files changed, 103 insertions, 74 deletions
diff --git a/games/pysolfc/Makefile b/games/pysolfc/Makefile index 0042d7fb1168..a85fd57669a8 100644 --- a/games/pysolfc/Makefile +++ b/games/pysolfc/Makefile @@ -1,59 +1,32 @@ PORTNAME= pysolfc -DISTVERSION= 2.6.4 -PORTREVISION= 2 +DISTVERSION= 2.12.0 CATEGORIES= games python MASTER_SITES= SF/${PORTNAME}/PySolFC/${PYSOLFCDIR} \ - SF/${PORTNAME}/PySolFC-Cardsets/${CARDSETDIR}:cardsets + SF/${PORTNAME}/PySolFC-Cardsets/minimal/:cardsets \ + SF/${PORTNAME}/PySol-Music/${MUSICDIR}/:music DISTFILES= ${PYSOLFCDIST} \ - ${CARDSETDIST}:cardsets + ${CARDSETDIST}:cardsets \ + ${MUSICDIST}:music DIST_SUBDIR= ${PORTNAME} MAINTAINER= kai@FreeBSD.org COMMENT= Solitaire game, written in Python and the successor of PySol -LICENSE= GPLv2+ GPLv3+ MIT PCW PD UCP UCJ ULG +LICENSE= GPLv2+ GPLv3+ LICENSE_COMB= multi -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}random2>=0:math/py-random2@${PY_FLAVOR} \ +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}attrs>0:devel/py-attrs@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}configobj>0:devel/py-configobj@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}game>0:devel/py-game@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pysol-cards>0:games/py-pysol-cards@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}random2>=0:math/py-random2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}tkinter>0:x11-toolkits/py-tkinter@${PY_FLAVOR} \ - ${PY_PILLOW} + ${PYTHON_PKGNAMEPREFIX}tkinter>0:x11-toolkits/py-tkinter@${PY_FLAVOR} LICENSE_FILE_GPLv3+ = ${WRKSRC}/COPYING LICENSE_DISTFILES_GPLv3+ = ${PYSOLFCDIST} - -LICENSE_FILE_MIT= ${WRKDIR}/${CARDSETDIR}/cardset-spider/COPYRIGHT -LICENSE_DISTFILES_MIT= ${CARDSETDIST} - -# This applies also to following cardsets: -# - ${WRKDIR}/${CARDSETDIR}/cardset-rangoon-e/COPYRIGHT -# - ${WRKDIR}/${CARDSETDIR}/cardset-rangoon-r/COPYRIGHT -LICENSE_FILE_PCW= ${WRKDIR}/${CARDSETDIR}/cardset-rangoon-d/COPYRIGHT -LICENSE_NAME_PCW= Postcardware -LICENSE_PERMS_PCW= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept -LICENSE_DISTFILES_PCW= ${CARDSETDIST} - -LICENSE_FILE_PD= ${WRKDIR}/${CARDSETDIR}/cardset-tksol/COPYRIGHT -LICENSE_DISTFILES_PD= ${CARDSETDIST} - -LICENSE_FILE_UCP= ${WRKDIR}/${CARDSETDIR}/cardset-patience/COPYRIGHT -LICENSE_NAME_UCP= Unknown Copyright / Cardset "Patience" -LICENSE_PERMS_UCP= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell auto-accept -LICENSE_DISTFILES_UCP= ${CARDSETDIST} - -LICENSE_FILE_UCJ= ${WRKDIR}/${CARDSETDIR}/cardset-jacoby/COPYRIGHT -LICENSE_NAME_UCJ= Unknown Copyright / Cardset "Jacoby" -LICENSE_PERMS_UCJ= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell auto-accept -LICENSE_DISTFILES_UCJ= ${CARDSETDIST} - -LICENSE_FILE_ULG= ${WRKDIR}/${CARDSETDIR}/cardset-greywyvern/COPYRIGHT -LICENSE_NAME_ULG= Unknown License / Cardset "Greywyvern" -LICENSE_PERMS_ULG= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell auto-accept -LICENSE_DISTFILES_ULG= ${CARDSETDIST} - -# The rest of the cardsets are licensed with the GPLv+2 -LICENSE_FILE_GPLv2+ = ${WRKDIR}/${CARDSETDIR}/cardset-1567/COPYRIGHT -LICENSE_DISTFILES_GPLv2+ = ${CARDSETDIST} +LICENSE_FILE_GPLv2+ = ${WRKDIR}/${CARDSETDIR}/cardset-2000/COPYRIGHT +LICENSE_DISTFILES_GPLv2+ = ${CARDSETDIST} ${MUSICDIST} USES= python:3.6+ shebangfix tar:xz USE_PYTHON= distutils noflavors autoplist @@ -64,14 +37,23 @@ PLIST_FILES= share/pixmaps/pysolfc.png DATADIR= ${PREFIX}/share/PySolFC WRKSRC= ${WRKDIR}/${PYSOLFCDIR} -OPTIONS_DEFINE= NLS +OPTIONS_DEFINE= NLS PILLOW SOUND +OPTIONS_DEFAULT= PILLOW SOUND OPTIONS_SUB= yes + +PILLOW_DESC= Enhanced graphics support + NLS_USES= gettext +PILLOW_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR} +SOUND_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}game>0:devel/py-game@${PY_FLAVOR} + PYSOLFCDIR= PySolFC-${DISTVERSION} PYSOLFCDIST= ${PYSOLFCDIR}${EXTRACT_SUFX} -CARDSETDIR= PySolFC-Cardsets-2.0 -CARDSETDIST= ${CARDSETDIR}.tar.bz2 +CARDSETDIR= PySolFC-Cardsets--Minimal-2.0.2 +CARDSETDIST= ${CARDSETDIR}.tar.xz +MUSICDIR= PySol-Music-4.50 +MUSICDIST= ${MUSICDIR:tl}.tar.xz post-patch: @${MV} ${WRKSRC}/pysol.py ${WRKSRC}/pysolfc @@ -83,16 +65,21 @@ post-patch: ${XARGS} ${RM} -r @${FIND} ${WRKSRC} -name "*.bak" -delete -post-patch-NLS-off: - @${REINPLACE_CMD} -e "s|for l in ('ru', 'ru_RU')|for l in ()|" \ - ${WRKSRC}/setup.py +post-patch-NLS-on: + @${REINPLACE_CMD} -e 's|^#%%NLS%%||' ${WRKSRC}/setup.py post-install: - ${RLN} ${STAGEDIR}${PREFIX}/share/icons/pysol01.png \ + ${RLN} ${STAGEDIR}${PREFIX}/share/icons/hicolor/48x48/apps/pysol.png \ ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png (cd ${WRKDIR}/${CARDSETDIR} && \ ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}) (cd ${WRKDIR}/${CARDSETDIR} && \ ${FIND} . -type f | ${SED} -e 's|^./|${DATADIR_REL}/|' >> ${TMPPLIST}) +post-install-SOUND-on: + (cd ${WRKDIR}/${MUSICDIR:tl}/data && \ + ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}) + (cd ${WRKDIR}/${MUSICDIR:tl}/data && \ + ${FIND} . -type f | ${SED} -e 's|^./|${DATADIR_REL}/|' >> ${TMPPLIST}) + .include <bsd.port.mk> diff --git a/games/pysolfc/distinfo b/games/pysolfc/distinfo index f7e409aee63f..c9a1076173a3 100644 --- a/games/pysolfc/distinfo +++ b/games/pysolfc/distinfo @@ -1,5 +1,7 @@ -TIMESTAMP = 1556530733 -SHA256 (pysolfc/PySolFC-2.6.4.tar.xz) = 4dab3579531530136fb629c045d4b8389f410962e6cf77494f18c61c9de6ea78 -SIZE (pysolfc/PySolFC-2.6.4.tar.xz) = 3761108 -SHA256 (pysolfc/PySolFC-Cardsets-2.0.tar.bz2) = c388d6360191b3b7e463d84e5a64260c4e3ed36e791a85227d7e8923f3f47ca7 -SIZE (pysolfc/PySolFC-Cardsets-2.0.tar.bz2) = 30687905 +TIMESTAMP = 1630237290 +SHA256 (pysolfc/PySolFC-2.12.0.tar.xz) = 244dec417234397e104f2552667be4f8a11c9818059c03bbf0ae8febd25592ef +SIZE (pysolfc/PySolFC-2.12.0.tar.xz) = 3816376 +SHA256 (pysolfc/PySolFC-Cardsets--Minimal-2.0.2.tar.xz) = c0577472bde4d293d8d1440d824a031b3e973219e313e8682d70b8042a9b34f2 +SIZE (pysolfc/PySolFC-Cardsets--Minimal-2.0.2.tar.xz) = 6969096 +SHA256 (pysolfc/pysol-music-4.50.tar.xz) = 3cfade86db88c1d97589c50441808ee082e68256be788012503818c42728783d +SIZE (pysolfc/pysol-music-4.50.tar.xz) = 2144764 diff --git a/games/pysolfc/files/patch-pysollib_mfxutil.py b/games/pysolfc/files/patch-pysollib_mfxutil.py deleted file mode 100644 index a76d320c68ae..000000000000 --- a/games/pysolfc/files/patch-pysollib_mfxutil.py +++ /dev/null @@ -1,21 +0,0 @@ -Fix runtime errors with Python 3.8+ because the function time.clock() has been -removed in Python 3.8, after having been deprecated since Python 3.3. - -Obtained from: -https://github.com/shlomif/PySolFC/commit/0961401105850a18ff129e2c25cfffae45a81752 - ---- pysollib/mfxutil.py.orig 2021-06-09 18:23:28 UTC -+++ pysollib/mfxutil.py -@@ -143,7 +143,11 @@ def getprefdir(package): - - - # high resolution clock() and sleep() --uclock = time.clock -+try: -+ uclock = time.perf_counter -+except Exception: -+ uclock = time.clock -+ - usleep = time.sleep - if os.name == "posix": - uclock = time.time diff --git a/games/pysolfc/files/patch-setup.py b/games/pysolfc/files/patch-setup.py new file mode 100644 index 000000000000..e7e56762412c --- /dev/null +++ b/games/pysolfc/files/patch-setup.py @@ -0,0 +1,36 @@ +* Avoid staging issues by skipping directories that only contain + subdirectories. + +* Skip locale files if NLS is disabled (otherwise enable it via + post-patch target). + +* The pycotap package is only required for testing. + +--- setup.py.orig 2021-06-13 03:25:15 UTC ++++ setup.py +@@ -14,6 +14,8 @@ def get_data_files(source, destination): + destination using the data_files keyword of setuptools.setup.""" + for path, _, files in os.walk(source): + files = [os.path.join(path, f) for f in files] ++ if (len(files) == 0): ++ continue + path = path.replace(source, destination, 1) + yield (path, files) + +@@ -44,7 +46,7 @@ for d in ddirs: + data_files += get_data_files(os.path.join('data', d), + os.path.join(data_dir, d)) + +-data_files += get_data_files('locale', locale_dir) ++#%%NLS%%data_files += get_data_files('locale', locale_dir) + + if os.name == 'posix': + for size in os.listdir('data/images/icons'): +@@ -74,7 +76,6 @@ kw = { + 'install_requires': [ + 'attrs', + 'configobj', +- 'pycotap', + 'pysol_cards', + 'random2', + 'six', diff --git a/games/pysolfc/pkg-message b/games/pysolfc/pkg-message new file mode 100644 index 000000000000..f3a3ef4ecafe --- /dev/null +++ b/games/pysolfc/pkg-message @@ -0,0 +1,25 @@ +[ +{ type: install + message: <<EOD +Please note that only the default set of cards was installed. If you would +like to install more cardsets, please proceed as follows: + +$ fetch https://github.com/shlomif/PySolFC-Cardsets/archive/refs/tags/2.0.tar.gz +$ tar xf 2.0.tar.gz +$ mkdir -p ~/.PySolFC/cardsets +$ cp -r PySolFC-Cardsets-2.0/cardsets* ~/.PySolFC/cardsets/ +EOD +} +{ type: upgrade + maximum_version: 2.12.0 + message: <<EOD +Please note that the new version of PySolFC contains only a default set of +cards. If you should miss one or more cardsets, you can set them up as +follows: + +$ fetch https://github.com/shlomif/PySolFC-Cardsets/archive/refs/tags/2.0.tar.gz +$ tar xf 2.0.tar.gz +$ cp -r PySolFC-Cardsets-2.0/cardsets* ~/.PySolFC/cardsets/ +EOD +} +] |