ports/120058: Update port: graphics/xaraxl: Allow use of jemalloc with FreeBSD >= 7.0
Dave Grochowski
malus.x at gmail.com
Sun Jan 27 21:10:01 UTC 2008
>Number: 120058
>Category: ports
>Synopsis: Update port: graphics/xaraxl: Allow use of jemalloc with FreeBSD >= 7.0
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 27 21:10:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Dave Grochowski
>Release: 7.0-PRERELEASE
>Organization:
Lockheed Martin
>Environment:
FreeBSD wanderer 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #17: Wed Jan 23 23:27:05 EST 2008 root at wanderer:/usr/obj/usr/src/sys/WANDERER i386
>Description:
Currently, xaralx uses dlmalloc because FreeBSD was lacking malloc_usable_size(). However, this function has been added to FreeBSD, so this library is no longer necessary in newer versions of FreeBSD. The patch provided checks for the FreeBSD version and determines whether or not dlmalloc is needed.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -urN graphics/xaralx.orig/Makefile graphics/xaralx/Makefile
--- graphics/xaralx.orig/Makefile 2008-01-27 15:44:24.000000000 -0500
+++ graphics/xaralx/Makefile 2008-01-27 15:45:02.000000000 -0500
@@ -7,7 +7,7 @@
PORTNAME= XaraLX
PORTVERSION?= 0.7r1692
-PORTREVISION?= 2
+PORTREVISION?= 3
CATEGORIES= graphics
MASTER_SITES= http://downloads.xara.com/opensource/ \
${MASTER_SITE_LOCAL}
@@ -24,18 +24,14 @@
xml2-config:${PORTSDIR}/textproc/libxml2 \
zip:${PORTSDIR}/archivers/zip
RUN_DEPENDS+= convert:${PORTSDIR}/graphics/ImageMagick
-LIB_DEPENDS+= dlmalloc.2:${PORTSDIR}/devel/libdlmalloc \
- xml2.5:${PORTSDIR}/textproc/libxml2
+LIB_DEPENDS+= xml2.5:${PORTSDIR}/textproc/libxml2
USE_AUTOTOOLS= autoconf:261:env aclocal:19:env automake:19:env libtool:15:env
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS+= --program-suffix=${PKGNAMESUFFIX}
-# we're using dlmalloc because the stock libc does not have malloc_usable_size()
-CONFIGURE_ENV+= LIBS="-L${LOCALBASE}/lib -ldlmalloc"
USE_GMAKE= yes
-MAKE_ENV?= INCLUDES="-I${LOCALBASE}/include/dlmalloc" LANG=C
USE_GCC= 3.4+
USE_WX= 2.6
@@ -73,6 +69,15 @@
BROKEN= does not configure due to the lack of CDraw libraries for ${ARCH}
.endif
+.if ${OSVERSION} < 700036
+# we're using dlmalloc because the stock libc does not have malloc_usable_size()
+LIB_DEPENDS+= dlmalloc.2:${PORTSDIR}/devel/libdlmalloc \
+CONFIGURE_ENV+= LIBS="-L${LOCALBASE}/lib -ldlmalloc"
+MAKE_ENV?= INCLUDES="-I${LOCALBASE}/include/dlmalloc" LANG=C
+.else
+CFLAGS+= -DHAVE_SYS_PARAM_H
+.endif
+
post-patch:
${REINPLACE_CMD} -E \
-e 's/^Name=Xara Xtreme$$/Name=Xara Xtreme ${PORTVERSION}/' \
@@ -81,6 +86,13 @@
-e 's/^Exec=xaralx %F$$/Exec=xaralx${PKGNAMESUFFIX} %F/' \
-e 's/^TryExec=xaralx$$/TryExec=xaralx${PKGNAMESUFFIX}/' \
${WRKSRC}/xaralx.desktop
+.if ${OSVERSION} >= 700036
+ ${REINPLACE_CMD} \
+ -e 's/malloc\/malloc.h/stdlib.h/' \
+ -e 's/malloc.h/stdlib.h/' \
+ ${WRKSRC}/wxOil/fixmem.cpp \
+ ${WRKSRC}/wxOil/stdwx.h
+.endif
pre-configure:
cd ${WRKSRC} && \
diff -urN graphics/xaralx.orig/files/patch-wxOil_compatdef.h graphics/xaralx/files/patch-wxOil_compatdef.h
--- graphics/xaralx.orig/files/patch-wxOil_compatdef.h 1969-12-31 19:00:00.000000000 -0500
+++ graphics/xaralx/files/patch-wxOil_compatdef.h 2008-01-27 15:00:20.000000000 -0500
@@ -0,0 +1,25 @@
+--- wxOil/compatdef.h.orig 2006-08-10 15:36:43.000000000 -0400
++++ wxOil/compatdef.h 2008-01-27 14:59:29.000000000 -0500
+@@ -96,6 +96,9 @@
+ =================================XARAHEADEREND============================
+ */
+
++#ifdef HAVE_SYS_PARAM_H
++#include <sys/param.h>
++#endif
+ #ifndef INC_COMPATDEF
+ #define INC_COMPATDEF
+
+@@ -595,6 +598,12 @@
+ const size_t MAX_PATH = 256;
+
+ #if !defined(__WXMAC__)
++#if __FreeBSD__ >= 7
++#include <osreldate.h>
++#if __FreeBSD_version >= 700036
++#include <malloc_np.h>
++#endif
++#endif
+ inline size_t _msize( PVOID ptr )
+ {
+ return malloc_usable_size( ptr );
diff -urN graphics/xaralx-devel.orig/Makefile graphics/xaralx-devel/Makefile
--- graphics/xaralx-devel.orig/Makefile 2008-01-27 15:43:16.000000000 -0500
+++ graphics/xaralx-devel/Makefile 2008-01-27 15:45:33.000000000 -0500
@@ -6,7 +6,7 @@
#
PORTVERSION= 0.7r1768
-PORTREVISION= 0
+PORTREVISION= 1
PKGNAMESUFFIX= -devel
DISTFILES= ${PORTNAME}-${PORTVERSION}.tar.bz2
@@ -16,6 +16,7 @@
MD5_FILE= ${.CURDIR}/distinfo
PLIST= ${.CURDIR}/pkg-plist
PATCHDIR= ${.CURDIR}/files
-EXTRA_PATCHES= ${MASTERDIR}/files/patch-configure.in
+EXTRA_PATCHES= ${MASTERDIR}/files/patch-configure.in \
+ ${MASTERDIR}/files/patch-wxOil_compatdef.h
.include "${MASTERDIR}/Makefile"
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list