Bug 184868 - graphics/gsculpt: Fix build with clang
Summary: graphics/gsculpt: Fix build with clang
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: Pawel Pekala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-16 18:10 UTC by tkato432
Modified: 2013-12-28 18:10 UTC (History)
0 users

See Also:


Attachments
file.diff (2.75 KB, patch)
2013-12-16 18:10 UTC, tkato432
no flags Details | Diff
graphics_gsculpt.diff (3.57 KB, patch)
2013-12-21 18:29 UTC, tkato432
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tkato432 2013-12-16 18:10:18 UTC
- Fix build with clang
- Add DESKTOP_ENTRIES

New file:
files/patch-cpp__Util__Pool.h
Comment 1 Pawel Pekala freebsd_committer freebsd_triage 2013-12-20 17:12:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pawel

I'll take it.
Comment 2 Pawel Pekala freebsd_committer freebsd_triage 2013-12-20 17:58:04 UTC
State Changed
From-To: open->feedback

${PREFIX}/bin/gsculpt fails to launch due to STAGEDIR leakage: 

cat /usr/local/bin/gsculpt 
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ports/graphics/gsculpt/work/stage/usr/local/lib/gSculpt 
python 
/usr/local/ports/graphics/gsculpt/work/stage/usr/local/lib/python2.7/site-packages/gsculpt.py 
$@
Comment 3 tkato432 2013-12-21 18:29:22 UTC
Here is the corrected patch.
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-12-27 14:06:08 UTC
Author: pawel
Date: Fri Dec 27 14:05:59 2013
New Revision: 337731
URL: http://svnweb.freebsd.org/changeset/ports/337731

Log:
  - Fix build with clang
  - Remove leading article from COMMENT
  - Add desktop entry file
  - Strip library objects
  - Support staging
  
  Yes, I use prefix=${STAGEDIR}${PREFIX} here, after a long while it was
  5 lines of REINPLACE_CMD vs rewriting scons install script.
  
  <badmouthing of scons goes here>
  
  PR:		ports/184868
  Submitted by:	KATO Tsuguru <tkato432@yahoo.com>

Added:
  head/graphics/gsculpt/files/patch-cpp__Util__Pool.h   (contents, props changed)
Modified:
  head/graphics/gsculpt/Makefile
  head/graphics/gsculpt/pkg-plist   (contents, props changed)

Modified: head/graphics/gsculpt/Makefile
==============================================================================
--- head/graphics/gsculpt/Makefile	Fri Dec 27 13:17:27 2013	(r337730)
+++ head/graphics/gsculpt/Makefile	Fri Dec 27 14:05:59 2013	(r337731)
@@ -3,13 +3,13 @@
 
 PORTNAME=	gsculpt
 PORTVERSION=	0.99.47
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	graphics
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${DISTNAME:S,-src,,}
 DISTNAME=	gSculpt-${PORTVERSION}-alpha-src
 
 MAINTAINER=	ports@FreeBSD.org
-COMMENT=	An Opensource 3D modelling application
+COMMENT=	Opensource 3D modelling application
 
 LICENSE=	GPLv2
 
@@ -19,18 +19,19 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}open
 
 WRKSRC=		${WRKDIR}/${DISTNAME:S,-src,,}
 
-USES=		pkgconfig
+USES=		pkgconfig scons
 USE_GNOME=	pygtk2
 USE_GL=		glu
 USE_XORG=	x11
-USE_PYTHON=	2.4+
-USE_SCONS=	yes
-SCONS_BUILDENV=	${SCONS_ENV}
+USE_PYTHON=	2
 USE_LDCONFIG=	${PREFIX}/lib/gSculpt
 
 DATADIR=	${PREFIX}/share/gSculpt
 
-NO_STAGE=	yes
+DESKTOP_ENTRIES="gSculpt" "" \
+		"${DATADIR}/gsimages/gSculpt_Glass_Master_by_Gary_Rose.png" \
+		"${PORTNAME}" "Graphics;GTK;" ""
+
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
@@ -53,11 +54,21 @@ post-patch:
 		 /^cppLibs/s|BackgroundModel|BackgroundMesh|" \
 		${WRKSRC}/SConstruct
 	@${REINPLACE_CMD} -e \
-		"/^prefix/s|=.*|= '${PREFIX}'| ; \
+		"/^prefix/s|=.*|= '${STAGEDIR}${PREFIX}'| ; \
 		 /^gSculptStartDir/s|=.*|= os.path.join( pysitelibdir )|" \
 		${WRKSRC}/SConstruct-install
+	@${REINPLACE_CMD} -e \
+		"s|#GSCULPT_LIBRARY_PATH#|${LOCALBASE}/lib/gSculpt|; \
+		 s|python|${PYTHON_CMD}|; \
+		 s|#GSCULPT_START#|${PYTHONPREFIX_SITELIBDIR}/gsculpt.py|" \
+		${WRKSRC}/posixbuild/gsculpt
 
 do-install:
-	@cd ${WRKSRC} && ${SCONS_BIN} -f SConstruct-install ${PREFIX}
+	@(cd ${WRKSRC} && ${SCONS} -f SConstruct-install install)
+	@(cd ${STAGEDIR}${PREFIX} && ${PYTHON_CMD} -m compileall \
+		-d ${PREFIX} -f ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;})
+	@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/Britefury \
+		-name "*.so" -exec ${STRIP_CMD} {} \;
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/gSculpt/*.so
 
 .include <bsd.port.post.mk>

Added: head/graphics/gsculpt/files/patch-cpp__Util__Pool.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/gsculpt/files/patch-cpp__Util__Pool.h	Fri Dec 27 14:05:59 2013	(r337731)
@@ -0,0 +1,10 @@
+--- cpp/Util/Pool.h.orig
++++ cpp/Util/Pool.h
+@@ -8,6 +8,7 @@
+ #ifndef POOL_H__
+ #define POOL_H__
+ 
++#include <cstdlib>
+ #include <memory.h>
+ 
+ #include <Util/Array.h>

Modified: head/graphics/gsculpt/pkg-plist
==============================================================================
--- head/graphics/gsculpt/pkg-plist	Fri Dec 27 13:17:27 2013	(r337730)
+++ head/graphics/gsculpt/pkg-plist	Fri Dec 27 14:05:59 2013	(r337731)
@@ -486,6 +486,7 @@ lib/gSculpt/libView.so
 %%PYTHON_SITELIBDIR%%/Britefury/gSculptConfig/gSculptConfig.pyc
 %%PYTHON_SITELIBDIR%%/Britefury/gSculptConfig/gSculptUserConfig.pyc
 %%PYTHON_SITELIBDIR%%/gsculpt.py
+%%PYTHON_SITELIBDIR%%/gsculpt.pyc
 %%DATADIR%%/gsimages/background_images.png
 %%DATADIR%%/gsimages/background_models.png
 %%DATADIR%%/gsimages/draw_backg_transparent.png
_______________________________________________
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 5 Pawel Pekala freebsd_committer freebsd_triage 2013-12-27 14:06:59 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!
Comment 6 dfilter service freebsd_committer freebsd_triage 2013-12-28 17:59:55 UTC
Author: pawel
Date: Sat Dec 28 17:59:47 2013
New Revision: 337888
URL: http://svnweb.freebsd.org/changeset/ports/337888

Log:
  MFH: r337731
  
  - Fix build with clang
  - Remove leading article from COMMENT
  - Add desktop entry file
  - Strip library objects
  - Support staging
  
  Yes, I use prefix=${STAGEDIR}${PREFIX} here, after a long while it was
  5 lines of REINPLACE_CMD vs rewriting scons install script.
  
  <badmouthing of scons goes here>
  
  PR:		ports/184868
  Submitted by:	KATO Tsuguru <tkato432@yahoo.com>
  Approved by:    portmgr

Added:
  branches/2014Q1/graphics/gsculpt/files/patch-cpp__Util__Pool.h
     - copied unchanged from r337731, head/graphics/gsculpt/files/patch-cpp__Util__Pool.h
Modified:
  branches/2014Q1/graphics/gsculpt/Makefile
  branches/2014Q1/graphics/gsculpt/pkg-plist   (contents, props changed)
Directory Properties:
  branches/2014Q1/   (props changed)

Modified: branches/2014Q1/graphics/gsculpt/Makefile
==============================================================================
--- branches/2014Q1/graphics/gsculpt/Makefile	Sat Dec 28 17:58:09 2013	(r337887)
+++ branches/2014Q1/graphics/gsculpt/Makefile	Sat Dec 28 17:59:47 2013	(r337888)
@@ -3,13 +3,13 @@
 
 PORTNAME=	gsculpt
 PORTVERSION=	0.99.47
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	graphics
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${DISTNAME:S,-src,,}
 DISTNAME=	gSculpt-${PORTVERSION}-alpha-src
 
 MAINTAINER=	ports@FreeBSD.org
-COMMENT=	An Opensource 3D modelling application
+COMMENT=	Opensource 3D modelling application
 
 LICENSE=	GPLv2
 
@@ -19,18 +19,19 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}open
 
 WRKSRC=		${WRKDIR}/${DISTNAME:S,-src,,}
 
-USES=		pkgconfig
+USES=		pkgconfig scons
 USE_GNOME=	pygtk2
 USE_GL=		glu
 USE_XORG=	x11
-USE_PYTHON=	2.4+
-USE_SCONS=	yes
-SCONS_BUILDENV=	${SCONS_ENV}
+USE_PYTHON=	2
 USE_LDCONFIG=	${PREFIX}/lib/gSculpt
 
 DATADIR=	${PREFIX}/share/gSculpt
 
-NO_STAGE=	yes
+DESKTOP_ENTRIES="gSculpt" "" \
+		"${DATADIR}/gsimages/gSculpt_Glass_Master_by_Gary_Rose.png" \
+		"${PORTNAME}" "Graphics;GTK;" ""
+
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
@@ -53,11 +54,21 @@ post-patch:
 		 /^cppLibs/s|BackgroundModel|BackgroundMesh|" \
 		${WRKSRC}/SConstruct
 	@${REINPLACE_CMD} -e \
-		"/^prefix/s|=.*|= '${PREFIX}'| ; \
+		"/^prefix/s|=.*|= '${STAGEDIR}${PREFIX}'| ; \
 		 /^gSculptStartDir/s|=.*|= os.path.join( pysitelibdir )|" \
 		${WRKSRC}/SConstruct-install
+	@${REINPLACE_CMD} -e \
+		"s|#GSCULPT_LIBRARY_PATH#|${LOCALBASE}/lib/gSculpt|; \
+		 s|python|${PYTHON_CMD}|; \
+		 s|#GSCULPT_START#|${PYTHONPREFIX_SITELIBDIR}/gsculpt.py|" \
+		${WRKSRC}/posixbuild/gsculpt
 
 do-install:
-	@cd ${WRKSRC} && ${SCONS_BIN} -f SConstruct-install ${PREFIX}
+	@(cd ${WRKSRC} && ${SCONS} -f SConstruct-install install)
+	@(cd ${STAGEDIR}${PREFIX} && ${PYTHON_CMD} -m compileall \
+		-d ${PREFIX} -f ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;})
+	@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/Britefury \
+		-name "*.so" -exec ${STRIP_CMD} {} \;
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/gSculpt/*.so
 
 .include <bsd.port.post.mk>

Copied: branches/2014Q1/graphics/gsculpt/files/patch-cpp__Util__Pool.h (from r337731, head/graphics/gsculpt/files/patch-cpp__Util__Pool.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/graphics/gsculpt/files/patch-cpp__Util__Pool.h	Sat Dec 28 17:59:47 2013	(r337888, copy of r337731, head/graphics/gsculpt/files/patch-cpp__Util__Pool.h)
@@ -0,0 +1,10 @@
+--- cpp/Util/Pool.h.orig
++++ cpp/Util/Pool.h
+@@ -8,6 +8,7 @@
+ #ifndef POOL_H__
+ #define POOL_H__
+ 
++#include <cstdlib>
+ #include <memory.h>
+ 
+ #include <Util/Array.h>

Modified: branches/2014Q1/graphics/gsculpt/pkg-plist
==============================================================================
--- branches/2014Q1/graphics/gsculpt/pkg-plist	Sat Dec 28 17:58:09 2013	(r337887)
+++ branches/2014Q1/graphics/gsculpt/pkg-plist	Sat Dec 28 17:59:47 2013	(r337888)
@@ -486,6 +486,7 @@ lib/gSculpt/libView.so
 %%PYTHON_SITELIBDIR%%/Britefury/gSculptConfig/gSculptConfig.pyc
 %%PYTHON_SITELIBDIR%%/Britefury/gSculptConfig/gSculptUserConfig.pyc
 %%PYTHON_SITELIBDIR%%/gsculpt.py
+%%PYTHON_SITELIBDIR%%/gsculpt.pyc
 %%DATADIR%%/gsimages/background_images.png
 %%DATADIR%%/gsimages/background_models.png
 %%DATADIR%%/gsimages/draw_backg_transparent.png
_______________________________________________
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"