Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 2013 16:02:01 +0200
From:      nemysis <nemysis@FreeBSD.org>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        amdmi3@FreeBSD.org
Subject:   ports/182205: [PATCH] graphics/osg: Fixes build of dependant ports with Clang
Message-ID:  <201309181402.r8IE21cQ010780@freefall.freebsd.org>
Resent-Message-ID: <201309181410.r8IEA0IH011255@freefall.freebsd.org>

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

>Number:         182205
>Category:       ports
>Synopsis:       [PATCH] graphics/osg: Fixes build of dependant ports with Clang
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 18 14:10: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
- Use the new format for LIB_DEPENDS
- Remove useless USE_GCC=any
- Add FFMPEG to default Options
- Remove unneeded Comment and Option, change pkg-plist
- Add OPTIONS_SUB
- Add patches, fix build with Clang

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

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

Build log

https://redports.org/buildarchive/20130918115300-57150/

All Ports which use graphics/osg can't be builded with Clang

pkg info | grep osg
osg-3.0.1_5                    C++ OpenGL scene graph library for real-time rendering

/usr/local/include/OpenThreads/Atomic:244:48: error: cannot initialize a parameter of type 'void *' with an lvalue of type 'const void *const'
    return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);
                                               ^~~~~~

>Fix:

--- osg-3.0.1_6.patch begins here ---
diff -ruN /usr/ports/graphics/osg/Makefile ./Makefile
--- /usr/ports/graphics/osg/Makefile	2013-09-13 02:57:02.000000000 +0200
+++ ./Makefile	2013-09-18 13:50:41.000000000 +0200
@@ -3,7 +3,7 @@
 
 PORTNAME=	osg
 PORTVERSION=	3.0.1
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	graphics
 MASTER_SITES=	http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-${PORTVERSION}/source/ \
 		http://mirror.amdmi3.ru/distfiles/
@@ -12,19 +12,18 @@
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	C++ OpenGL scene graph library for real-time rendering
 
-LIB_DEPENDS=	jpeg:${PORTSDIR}/graphics/jpeg \
-		png15:${PORTSDIR}/graphics/png \
-		tiff:${PORTSDIR}/graphics/tiff
+LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
+		libpng.so:${PORTSDIR}/graphics/png \
+		libtiff.so:${PORTSDIR}/graphics/tiff
 
 CONFLICTS=	osg-devel-[0-9]*
 
-USE_GCC=	any
 USE_ZIP=	yes
 USES=		cmake pkgconfig
 USE_GL=		gl glu
 USE_XORG=	x11
-USE_LDCONFIG=	yes
 USE_GCC=	4.2+
+USE_LDCONFIG=	yes
 
 PLIST_SUB=	OSG_VERSION=${PORTVERSION} \
 		OSG_SHLIBVER=80 \
@@ -35,16 +34,34 @@
 
 OPTIONS_DEFINE=	CURL FREETYPE GDAL GIF INVENTOR JASPER XINE ITK \
 		VNC OPENEXR FFMPEG SVG PDF XRANDR SDL
+
 GDAL_DESC=	GDAL support
 INVENTOR_DESC=	SGI OpenInventor support
 ITK_DESC=	InsightToolkit support
 VNC_DESC=	LibVNCServer support
 SDL_DESC=	Use SDL (joystick support in present3d)
 
-OPTIONS_DEFAULT=	FREETYPE GIF XRANDR
+OPTIONS_SUB=	yes
 
-# broken (openvrml from ports is too old)
-#		OPENVRML "Support for OpenVRML"             off
+OPTIONS_DEFAULT=	FREETYPE GIF FFMPEG XRANDR
+
+CURL_LIB_DEPENDS=	libcurl.so:${PORTSDIR}/ftp/curl
+FREETYPE_LIB_DEPENDS=	libfreetype.so:${PORTSDIR}/print/freetype2
+GDAL_LIB_DEPENDS=	libgdal.so:${PORTSDIR}/graphics/gdal
+GIF_LIB_DEPENDS=	libgif.so:${PORTSDIR}/graphics/giflib
+INVENTOR_BUILD_DEPENDS=	${LOCALBASE}/lib/libInventor.so:${PORTSDIR}/graphics/inventor
+INVENTOR_RUN_DEPENDS=	${LOCALBASE}/lib/libInventor.so:${PORTSDIR}/graphics/inventor
+JASPER_LIB_DEPENDS=	libjasper.so:${PORTSDIR}/graphics/jasper
+XINE_LIB_DEPENDS=	libxine.so:${PORTSDIR}/multimedia/libxine
+ITK_BUILD_DEPENDS=	${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit
+ITK_RUN_DEPENDS=	${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit
+VNC_LIB_DEPENDS=	libvncserver.so:${PORTSDIR}/net/libvncserver
+OPENEXR_LIB_DEPENDS=	libIlmImf.so:${PORTSDIR}/graphics/OpenEXR
+FFMPEG_LIB_DEPENDS=	libavcodec.so:${PORTSDIR}/multimedia/ffmpeg
+SVG_LIB_DEPENDS=	librsvg-2.so:${PORTSDIR}/graphics/librsvg2
+PDF_LIB_DEPENDS=	libpoppler-glib.so:${PORTSDIR}/graphics/poppler-glib
+XRANDR_CMAKE_ON=	-DOSGVIEWER_USE_XRANDR:BOOL=ON
+XRANDR_CMAKE_OFF=	-DOSGVIEWER_USE_XRANDR:BOOL=OFF
 
 .include <bsd.port.options.mk>
 
@@ -56,113 +73,71 @@
 # options that affect FIND_PACKAGE
 .if ${PORT_OPTIONS:MCURL}
 FORCE_REQUIRE+=	CURL
-LIB_DEPENDS+=	curl:${PORTSDIR}/ftp/curl
-PLIST_SUB+=	CURL=""
 .else
 FORCE_IGNORE+=	CURL
-PLIST_SUB+=	CURL="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MFREETYPE}
 FORCE_REQUIRE+=	FreeType
-LIB_DEPENDS+=	freetype:${PORTSDIR}/print/freetype2
-PLIST_SUB+=	FREETYPE=""
 .else
 FORCE_IGNORE+=	FreeType
-PLIST_SUB+=	FREETYPE="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MGDAL}
 FORCE_REQUIRE+=	GDAL
-LIB_DEPENDS+=	gdal:${PORTSDIR}/graphics/gdal
-PLIST_SUB+=	GDAL=""
 .else
 FORCE_IGNORE+=	GDAL
-PLIST_SUB+=	GDAL="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MGIF}
 FORCE_REQUIRE+=	GIFLIB
-LIB_DEPENDS+=	gif:${PORTSDIR}/graphics/giflib
-PLIST_SUB+=	GIF=""
 .else
 FORCE_IGNORE+=	GIFLIB
-PLIST_SUB+=	GIF="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MINVENTOR}
 FORCE_REQUIRE+=	Inventor
-BUILD_DEPENDS+=	${LOCALBASE}/lib/libInventor.so:${PORTSDIR}/graphics/inventor
-RUN_DEPENDS+=	${LOCALBASE}/lib/libInventor.so:${PORTSDIR}/graphics/inventor
-PLIST_SUB+=	INVENTOR=""
 .else
 FORCE_IGNORE+=	Inventor
-PLIST_SUB+=	INVENTOR="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MJASPER}
 FORCE_REQUIRE+=	Jasper
-LIB_DEPENDS+=	jasper:${PORTSDIR}/graphics/jasper
-PLIST_SUB+=	JASPER=""
 .else
 FORCE_IGNORE+=	Jasper
-PLIST_SUB+=	JASPER="@comment "
 .endif
 
-#.if ${PORT_OPTIONS:MOPENVRML}
-#FORCE_REQUIRE+=	OpenVRML
-#LIB_DEPENDS+=	openvrml:${PORTSDIR}/www/openvrml
-#PLIST_SUB+=	OPENVRML=""
-#.else
 FORCE_IGNORE+=	OpenVRML
-PLIST_SUB+=	OPENVRML="@comment "
-#.endif
 
 .if ${PORT_OPTIONS:MXINE}
 FORCE_REQUIRE+=	Xine
-LIB_DEPENDS+=	xine:${PORTSDIR}/multimedia/libxine
-PLIST_SUB+=	XINE=""
 .else
 FORCE_IGNORE+=	Xine
-PLIST_SUB+=	XINE="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MITK}
 FORCE_REQUIRE+=	ITK
-BUILD_DEPENDS+=	${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit
-RUN_DEPENDS+=	${LOCALBASE}/lib/InsightToolkit/UseITK.cmake:${PORTSDIR}/science/InsightToolkit
-PLIST_SUB+=	ITK=""
 CXXFLAGS+=	-DVCL_CAN_STATIC_CONST_INIT_FLOAT=0
 .else
 FORCE_IGNORE+=	ITK
-PLIST_SUB+=	ITK="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MVNC}
 FORCE_REQUIRE+=	LibVNCServer
-LIB_DEPENDS+=	vncserver:${PORTSDIR}/net/libvncserver
-PLIST_SUB+=	VNC=""
 .else
 FORCE_IGNORE+=	LibVNCServer
-PLIST_SUB+=	VNC="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MOPENEXR}
 FORCE_REQUIRE+=	OpenEXR
-LIB_DEPENDS+=	IlmImf:${PORTSDIR}/graphics/OpenEXR
-PLIST_SUB+=	OPENEXR=""
 .else
 FORCE_IGNORE+=	OpenEXR
-PLIST_SUB+=	OPENEXR="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MFFMPEG}
 FORCE_REQUIRE+=	FFmpeg
-LIB_DEPENDS+=	avcodec:${PORTSDIR}/multimedia/ffmpeg
-PLIST_SUB+=	FFMPEG=""
 .else
 FORCE_IGNORE+=	FFmpeg
-PLIST_SUB+=	FFMPEG="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MSDL}
@@ -175,39 +150,23 @@
 # options that affect PKG_CHECK_MODULES
 .if ${PORT_OPTIONS:MSVG}
 FORCE_REQUIRE+=	RSVG
-LIB_DEPENDS+=	rsvg-2:${PORTSDIR}/graphics/librsvg2
-PLIST_SUB+=	SVG=""
 .else
 FORCE_IGNORE+=	RSVG
-PLIST_SUB+=	SVG="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MPDF}
 FORCE_REQUIRE+=	Poppler-glib
-LIB_DEPENDS+=	poppler-glib:${PORTSDIR}/graphics/poppler-glib
-PLIST_SUB+=	PDF=""
 .else
 FORCE_IGNORE+=	Poppler-glib
-PLIST_SUB+=	PDF="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MSVG} || ${PORT_OPTIONS:MPDF}
-LIB_DEPENDS+=	cairo:${PORTSDIR}/graphics/cairo
+USE_GNOME=	cairo
 .endif
 
 # other options
 .if ${PORT_OPTIONS:MXRANDR}
-CMAKE_ARGS+=	-DOSGVIEWER_USE_XRANDR:BOOL=ON
-USE_XORG+=	xrandr
-.else
-CMAKE_ARGS+=	-DOSGVIEWER_USE_XRANDR:BOOL=OFF
-.endif
-
-.if ${PORT_OPTIONS:MXRANDR}
-CMAKE_ARGS+=	-DOSGVIEWER_USE_XRANDR:BOOL=ON
 USE_XORG+=	xrandr
-.else
-CMAKE_ARGS+=	-DOSGVIEWER_USE_XRANDR:BOOL=OFF
 .endif
 
 post-patch:
diff -ruN /usr/ports/graphics/osg/files/patch-include-OpenThreads-Atomic ./files/patch-include-OpenThreads-Atomic
--- /usr/ports/graphics/osg/files/patch-include-OpenThreads-Atomic	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-include-OpenThreads-Atomic	2013-09-18 12:42:50.000000000 +0200
@@ -0,0 +1,11 @@
+--- include/OpenThreads/Atomic.orig	2011-01-31 12:35:50.000000000 +0100
++++ include/OpenThreads/Atomic	2013-09-18 12:41:22.000000000 +0200
+@@ -241,7 +241,7 @@
+ AtomicPtr::assign(void* ptrNew, const void* const ptrOld)
+ {
+ #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
+-    return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);
++    return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew);
+ #elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
+     return __compare_and_swap((unsigned long*)&_ptr, (unsigned long)ptrOld, (unsigned long)ptrNew);
+ #elif defined(_OPENTHREADS_ATOMIC_USE_SUN)
diff -ruN /usr/ports/graphics/osg/files/patch-src-OpenThreads-common-Atomic.cpp ./files/patch-src-OpenThreads-common-Atomic.cpp
--- /usr/ports/graphics/osg/files/patch-src-OpenThreads-common-Atomic.cpp	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-src-OpenThreads-common-Atomic.cpp	2013-09-18 11:29:14.000000000 +0200
@@ -0,0 +1,11 @@
+--- src/OpenThreads/common/Atomic.cpp.orig	2011-04-19 13:40:22.000000000 +0200
++++ src/OpenThreads/common/Atomic.cpp	2013-09-18 11:26:03.000000000 +0200
+@@ -143,7 +143,7 @@
+ AtomicPtr::assign(void* ptrNew, const void* const ptrOld)
+ {
+ #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
+-    return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);
++    return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew);
+ #elif defined(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
+     return ptrOld == InterlockedCompareExchangePointer((PVOID volatile*)&_ptr, (PVOID)ptrNew, (PVOID)ptrOld);
+ #elif defined(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
diff -ruN /usr/ports/graphics/osg/pkg-plist ./pkg-plist
--- /usr/ports/graphics/osg/pkg-plist	2013-09-13 02:57:02.000000000 +0200
+++ ./pkg-plist	2013-09-18 11:33:46.000000000 +0200
@@ -672,7 +672,6 @@
 lib/osgPlugins-%%OSG_VERSION%%/osgdb_txf.so
 lib/osgPlugins-%%OSG_VERSION%%/osgdb_txp.so
 %%VNC%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_vnc.so
-%%OPENVRML%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_vrml.so
 lib/osgPlugins-%%OSG_VERSION%%/osgdb_vtf.so
 lib/osgPlugins-%%OSG_VERSION%%/osgdb_x.so
 %%XINE%%lib/osgPlugins-%%OSG_VERSION%%/osgdb_xine.so
--- osg-3.0.1_6.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?201309181402.r8IE21cQ010780>