1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

- Fix run-time segmentation fault [1]

- Convert to new LIB_DEPENDS format
- Fix build with clang (no longer depends on GCC)
- Statically link against own library libcommon.a, to avoid
  installing a library with such a generic name as libcommon.so

PR:		183474 [1]
Submitted by:	Pierre Smars <smars@yuntech.edu.tw> [1]
This commit is contained in:
Pietro Cerutti 2013-10-31 17:19:27 +00:00
parent 39d0ad4a0b
commit 4532f38559
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=332268
13 changed files with 128 additions and 41 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= meshlab
DISTVERSION= 1.3.2
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= cad
MASTER_SITES= ${MASTER_SITE_LOCAL}/gahr/ \
http://people.freebsd.org/~gahr/distfiles/
@ -12,23 +12,29 @@ MAINTAINER= gahr@FreeBSD.org
COMMENT= 3D triangular meshes processing and editing tool
EXTRACT_DEPENDS=7z:${PORTSDIR}/archivers/p7zip
LIB_DEPENDS= QtSolutions_SOAP-head:${PORTSDIR}/devel/qt4-qtsolutions-soap
LIB_DEPENDS= libQtSolutions_SOAP-head.so:${PORTSDIR}/devel/qt4-qtsolutions-soap
USE_GCC= yes
USE_GL= glew glu
USE_QT4= qmake_build moc_build rcc_build uic_build corelib gui xml \
xmlpatterns opengl network script
USE_DOS2UNIX= external/structuresynth/ssynth/SyntopiaCore/GLEngine/Object3D.h
USE_LDCONFIG= yes
USE_DOS2UNIX= external/structuresynth/ssynth/SyntopiaCore/GLEngine/Object3D.h \
meshlabplugins/edit_arc3D/fillImage.cpp
WRKSRC= ${WRKDIR}/${DISTNAME}/${PORTNAME}/src
NO_STAGE= yes
post-patch:
${MV} "${WRKSRC}/distrib/shaders/electronic microscope.gdp" \
${WRKSRC}/distrib/shaders/electronic_microscope.gdp
${MV} "${WRKSRC}/distrib/shaders/shadersrm/old/Depth of Field.rfx" \
${WRKSRC}/distrib/shaders/shadersrm/old/Depth_of_Field.rfx
${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
${WRKSRC}/common/pluginmanager.cpp
.if defined(MAINTAINER_MODE)
${FIND} ${WRKSRC}/../../ -name "*.pro" | ${XARGS} \
${REINPLACE_CMD} -e '/^CONFIG +=/s|$$| debug|'
.endif
do-configure:
cd ${WRKSRC}/external && ${QMAKE} -spec ${QMAKESPEC} -recursive external.pro
cd ${WRKSRC} && ${QMAKE} -spec ${QMAKESPEC} -recursive meshlab_full.pro
@ -38,15 +44,11 @@ do-build:
cd ${WRKSRC} && ${MAKE}
do-install:
${INSTALL_DATA} ${WRKSRC}/common/libcommon.so.1.0.0 ${PREFIX}/lib
${LN} -sf ${PREFIX}/lib/libcommon.so.1.0.0 ${PREFIX}/lib/libcommon.so.1.0
${LN} -sf ${PREFIX}/lib/libcommon.so.1.0 ${PREFIX}/lib/libcommon.so.1
${LN} -sf ${PREFIX}/lib/libcommon.so.1 ${PREFIX}/lib/libcommon.so
${MKDIR} ${PREFIX}/lib/meshlab/plugins
cd ${WRKSRC}/distrib/plugins && ${COPYTREE_SHARE} \*.so ${PREFIX}/lib/meshlab/plugins
${MKDIR} ${PREFIX}/lib/meshlab/shaders
cd ${WRKSRC}/distrib/shaders && ${COPYTREE_SHARE} \* ${PREFIX}/lib/meshlab/shaders
${INSTALL_PROGRAM} ${WRKSRC}/distrib/meshlab ${PREFIX}/lib/meshlab
${LN} -sf ${PREFIX}/lib/meshlab/meshlab ${PREFIX}/bin
${MKDIR} ${STAGEDIR}${PREFIX}/lib/meshlab/plugins
cd ${WRKSRC}/distrib/plugins && ${COPYTREE_SHARE} \*.so ${STAGEDIR}${PREFIX}/lib/meshlab/plugins
${MKDIR} ${STAGEDIR}${PREFIX}/lib/meshlab/shaders
cd ${WRKSRC}/distrib/shaders && ${COPYTREE_SHARE} \* ${STAGEDIR}${PREFIX}/lib/meshlab/shaders
${INSTALL_PROGRAM} ${WRKSRC}/distrib/meshlab ${STAGEDIR}${PREFIX}/lib/meshlab
${LN} -sf ${PREFIX}/lib/meshlab/meshlab ${STAGEDIR}${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -1,19 +1,8 @@
--- common/common.pro.orig 2013-05-07 10:06:45.000000000 +0200
+++ common/common.pro 2013-05-07 10:09:47.000000000 +0200
@@ -62,6 +62,9 @@
linux-g++-64:CONFIG += dll
linux-g++-64:DESTDIR = ../distrib
+freebsd:CONFIG += dll
+freebsd:DESTDIR = ../distrib
+
win32-msvc2005:CONFIG += staticlib
win32-msvc2008:CONFIG += staticlib
win32-msvc2010:CONFIG += staticlib
@@ -124,5 +127,6 @@
linux-g++:LIBS += -L../external/lib/linux-g++ -ljhead
linux-g++-32:LIBS += -L../external/lib/linux-g++-32 -ljhead
--- common/common.pro.orig 2013-10-31 13:57:32.000000000 +0100
+++ common/common.pro 2013-10-31 14:00:10.000000000 +0100
@@ -126,3 +126,5 @@
linux-g++-64:LIBS += -L../external/lib/linux-g++-64 -ljhead
+freebsd:LIBS += -L../external/lib/freebsd -ljhead
#RESOURCES = common.qrc
+
+CONFIG += static

View File

@ -0,0 +1,13 @@
--- meshlab/mainwindow_RunTime.cpp.orig 2013-10-31 16:02:53.000000000 +0100
+++ meshlab/mainwindow_RunTime.cpp 2013-10-31 16:04:13.000000000 +0100
@@ -1575,7 +1575,9 @@
/*********WARNING!!!!!! CHANGE IT!!! ALSO IN THE OPENPROJECT FUNCTION********/
meshDoc()->setDocLabel(fileName);
- mdiarea->activeSubWindow()->setWindowTitle(meshDoc()->docLabel());
+ if (mdiarea->activeSubWindow()) {
+ mdiarea->activeSubWindow()->setWindowTitle(meshDoc()->docLabel());
+ }
layerDialog->setWindowTitle(meshDoc()->docLabel());
/****************************************************************************/

View File

@ -4,7 +4,7 @@
linux-g++-64:LIBS += -L../external/lib/linux-g++-64 -L../distrib -lcommon -lGLU
linux-g++-64:QMAKE_RPATHDIR += ../distrib
+LIBS += -L../external/jhead-2.95 -L../common -lcommon -lGLU -ljhead
+LIBS += -L../external/jhead-2.95 ../common/libcommon.a -lGLU -ljhead
+QMAKE_RPATHDIR += ../distrib
+
# uncomment in your local copy only in emergency cases.

View File

@ -0,0 +1,10 @@
--- meshlabplugins/edit_arc3D/fillImage.cpp.orig 2013-10-31 10:47:05.000000000 +0100
+++ meshlabplugins/edit_arc3D/fillImage.cpp 2013-10-31 10:52:27.000000000 +0100
@@ -22,6 +22,7 @@
****************************************************************************/
#include "fillImage.h"
+#include <cstdlib>
#include <cmath>
#include <limits>

View File

@ -0,0 +1,11 @@
--- meshlabplugins/filter_poisson/src/Geometry.inl.orig 2013-10-31 09:51:50.000000000 +0100
+++ meshlabplugins/filter_poisson/src/Geometry.inl 2013-10-31 09:52:01.000000000 +0100
@@ -26,6 +26,8 @@
DAMAGE.
*/
+#include <stdlib.h>
+
template<class Real>
Real Random(void){return Real(rand())/RAND_MAX;}

View File

@ -4,7 +4,7 @@
linux-g++-32:QMAKE_RPATHDIR += ../distrib
linux-g++-64: LIBS += -L../distrib -lcommon
linux-g++-64:QMAKE_RPATHDIR += ../distrib
+LIBS += -L../common -lcommon -L../external/jhead-2.95 -ljhead
+LIBS += ../common/libcommon.a -L../external/jhead-2.95 -ljhead
+QMAKE_RPATHDIR += ../distrib
#CONFIG (release,debug | release) {
# win32-msvc2005:release: LIBS += -L../common/release -lcommon

View File

@ -0,0 +1,8 @@
--- shared.pri.orig 2012-07-31 07:43:04.000000000 +0200
+++ shared.pri 2013-10-31 12:18:49.000000000 +0100
@@ -72,3 +72,5 @@
win32-msvc2005: RCC_DIR = $(ConfigurationName)
win32-msvc2008: RCC_DIR = $(ConfigurationName)
win32-msvc2010: RCC_DIR = $(ConfigurationName)
+
+LIBS+=../../common/libcommon.a

View File

@ -0,0 +1,17 @@
--- ../../vcglib/vcg/complex/algorithms/subset.h.orig 2013-10-31 09:34:59.000000000 +0100
+++ ../../vcglib/vcg/complex/algorithms/subset.h 2013-10-31 09:35:06.000000000 +0100
@@ -86,12 +86,12 @@
return (v<o.v);
}
- bool operator ==(const InsertedV & o)
+ bool operator ==(const InsertedV & o) const
{
return (v==o.v);
}
- bool operator !=(const InsertedV & o)
+ bool operator !=(const InsertedV & o) const
{
return (v!=o.v);
}

View File

@ -0,0 +1,12 @@
--- ../../vcglib/vcg/math/base.h.orig 2012-04-05 11:04:15.000000000 +0200
+++ ../../vcglib/vcg/math/base.h 2013-10-31 11:09:34.000000000 +0100
@@ -94,7 +94,9 @@
/// static_assert: implemented as a macro for "assert", but it is separated for clarity.
/// Should be used for checking integrity constraints that can be tested at complile time,
/// as the ones involving templated constants in templated classes.
+#ifndef static_assert
#define static_assert assert
+#endif
#ifdef __BORLANDC__
float sqrtf (float v) {return sqrt(v);}

View File

@ -0,0 +1,19 @@
--- ../../vcglib/vcg/space/deprecated_point.h.orig 2013-10-30 18:12:59.000000000 +0100
+++ ../../vcglib/vcg/space/deprecated_point.h 2013-10-30 18:12:33.000000000 +0100
@@ -164,14 +164,14 @@
}
inline const S &X() const { return _v[0]; }
inline const S &Y() const { return _v[1]; }
- inline const S &Z() const { static_assert(N>2); return _v[2]; }
+ inline const S &Z() const { static_assert(N>2, ""); return _v[2]; }
/// W is in any case the last coordinate.
/// (in a 2D point, W() == Y(). In a 3D point, W()==Z()
/// in a 4D point, W() is a separate component)
inline const S &W() const { return _v[N-1]; }
inline S &X() { return _v[0]; }
inline S &Y() { return _v[1]; }
- inline S &Z() { static_assert(N>2); return _v[2]; }
+ inline S &Z() { static_assert(N>2, ""); return _v[2]; }
inline S &W() { return _v[N-1]; }
inline const S * V() const
{

View File

@ -0,0 +1,10 @@
--- ../../vcglib/wrap/ply/plystuff.h.orig 2013-10-31 09:44:03.000000000 +0100
+++ ../../vcglib/wrap/ply/plystuff.h 2013-10-31 09:50:52.000000000 +0100
@@ -75,6 +75,7 @@
#define pb_close _close
#define DIR_SEP "\\"
#else
+#include <unistd.h>
#define pb_mkdir(n) mkdir(n,0755)
#define pb_access access
#define pb_stat stat

View File

@ -1,8 +1,4 @@
bin/meshlab
lib/libcommon.so.1.0.0
lib/libcommon.so.1.0
lib/libcommon.so.1
lib/libcommon.so
lib/meshlab/meshlab
lib/meshlab/plugins/libdecorate_background.so
lib/meshlab/plugins/libdecorate_base.so
@ -116,7 +112,7 @@ lib/meshlab/shaders/depthmap.vert
lib/meshlab/shaders/dimple.frag
lib/meshlab/shaders/dimple.gdp
lib/meshlab/shaders/dimple.vert
lib/meshlab/shaders/electronic microscope.gdp
lib/meshlab/shaders/electronic_microscope.gdp
lib/meshlab/shaders/envmap.frag
lib/meshlab/shaders/envmap.gdp
lib/meshlab/shaders/envmap.vert
@ -149,7 +145,7 @@ lib/meshlab/shaders/shadersrm/PhongUntextured.rfx
lib/meshlab/shaders/shadersrm/QualityContour.rfx
lib/meshlab/shaders/shadersrm/ZBrush.rfx
lib/meshlab/shaders/shadersrm/cartoon.rfx
lib/meshlab/shaders/shadersrm/old/Depth of Field.rfx
lib/meshlab/shaders/shadersrm/old/Depth_of_Field.rfx
lib/meshlab/shaders/shadersrm/old/GlyphBomb.rfx
lib/meshlab/shaders/shadersrm/old/ImageBasedLighting.rfx
lib/meshlab/shaders/shadersrm/old/Plastic.rfx