Bug 168683 - [PATCH] update port graphics/py-stl to 3.1
Summary: [PATCH] update port graphics/py-stl to 3.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Nicola Vitale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 22:20 UTC by rsmith
Modified: 2012-09-19 22:40 UTC (History)
0 users

See Also:


Attachments
file.diff (3.35 KB, patch)
2012-06-04 22:20 UTC, rsmith
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rsmith 2012-06-04 22:20:10 UTC
- The previous versions had a nasty bug in the detection of degenerate
  facets, because they use the __len__ method, which is for integer
  values. This means vector lengths got rounded to 0 when they shouldn't,
  leading to spurious degenerate facets.
- For generating PDF figures, this version switches from Reportlab
  to Cairo.
- Manpage for stl2pov was added.
- While there, convert the port to optionsNG and add license.

Fix: Apply the following patch to the port:
-------- port patch ---------
How-To-Repeat: Try converting an STL files with small triangles.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-06-05 13:37:06 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-python

freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool)
Comment 2 Nicola Vitale freebsd_committer freebsd_triage 2012-07-21 17:32:55 UTC
Responsible Changed
From-To: freebsd-python->nivit

I will take it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2012-09-19 22:31:40 UTC
Author: nivit
Date: Wed Sep 19 21:31:28 2012
New Revision: 304548
URL: http://svn.freebsd.org/changeset/ports/304548

Log:
  - Update to 3.1
  - Adopt new Makefile header
  - Add LICENSE (BSD)
  - Use PYDISTUTILS_EGGINFO
  - Add option PYCAIRO (default off)
  - Remove unnecessary whitespaces, fix a typo and
    update text in pkg-descr
  
  BuildLog:	http://goo.gl/Z1ymo
  
  PR:	ports/168683
  Submitted by:	Roland Smith <rsmith@xs4all.nl> (maintainer)

Modified:
  head/graphics/py-stl/Makefile   (contents, props changed)
  head/graphics/py-stl/distinfo   (contents, props changed)
  head/graphics/py-stl/pkg-descr   (contents, props changed)
  head/graphics/py-stl/pkg-plist   (contents, props changed)

Modified: head/graphics/py-stl/Makefile
==============================================================================
--- head/graphics/py-stl/Makefile	Wed Sep 19 20:56:28 2012	(r304547)
+++ head/graphics/py-stl/Makefile	Wed Sep 19 21:31:28 2012	(r304548)
@@ -1,41 +1,55 @@
-# New ports collection makefile for:    py-stl
-# Date created:                         28 Dec 2011
-# Whom:                                 rsmith@xs4all.nl
-#
+# Created by: Roland Smith <rsmith@xs4all.nl>
 # $FreeBSD$
 
 PORTNAME=		stl
-PORTVERSION=		3.0
+PORTVERSION=		3.1
 CATEGORIES=		graphics python
 MASTER_SITES=		http://rsmith.home.xs4all.nl/software/
 PKGNAMEPREFIX=		${PYTHON_PKGNAMEPREFIX}
-DISTNAME=		py-${PORTNAME}-${GITVER}
+DISTNAME=		py-${PORTNAME}-${PORTVERSION}
 
 MAINTAINER=		rsmith@xs4all.nl
 COMMENT=		Converts STL models to POV-Ray meshes or PostScript/PDF images
 
-RUN_DEPENDS=		${PYTHON_PKGNAMEPREFIX}reportlab2>2:${PORTSDIR}/print/py-reportlab2
+LICENSE=		BSD
 
-GITVER=			31a5b12
+# bypass infrastructure bug
+OPTIONSFILE=		${PORT_DBDIR}/py-${PORTNAME}/options
 
 USE_ZIP=		YES
 USE_PYTHON=		2.5+
 USE_PYDISTUTILS=	YES
+PYDISTUTILS_EGGINFO=	py_stl-${PORTVERSION}-py${PYTHON_VER}.egg-info
 
 CONFLICTS=		stl2pov-[0-9]*
 
-MAN1=			stl2ps.1 stlinfo.1 stl2pdf.1
+MAN1=			stl2ps.1 stlinfo.1 stl2pov.1
+
+OPTIONS_DEFINE=		PYCAIRO
+PYCAIRO_DESC=		Use (py)Cairo to enable stl2pdf
+
+.include <bsd.port.options.mk>
+
+STL_SCRIPTS=		stl2pov stl2ps stlinfo
+
+.if ${PORT_OPTIONS:MPYCAIRO}
+RUN_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}cairo>1.8:${PORTSDIR}/graphics/py-cairo
+MAN1+=			stl2pdf.1
+PLIST_SUB=		STL2PDF=""
+STL_SCRIPTS+=		stl2pdf
+.else
+PLIST_SUB=		STL2PDF="@comment "
+.endif
 
 NO_BUILD=		YES
 
 post-install:
-	@${INSTALL_MAN} ${WRKSRC}/stl2ps.1 ${MANPREFIX}/man/man1
-	@${INSTALL_MAN} ${WRKSRC}/stlinfo.1 ${MANPREFIX}/man/man1
-	@${INSTALL_MAN} ${WRKSRC}/stl2pdf.1 ${MANPREFIX}/man/man1
-	@${MV} ${PREFIX}/bin/stl2ps.py  ${PREFIX}/bin/stl2ps
-	@${MV} ${PREFIX}/bin/stl2pov.py ${PREFIX}/bin/stl2pov
-	@${MV} ${PREFIX}/bin/stlinfo.py ${PREFIX}/bin/stlinfo
-	@${MV} ${PREFIX}/bin/stl2pdf.py ${PREFIX}/bin/stl2pdf
-	@${MV} ${PYTHON_SITELIBDIR}/py_stl-${GITVER}-py${PYTHON_VER}.egg-info ${PYTHON_SITELIBDIR}/${PYDISTUTILS_EGGINFO}
+.if empty(PORT_OPTIONS:MPYCAIRO)
+	@${RM} -f ${PREFIX}/bin/stl2pdf.py
+.endif
+.for s in ${STL_SCRIPTS}
+	${INSTALL_MAN} ${WRKSRC}/${s}.1 ${MANPREFIX}/man/man1
+	@${MV} ${PREFIX}/bin/${s}.py  ${PREFIX}/bin/${s}
+.endfor
 
 .include <bsd.port.mk>

Modified: head/graphics/py-stl/distinfo
==============================================================================
--- head/graphics/py-stl/distinfo	Wed Sep 19 20:56:28 2012	(r304547)
+++ head/graphics/py-stl/distinfo	Wed Sep 19 21:31:28 2012	(r304548)
@@ -1,2 +1,2 @@
-SHA256 (py-stl-31a5b12.zip) = 117bd90aeea8aea6febe8b154b5ee9590cf0cec9a129023db31c122d7f595269
-SIZE (py-stl-31a5b12.zip) = 93478
+SHA256 (py-stl-3.1.zip) = d5a2eccbd627d05b28d3b6d619202d3a55b4d94dbf21a63b68109688ebc8e929
+SIZE (py-stl-3.1.zip) = 115488

Modified: head/graphics/py-stl/pkg-descr
==============================================================================
--- head/graphics/py-stl/pkg-descr	Wed Sep 19 20:56:28 2012	(r304547)
+++ head/graphics/py-stl/pkg-descr	Wed Sep 19 21:31:28 2012	(r304548)
@@ -1,11 +1,11 @@
 The python modules stl.py and xform.py are for reading, creating and
 transforming STL (STereoLithography) files. These modules are used by the
-following scripts;
+following scripts:
 
 stl2pov: Converts the STL model to a mesh usable with the POV-ray raytracer.
 stl2ps:  Creates a view of the STL model in scalable PostScript.
-stl2pdf: Creates a view of the STL model as a PDF. Requires print/py-reportlab2
+stl2pdf: Creates a view of the STL model as a PDF. Requires graphics/py-cairo
 sltinfo: Either displays some information about a STL file or prints it in
-		 text format.
+text format.
 
 WWW: http://rsmith.home.xs4all.nl/software/index.html

Modified: head/graphics/py-stl/pkg-plist
==============================================================================
--- head/graphics/py-stl/pkg-plist	Wed Sep 19 20:56:28 2012	(r304547)
+++ head/graphics/py-stl/pkg-plist	Wed Sep 19 21:31:28 2012	(r304548)
@@ -4,7 +4,7 @@
 %%PYTHON_SITELIBDIR%%/xform.py
 %%PYTHON_SITELIBDIR%%/xform.pyc
 %%PYTHON_SITELIBDIR%%/xform.pyo
-bin/stl2pdf
+%%STL2PDF%%bin/stl2pdf
 bin/stl2pov
 bin/stl2ps
 bin/stlinfo
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Nicola Vitale freebsd_committer freebsd_triage 2012-09-19 22:31:57 UTC
State Changed
From-To: open->closed

Committed with some changes (approved by maintainer via 
private email). Thanks.