Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2013 18:55:43 +0200
From:      nemysis <nemysis@FreeBSD.org>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        amdmi3@FreeBSD.org
Subject:   ports/182517: [PATCH] graphics/py27-pyglet: Support STAGEDIR, add Demos 
Message-ID:  <201309301655.r8UGtj67037596@freefall.freebsd.org>
Resent-Message-ID: <201309301700.r8UH00wg037778@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         182517
>Category:       ports
>Synopsis:       [PATCH] graphics/py27-pyglet: Support STAGEDIR, add Demos
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 30 17:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     nemysis
>Release:        FreeBSD 9.1-RELEASE-p20 amd64
>Organization:
>Environment:
System: FreeBSD nemysis4now 9.1-RELEASE-p20 FreeBSD 9.1-RELEASE-p20 #0: Tue Sep 10 17:07:53 UTC 2013
>Description:

- Bump PORTREVISION
- Add license (BSD)
- Use the new format for LIB_DEPENDS
- Add dependency for multimedia/avbin
- Change docs and add DEMOS, DOCS and EXAMPLES Option
- Add DEMOS to default Options
- Support STAGEDIR and add OPTIONS_SUB
- Remove IGNORE for not i386
- Add demos Astraea and Noisy, add Icons, Desktop entry files
- Add REINPLACE_CMD
- Add pkg-message to display demos usage
- Change pkg-plist add demos


Port maintainer (amdmi3@FreeBSD.org) is cc'd.

Generated and tested manually, tested with stage and with RedPorts, sent with FreeBSD Port Tools 0.99_8 (mode: change, diff: ports)
>How-To-Repeat:

Build log

https://redports.org/buildarchive/20130930133900-45408/


>From Upstream

http://pyglet.org/

Pyglet now also runs on 64-bit operating systems Linux, Windows and OS X.

>Fix:

--- py27-pyglet-1.1.4_1.patch begins here ---
diff -ruN /usr/ports/graphics/py-pyglet/Makefile ./Makefile
--- /usr/ports/graphics/py-pyglet/Makefile	2013-09-20 20:53:25.000000000 +0200
+++ ./Makefile	2013-09-30 18:18:40.000000000 +0200
@@ -3,6 +3,7 @@
 
 PORTNAME=	pyglet
 PORTVERSION=	1.1.4
+PORTREVISION=	1
 CATEGORIES=	graphics multimedia x11-toolkits python
 MASTER_SITES=	GOOGLE_CODE
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -10,8 +11,11 @@
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	Cross-platform windowing and multimedia library for Python
 
-LIB_DEPENDS=	freetype:${PORTSDIR}/print/freetype2 \
-		fontconfig:${PORTSDIR}/x11-fonts/fontconfig
+LICENSE=	BSD
+
+LIB_DEPENDS=	libfreetype.so:${PORTSDIR}/print/freetype2 \
+		libfontconfig.so:${PORTSDIR}/x11-fonts/fontconfig
+RUN_DEPENDS=	avbin>=0:${PORTSDIR}/multimedia/avbin
 
 USE_PYTHON=	yes
 USE_PYDISTUTILS=	yes
@@ -19,23 +23,52 @@
 USE_OPENAL=	al
 
 PORTDOCS=	*
+
+DOCSRCDIR1=	${WRKSRC}
+DOC_FILES1=	CHANGELOG NOTICE README
+
+DOCSRCDIR2=	${WRKSRC}/doc
+DOCSDIR2=	${DOCSDIR}/doc
+
 PORTEXAMPLES=	*
 
-NO_STAGE=	yes
+OPTIONS_DEFINE=	DOCS
+OPTIONS_GROUP=	DEMOS_EXAMPLES
+OPTIONS_GROUP_DEMOS_EXAMPLES=	DEMOS EXAMPLES
+OPTIONS_DEFAULT=	DEMOS
+DEMOS_DESC=	Install Demos programs, requires EXAMPLES
+
+OPTIONS_SUB=	yes
+
 .include <bsd.port.options.mk>
 
-.if ${ARCH} != "i386"
-IGNORE=		crashes or doesn't work on !i386
+.if ${PORT_OPTIONS:MDEMOS} && ${PORT_OPTIONS:MEXAMPLES}
+SUB_FILES+=	pkg-message pyglet-astraea pyglet-noisy
+DESKTOP_ENTRIES+="Astraea" "A sprite-based game loosely based on the classic Asteroids" "pyglet-astraea" \
+		"pyglet-astraea" "Game;ArcadeGame;" false
+DESKTOP_ENTRIES+="Noisy" "Bounces balls around a window and plays noises" "pyglet-noisy" \
+		"pyglet-noisy" "Game;ArcadeGame;" false
+# Sound Space not works, needs working AVbin
 .endif
 
+post-patch:
+	@${FIND} ${WRKSRC} -name '*.py' | ${XARGS} \
+		${REINPLACE_CMD} -e 's|/usr/include|${PREFIX}/include|g'
+	@${FIND} ${WRKSRC} -name "*.bak" -delete
+
 post-install:
-.if ${PORT_OPTIONS:MDOCS}
-	${MKDIR} ${DOCSDIR}
-	cd ${WRKSRC}/doc && ${COPYTREE_SHARE} \* ${DOCSDIR}
-.endif
-.if ${PORT_OPTIONS:MEXAMPLES}
-	${MKDIR} ${EXAMPLESDIR}
-	cd ${WRKSRC}/examples && ${COPYTREE_SHARE} \* ${EXAMPLESDIR}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${STAGEDIR}${DOCSDIR}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR2}
+	@(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR2})
+
+	@(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
+
+.if ${PORT_OPTIONS:MDEMOS} && ${PORT_OPTIONS:MEXAMPLES}
+	${INSTALL_SCRIPT} ${WRKDIR}/pyglet-astraea ${STAGEDIR}${PREFIX}/bin/
+	${INSTALL_SCRIPT} ${WRKDIR}/pyglet-noisy ${STAGEDIR}${PREFIX}/bin/
+	${LN} -sf ${EXAMPLESDIR}/astraea/res/asteroid2.png ${STAGEDIR}${PREFIX}/share/pixmaps/pyglet-astraea.png
+	${LN} -sf ${EXAMPLESDIR}/noisy/ball.png ${STAGEDIR}${PREFIX}/share/pixmaps/pyglet-noisy.png
 .endif
 
 .include <bsd.port.mk>
diff -ruN /usr/ports/graphics/py-pyglet/files/pkg-message.in ./files/pkg-message.in
--- /usr/ports/graphics/py-pyglet/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pkg-message.in	2013-09-30 18:45:36.000000000 +0200
@@ -0,0 +1,26 @@
+===============================================================================
+
+pyglet has been installed.
+
+pyglet have more Demos (Games)
+
+Astraea, Noisy
+
+
+You can use executable
+
+    %%LOCALBASE%%/bin/pyglet-astraea
+
+    %%LOCALBASE%%/bin/pyglet-noisy
+
+
+Or can use desktop files
+
+    %%LOCALBASE%%/share/applications/pyglet-astraea.desktop
+
+    %%LOCALBASE%%/share/applications/pyglet-noisy.desktop
+
+
+Have fun!
+
+===============================================================================
diff -ruN /usr/ports/graphics/py-pyglet/files/pyglet-astraea.in ./files/pyglet-astraea.in
--- /usr/ports/graphics/py-pyglet/files/pyglet-astraea.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pyglet-astraea.in	2013-09-30 13:32:03.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# # $FreeBSD$
+#
+
+cd "%%EXAMPLESDIR%%/astraea"
+exec /usr/bin/env python ./astraea.py "${@}"
diff -ruN /usr/ports/graphics/py-pyglet/files/pyglet-noisy.in ./files/pyglet-noisy.in
--- /usr/ports/graphics/py-pyglet/files/pyglet-noisy.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pyglet-noisy.in	2013-09-30 13:32:58.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# # $FreeBSD$
+#
+
+cd "%%EXAMPLESDIR%%/noisy"
+exec /usr/bin/env python ./noisy.py "${@}"
diff -ruN /usr/ports/graphics/py-pyglet/pkg-plist ./pkg-plist
--- /usr/ports/graphics/py-pyglet/pkg-plist	2013-09-13 02:57:08.000000000 +0200
+++ ./pkg-plist	2013-09-30 15:33:44.000000000 +0200
@@ -1,3 +1,5 @@
+%%EXAMPLES%%bin/pyglet-astraea
+%%DEMOS%%bin/pyglet-noisy
 %%PYTHON_SITELIBDIR%%/pyglet/__init__.py
 %%PYTHON_SITELIBDIR%%/pyglet/__init__.pyc
 %%PYTHON_SITELIBDIR%%/pyglet/__init__.pyo
@@ -295,6 +297,8 @@
 %%PYTHON_SITELIBDIR%%/pyglet/window/xlib/xsync.py
 %%PYTHON_SITELIBDIR%%/pyglet/window/xlib/xsync.pyc
 %%PYTHON_SITELIBDIR%%/pyglet/window/xlib/xsync.pyo
+%%DEMOS%%share/pixmaps/pyglet-astraea.png
+%%DEMOS%%share/pixmaps/pyglet-noisy.png
 @dirrm %%PYTHON_SITELIBDIR%%/pyglet/window/xlib
 @dirrm %%PYTHON_SITELIBDIR%%/pyglet/window/win32
 @dirrm %%PYTHON_SITELIBDIR%%/pyglet/window/carbon
--- py27-pyglet-1.1.4_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309301655.r8UGtj67037596>