From nobody@FreeBSD.org  Wed Mar 12 00:23:24 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id F1C3D45E
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Mar 2014 00:23:24 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id DE7B4904
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Mar 2014 00:23:24 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s2C0NO5Y064636
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Mar 2014 00:23:24 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s2C0NO7x064631;
	Wed, 12 Mar 2014 00:23:24 GMT
	(envelope-from nobody)
Message-Id: <201403120023.s2C0NO7x064631@cgiserv.freebsd.org>
Date: Wed, 12 Mar 2014 00:23:24 GMT
From: Craig Butler <craig001@lerwick.hopto.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: www/netsurf all images rendered red on sparc64
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         187466
>Category:       ports
>Synopsis:       www/netsurf all images rendered red on sparc64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    tijl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 12 00:30:00 UTC 2014
>Closed-Date:    Sat Mar 15 18:58:52 CET 2014
>Last-Modified:  Sat Mar 15 18:00:00 UTC 2014
>Originator:     Craig Butler
>Release:        9.2-RELEASE sparc64
>Organization:
>Environment:
FreeBSD blueeye.lerwick.hopto.org 9.2-RELEASE FreeBSD 9.2-RELEASE #0: Tue Oct  8 16:09:50 BST 2013     root@blueeye.lerwick.hopto.org:/usr/obj/usr/src/sys/GENERIC  sparc64
>Description:
When displaying webpages via netsurf all the images are mostly red.

example can be seen at - http://bsdtec.com/freebsd/netsurf-red-sparc64.png

Help -> About... -> Netsurf 3.0 (20th April 2013)
>How-To-Repeat:
compile netsurf on sparc64, run and navigate to any webpage with images.
>Fix:
unknown, not sure why it is rendering images incorrectly.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->tijl 
Responsible-Changed-By: tijl 
Responsible-Changed-When: Wed Mar 12 09:49:37 CET 2014 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=187466 

From: Tijl Coosemans <tijl@FreeBSD.org>
To: bug-followup@FreeBSD.org, craig001@lerwick.hopto.org
Cc:  
Subject: Re: ports/187466: www/netsurf all images rendered red on sparc64
Date: Wed, 12 Mar 2014 10:29:03 +0100

 --MP_/NWNTeg_Kr/E7V7T.0964_pD
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Hi Craig,
 
 Please try the attached patch and let me know if it works.
 --MP_/NWNTeg_Kr/E7V7T.0964_pD
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=netsurf.patch
 
 Index: www/netsurf/Makefile
 ===================================================================
 --- www/netsurf/Makefile	(revision 347869)
 +++ www/netsurf/Makefile	(working copy)
 @@ -51,7 +51,10 @@ BUILD_DEPENDS+=	gperf:${PORTSDIR}/devel/
  post-patch:
  	@${REINPLACE_CMD} '/^NSFB_LINUX_AVAILABLE/ s|yes|no| ; s| -g||' \
  		${WRKSRC}/src/libnsfb-${NSFB_VERSION}/Makefile
 -	@${REINPLACE_CMD} 's|endian|sys/endian|' \
 +	@${REINPLACE_CMD} \
 +		-e 's|endian\.h|sys/endian.h|' \
 +		-e 's|__BYTE_ORDER|_BYTE_ORDER|' \
 +		-e 's|__BIG_ENDIAN|_BIG_ENDIAN|' \
  		${WRKSRC}/src/libnsfb-${NSFB_VERSION}/src/plot/*bpp*.c
  	@${REINPLACE_CMD} 's| -O2||' \
  		${WRKSRC}/src/netsurf-${PORTVERSION}/gtk/Makefile.defaults
 
 --MP_/NWNTeg_Kr/E7V7T.0964_pD--

From: Craig Butler <craig001@lerwick.hopto.org>
To: Tijl Coosemans <tijl@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/187466: www/netsurf all images rendered red on sparc64
Date: Wed, 12 Mar 2014 16:40:32 +0000

 On Wed, 2014-03-12 at 10:29 +0100, Tijl Coosemans wrote:
 > Hi Craig,
 > 
 > Please try the attached patch and let me know if it works.
 
 Hello Tijl
 
 Thank you for the patch.  I have applied it and compiled again.  
 
 Unfortunately it doesn't appear to have made a difference.  Images are
 still red.
 
 Kind Regards
 
 Craig Butler
 
 
 

From: Tijl Coosemans <tijl@FreeBSD.org>
To: Craig Butler <craig001@lerwick.hopto.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/187466: www/netsurf all images rendered red on sparc64
Date: Wed, 12 Mar 2014 21:27:55 +0100

 On Wed, 12 Mar 2014 16:40:32 +0000 Craig Butler wrote:
 > On Wed, 2014-03-12 at 10:29 +0100, Tijl Coosemans wrote:
 >> Please try the attached patch and let me know if it works.
 > 
 > Thank you for the patch.  I have applied it and compiled again.  
 > 
 > Unfortunately it doesn't appear to have made a difference.  Images are
 > still red.
 
 Did this problem suddenly appear or is this the first time you use the
 browser?
 
 Does this happen with all image formats or only jpg?

From: Craig Butler <craig001@lerwick.hopto.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/187466: www/netsurf all images rendered red on sparc64
Date: Wed, 12 Mar 2014 23:34:15 +0000

 On Wed, 2014-03-12 at 21:27 +0100, Tijl Coosemans wrote:
 > On Wed, 12 Mar 2014 16:40:32 +0000 Craig Butler wrote:
 > > On Wed, 2014-03-12 at 10:29 +0100, Tijl Coosemans wrote:
 > >> Please try the attached patch and let me know if it works.
 > > 
 > > Thank you for the patch.  I have applied it and compiled again.  
 > > 
 > > Unfortunately it doesn't appear to have made a difference.  Images are
 > > still red.
 > 
 > Did this problem suddenly appear or is this the first time you use the
 > browser?
 
 CB> This is the first time using this browser on sparc64, port was
 compiled on a sparc64 tinderbox then installed onto a sparc64 vnc test
 jail.
 
 I am involved with the FreeBSD sparc64 effort and I am trying to get
 some of the gui stuff up and running.  Netsurf looks like an ideal
 lightweight browser when it renders properly.
 
 > 
 > Does this happen with all image formats or only jpg?
 
 CB> it appears to effect png, jpeg, jpeg 2000, and gif.
 bmp is rendered blue and svg appears normal.
 
 I googled for image format test page and the first hit was;
 http://wiesmann.codiferes.net/share/bitmaps
 
 I have captured a screenshot for your reference;
 http://bsdtec.com/freebsd/netsurf-testpage-sparc64.png
 
 Kind Regards
 
 Craig Butler
 
 
 

From: Tijl Coosemans <tijl@FreeBSD.org>
To: Craig Butler <craig001@lerwick.hopto.org>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/187466: www/netsurf all images rendered red on sparc64
Date: Fri, 14 Mar 2014 17:31:30 +0100

 --MP_/Ri8_ly63ic==VId=TGn9nzC
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 On Wed, 12 Mar 2014 23:23:11 +0000 Craig Butler wrote:
 > On Wed, 2014-03-12 at 21:27 +0100, Tijl Coosemans wrote:
 >> On Wed, 12 Mar 2014 16:40:32 +0000 Craig Butler wrote:
 >>> On Wed, 2014-03-12 at 10:29 +0100, Tijl Coosemans wrote:
 >>>> Please try the attached patch and let me know if it works.
 >>> 
 >>> Thank you for the patch.  I have applied it and compiled again.  
 >>> 
 >>> Unfortunately it doesn't appear to have made a difference.  Images are
 >>> still red.
 >> 
 >> Did this problem suddenly appear or is this the first time you use the
 >> browser?
 > 
 > This is the first time using this browser on sparc64, port was
 > compiled on a sparc64 tinderbox then installed onto a sparc64 vnc test
 > jail.
 > 
 > I am involved with the FreeBSD sparc64 effort and I am trying to get
 > some of the gui stuff up and running.  Netsurf looks like an ideal
 > lightweight browser when it renders properly.
 > 
 >> Does this happen with all image formats or only jpg?
 > 
 > it appears to effect png, jpeg, jpeg 2000, and gif.
 > bmp is rendered blue and svg appears normal.
 > 
 > I googled for image format test page and the first hit was;
 > http://wiesmann.codiferes.net/share/bitmaps
 > 
 > I have captured a screenshot for your reference;
 > http://bsdtec.com/freebsd/netsurf-testpage-sparc64.png
 
 New patch attached, please give it a try.
 --MP_/Ri8_ly63ic==VId=TGn9nzC
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=netsurf.patch
 
 Index: www/netsurf/Makefile
 ===================================================================
 --- www/netsurf/Makefile	(revision 348048)
 +++ www/netsurf/Makefile	(working copy)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	netsurf
  PORTVERSION=	3.0
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	www
  MASTER_SITES=	http://download.netsurf-browser.org/netsurf/releases/source-full/
  DISTNAME=	${PORTNAME}-${PORTVERSION}-full-src
 @@ -29,18 +29,16 @@ USE_GNOME=	librsvg2
  NSFB_VERSION=	0.1.0
  WRKSRC=		${WRKDIR}/${PORTNAME}-full-${PORTVERSION}
  
 -DESKTOP_ENTRIES="NetSurf" "${COMMENT}" "" "${PORTNAME}" "" "true"
 +DESKTOP_ENTRIES="NetSurf" "${COMMENT}" "${DATADIR}/${PORTNAME}.xpm" \
 +		"${PORTNAME}" "" "true"
  
  OPTIONS_DEFINE=	GSTREAMER WEBP
  
 +GSTREAMER_USE=	GSTREAMER=yes
  WEBP_LIB_DEPENDS=	libwebp.so:${PORTSDIR}/graphics/webp
  
  .include <bsd.port.options.mk>
  
 -.if ${PORT_OPTIONS:MGSTREAMER}
 -USE_GSTREAMER=	yes
 -.endif
 -
  .if ${OPSYS} == DragonFly
  LIB_DEPENDS+=	libssl.so:${PORTSDIR}/security/openssl
  BUILD_DEPENDS+=	gperf:${PORTSDIR}/devel/gperf
 @@ -53,12 +51,12 @@ post-patch:
  		${WRKSRC}/src/libnsfb-${NSFB_VERSION}/Makefile
  	@${REINPLACE_CMD} 's|endian|sys/endian|' \
  		${WRKSRC}/src/libnsfb-${NSFB_VERSION}/src/plot/*bpp*.c
 +	@${REINPLACE_CMD} '/CFLAGS/d' \
 +		${WRKSRC}/src/netsurf-${PORTVERSION}/Makefile.defaults
  	@${REINPLACE_CMD} 's| -O2||' \
  		${WRKSRC}/src/netsurf-${PORTVERSION}/gtk/Makefile.defaults
  	@${REINPLACE_CMD} '/OpenSSL/d ; s| -g|| ; s|-DG_DISABLE_DEPRECATED||' \
  		${WRKSRC}/src/netsurf-${PORTVERSION}/gtk/Makefile.target
 -	@${REINPLACE_CMD} -e '/ifeq.*clang/s/word 1/filter clang/' \
 -		${WRKSRC}/src/buildsystem-1.0/makefiles/Makefile.tools
  	@${REINPLACE_CMD} -e 's| -g|| ; s|flex|${LOCALBASE}/bin/&|' \
  		${WRKSRC}/src/nsgenbind-0.0.1/src/Makefile
  
 Index: www/netsurf/files/patch-pixel-format
 ===================================================================
 --- www/netsurf/files/patch-pixel-format	(revision 0)
 +++ www/netsurf/files/patch-pixel-format	(working copy)
 @@ -0,0 +1,89 @@
 +--- src/netsurf-3.0/gtk/bitmap.c.orig
 ++++ src/netsurf-3.0/gtk/bitmap.c
 +@@ -288,27 +288,27 @@
 + 
 + 	if (fmt == CAIRO_FORMAT_RGB24) {
 + 		for (pixel_loop=0; pixel_loop < pixel_count; pixel_loop++) {
 +-			pixel = pixels[pixel_loop];
 +-			pixels[pixel_loop] = (pixel & 0xff00ff00) |
 +-				((pixel & 0xff) << 16) | 
 +-				((pixel & 0xff0000) >> 16);		
 ++			pixel =	((uint8_t *)(pixels + pixel_loop))[0] << 16 |
 ++				((uint8_t *)(pixels + pixel_loop))[1] << 8 |
 ++				((uint8_t *)(pixels + pixel_loop))[2] |
 ++				((uint8_t *)(pixels + pixel_loop))[3] << 24;
 ++			pixels[pixel_loop] = pixel;
 + 		}
 + 	} else {
 + 		uint8_t t, r, g, b;
 + 		for (pixel_loop=0; pixel_loop < pixel_count; pixel_loop++) {
 +-			pixel = pixels[pixel_loop];
 +-			t = (pixel & 0xff000000) >> 24;
 ++			t = ((uint8_t *)(pixels + pixel_loop))[3];
 + 			if (t == 0) {
 + 				pixels[pixel_loop] = 0;
 + 			} else {
 +-				r = (pixel & 0xff0000) >> 16;
 +-				g = (pixel & 0xff00) >> 8;
 +-				b = pixel & 0xff;
 ++				r = ((uint8_t *)(pixels + pixel_loop))[0];
 ++				g = ((uint8_t *)(pixels + pixel_loop))[1];
 ++				b = ((uint8_t *)(pixels + pixel_loop))[2];
 + 				
 + 				pixels[pixel_loop] = (t << 24) | 
 +-					((r * t) >> 8) | 
 ++					((r * t) >> 8) << 16 | 
 + 					((g * t) >> 8) << 8 |
 +-					((b * t) >> 8) << 16;
 ++					((b * t) >> 8);
 + 
 + 			}
 + 		}
 +--- src/netsurf-3.0/image/bmp.c.orig
 ++++ src/netsurf-3.0/image/bmp.c
 +@@ -171,7 +171,6 @@
 + 
 + 	/* exit as a success */
 + 	bmp->bitmap = bmp->bmp->bitmap;
 +-	bitmap_modified(bmp->bitmap);
 + 
 + 	content_set_ready(c);
 + 	content_set_done(c);
 +@@ -190,6 +189,8 @@
 + 	if (bmp->bmp->decoded == false)
 + 		if (bmp_decode(bmp->bmp) != BMP_OK)
 + 			return false;
 ++		else
 ++			bitmap_modified(bmp->bitmap);
 + 
 + 	bmp->bitmap = bmp->bmp->bitmap;
 + 
 +--- src/netsurf-3.0/image/rsvg.c.orig
 ++++ src/netsurf-3.0/image/rsvg.c
 +@@ -135,19 +135,17 @@
 + static inline void rsvg_argb_to_abgr(uint8_t *pixels, 
 + 		int width, int height, size_t rowstride)
 + {
 +-	uint8_t *p = pixels;
 ++	uint32_t *p = (uint32_t *)pixels;
 + 
 + 	for (int y = 0; y < height; y++) {
 + 		for (int x = 0; x < width; x++) {
 +-			/* Swap R and B */
 +-			const uint8_t r = p[x+3];
 +-
 +-			p[x+3] = p[x];
 +-
 +-			p[x] = r;
 ++			uint32_t c = *p;
 ++			((uint8_t *)p)[0] = (c & 0xff0000) >> 16;
 ++			((uint8_t *)p)[1] = (c & 0xff00) >> 8;
 ++			((uint8_t *)p)[2] = (c & 0xff);
 ++			((uint8_t *)p)[3] = (c & 0xff000000) >> 24;
 ++			p++;
 + 		}
 +-
 +-		p += rowstride;
 + 	}
 + }
 + 
 
 Property changes on: www/netsurf/files/patch-pixel-format
 ___________________________________________________________________
 Added: fbsd:nokeywords
 ## -0,0 +1 ##
 +yes
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 
 --MP_/Ri8_ly63ic==VId=TGn9nzC--

From: Craig Butler <craig001@lerwick.hopto.org>
To: Tijl Coosemans <tijl@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/187466: www/netsurf all images rendered red on sparc64
Date: Sat, 15 Mar 2014 14:55:41 +0000

 On Fri, 2014-03-14 at 17:31 +0100, Tijl Coosemans wrote:
 > On Wed, 12 Mar 2014 23:23:11 +0000 Craig Butler wrote:
 > > On Wed, 2014-03-12 at 21:27 +0100, Tijl Coosemans wrote:
 > >> On Wed, 12 Mar 2014 16:40:32 +0000 Craig Butler wrote:
 > >>> On Wed, 2014-03-12 at 10:29 +0100, Tijl Coosemans wrote:
 > >>>> Please try the attached patch and let me know if it works.
 > >>> 
 > >>> Thank you for the patch.  I have applied it and compiled again.  
 > >>> 
 > >>> Unfortunately it doesn't appear to have made a difference.  Images are
 > >>> still red.
 > >> 
 > >> Did this problem suddenly appear or is this the first time you use the
 > >> browser?
 > > 
 > > This is the first time using this browser on sparc64, port was
 > > compiled on a sparc64 tinderbox then installed onto a sparc64 vnc test
 > > jail.
 > > 
 > > I am involved with the FreeBSD sparc64 effort and I am trying to get
 > > some of the gui stuff up and running.  Netsurf looks like an ideal
 > > lightweight browser when it renders properly.
 > > 
 > >> Does this happen with all image formats or only jpg?
 > > 
 > > it appears to effect png, jpeg, jpeg 2000, and gif.
 > > bmp is rendered blue and svg appears normal.
 > > 
 > > I googled for image format test page and the first hit was;
 > > http://wiesmann.codiferes.net/share/bitmaps
 > > 
 > > I have captured a screenshot for your reference;
 > > http://bsdtec.com/freebsd/netsurf-testpage-sparc64.png
 > 
 > New patch attached, please give it a try.
 
 Hello Tiji
 
 That patch appears to have done the trick.  
 
 Everything appears correct on the image test page now.  
 
 Thanks a million! definitely worth committing to the port.
 
 
 Kind Regards
 
 Craig Butler
 
State-Changed-From-To: open->closed 
State-Changed-By: tijl 
State-Changed-When: Sat Mar 15 18:58:24 CET 2014 
State-Changed-Why:  
Fixed in r348360. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=187466 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/187466: commit references a PR
Date: Sat, 15 Mar 2014 17:52:56 +0000 (UTC)

 Author: tijl
 Date: Sat Mar 15 17:52:53 2014
 New Revision: 348360
 URL: http://svnweb.freebsd.org/changeset/ports/348360
 QAT: https://qat.redports.org/buildarchive/r348360/
 
 Log:
   - Use the more common libpng instead of libmng.
   - Add an icon to the desktop entry.
   - Use option helpers.
   - Respect CFLAGS.
   - Remove clang support patch.  No longer necessary.
   - Add a patch to fix rendering of SVG and BMP images on little-endian
     systems and all image formats on big-endian systems. [1]
   
   PR:		ports/187466 [1]
   Tested by:	Craig Butler <craig001@lerwick.hopto.org> [1]
 
 Added:
   head/www/netsurf/files/patch-pixel-format   (contents, props changed)
 Modified:
   head/www/netsurf/Makefile
   head/www/netsurf/files/Makefile.config
 
 Modified: head/www/netsurf/Makefile
 ==============================================================================
 --- head/www/netsurf/Makefile	Sat Mar 15 17:43:25 2014	(r348359)
 +++ head/www/netsurf/Makefile	Sat Mar 15 17:52:53 2014	(r348360)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	netsurf
  PORTVERSION=	3.0
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	www
  MASTER_SITES=	http://download.netsurf-browser.org/netsurf/releases/source-full/
  DISTNAME=	${PORTNAME}-${PORTVERSION}-full-src
 @@ -16,7 +16,8 @@ LICENSE_COMB=	multi
  
  BUILD_DEPENDS=	${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex
  LIB_DEPENDS=	libcurl.so:${PORTSDIR}/ftp/curl \
 -		libmng.so:${PORTSDIR}/graphics/libmng
 +		libjpeg.so:${PORTSDIR}/graphics/jpeg \
 +		libpng15.so:${PORTSDIR}/graphics/png
  
  ALL_TARGET=	#empty
  CFLAGS+=	-I${LOCALBASE}/include
 @@ -24,23 +25,20 @@ LDFLAGS+=	-lssl -lcrypto -L${LOCALBASE}/
  MAKE_ARGS=	HOST_CC="${CC}" CC="${CC}" CCOPT="" HOST="${OPSYS}" \
  		WARNFLAGS="" Q="" OPTCFLAGS="${CFLAGS}"
  USES=		bison gmake pkgconfig iconv
 -USE_GNOME=	librsvg2
 +USE_GNOME=	gtk20 librsvg2
  
  NSFB_VERSION=	0.1.0
  WRKSRC=		${WRKDIR}/${PORTNAME}-full-${PORTVERSION}
  
 -DESKTOP_ENTRIES="NetSurf" "${COMMENT}" "" "${PORTNAME}" "" "true"
 +DESKTOP_ENTRIES="NetSurf" "${COMMENT}" "${DATADIR}/${PORTNAME}.xpm" \
 +		"${PORTNAME}" "" "true"
  
  OPTIONS_DEFINE=	GSTREAMER WEBP
 -
 +GSTREAMER_USE=		GSTREAMER=yes
  WEBP_LIB_DEPENDS=	libwebp.so:${PORTSDIR}/graphics/webp
  
  .include <bsd.port.options.mk>
  
 -.if ${PORT_OPTIONS:MGSTREAMER}
 -USE_GSTREAMER=	yes
 -.endif
 -
  .if ${OPSYS} == DragonFly
  LIB_DEPENDS+=	libssl.so:${PORTSDIR}/security/openssl
  BUILD_DEPENDS+=	gperf:${PORTSDIR}/devel/gperf
 @@ -53,12 +51,14 @@ post-patch:
  		${WRKSRC}/src/libnsfb-${NSFB_VERSION}/Makefile
  	@${REINPLACE_CMD} 's|endian|sys/endian|' \
  		${WRKSRC}/src/libnsfb-${NSFB_VERSION}/src/plot/*bpp*.c
 +	@${REINPLACE_CMD} '/CFLAGS/d' \
 +		${WRKSRC}/src/netsurf-${PORTVERSION}/Makefile.defaults
  	@${REINPLACE_CMD} 's| -O2||' \
  		${WRKSRC}/src/netsurf-${PORTVERSION}/gtk/Makefile.defaults
 -	@${REINPLACE_CMD} '/OpenSSL/d ; s| -g|| ; s|-DG_DISABLE_DEPRECATED||' \
 +	@${REINPLACE_CMD} \
 +		-e '/OpenSSL/d' -e '/lcms/d' -e 's| -g||' \
 +		-e 's/-DG_DISABLE_DEPRECATED//' \
  		${WRKSRC}/src/netsurf-${PORTVERSION}/gtk/Makefile.target
 -	@${REINPLACE_CMD} -e '/ifeq.*clang/s/word 1/filter clang/' \
 -		${WRKSRC}/src/buildsystem-1.0/makefiles/Makefile.tools
  	@${REINPLACE_CMD} -e 's| -g|| ; s|flex|${LOCALBASE}/bin/&|' \
  		${WRKSRC}/src/nsgenbind-0.0.1/src/Makefile
  
 
 Modified: head/www/netsurf/files/Makefile.config
 ==============================================================================
 --- head/www/netsurf/files/Makefile.config	Sat Mar 15 17:43:25 2014	(r348359)
 +++ head/www/netsurf/files/Makefile.config	Sat Mar 15 17:52:53 2014	(r348360)
 @@ -1,6 +1,7 @@
  NETSURF_USE_HARU_PDF=NO
  NETSURF_USE_LIBICONV_PLUG=NO
 +NETSURF_USE_MNG=NO
  NETSURF_USE_NSSVG=NO
  NETSURF_USE_ROSPRITE=NO
 -NETSURF_USE_WEBP=NO
  NETSURF_USE_VIDEO=NO
 +NETSURF_USE_WEBP=NO
 
 Added: head/www/netsurf/files/patch-pixel-format
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/www/netsurf/files/patch-pixel-format	Sat Mar 15 17:52:53 2014	(r348360)
 @@ -0,0 +1,89 @@
 +--- src/netsurf-3.0/gtk/bitmap.c.orig
 ++++ src/netsurf-3.0/gtk/bitmap.c
 +@@ -288,27 +288,27 @@
 + 
 + 	if (fmt == CAIRO_FORMAT_RGB24) {
 + 		for (pixel_loop=0; pixel_loop < pixel_count; pixel_loop++) {
 +-			pixel = pixels[pixel_loop];
 +-			pixels[pixel_loop] = (pixel & 0xff00ff00) |
 +-				((pixel & 0xff) << 16) | 
 +-				((pixel & 0xff0000) >> 16);		
 ++			pixel =	((uint8_t *)(pixels + pixel_loop))[0] << 16 |
 ++				((uint8_t *)(pixels + pixel_loop))[1] << 8 |
 ++				((uint8_t *)(pixels + pixel_loop))[2] |
 ++				((uint8_t *)(pixels + pixel_loop))[3] << 24;
 ++			pixels[pixel_loop] = pixel;
 + 		}
 + 	} else {
 + 		uint8_t t, r, g, b;
 + 		for (pixel_loop=0; pixel_loop < pixel_count; pixel_loop++) {
 +-			pixel = pixels[pixel_loop];
 +-			t = (pixel & 0xff000000) >> 24;
 ++			t = ((uint8_t *)(pixels + pixel_loop))[3];
 + 			if (t == 0) {
 + 				pixels[pixel_loop] = 0;
 + 			} else {
 +-				r = (pixel & 0xff0000) >> 16;
 +-				g = (pixel & 0xff00) >> 8;
 +-				b = pixel & 0xff;
 ++				r = ((uint8_t *)(pixels + pixel_loop))[0];
 ++				g = ((uint8_t *)(pixels + pixel_loop))[1];
 ++				b = ((uint8_t *)(pixels + pixel_loop))[2];
 + 				
 + 				pixels[pixel_loop] = (t << 24) | 
 +-					((r * t) >> 8) | 
 ++					((r * t) >> 8) << 16 | 
 + 					((g * t) >> 8) << 8 |
 +-					((b * t) >> 8) << 16;
 ++					((b * t) >> 8);
 + 
 + 			}
 + 		}
 +--- src/netsurf-3.0/image/bmp.c.orig
 ++++ src/netsurf-3.0/image/bmp.c
 +@@ -171,7 +171,6 @@
 + 
 + 	/* exit as a success */
 + 	bmp->bitmap = bmp->bmp->bitmap;
 +-	bitmap_modified(bmp->bitmap);
 + 
 + 	content_set_ready(c);
 + 	content_set_done(c);
 +@@ -190,6 +189,8 @@
 + 	if (bmp->bmp->decoded == false)
 + 		if (bmp_decode(bmp->bmp) != BMP_OK)
 + 			return false;
 ++		else
 ++			bitmap_modified(bmp->bitmap);
 + 
 + 	bmp->bitmap = bmp->bmp->bitmap;
 + 
 +--- src/netsurf-3.0/image/rsvg.c.orig
 ++++ src/netsurf-3.0/image/rsvg.c
 +@@ -135,19 +135,17 @@
 + static inline void rsvg_argb_to_abgr(uint8_t *pixels, 
 + 		int width, int height, size_t rowstride)
 + {
 +-	uint8_t *p = pixels;
 ++	uint32_t *p = (uint32_t *)pixels;
 + 
 + 	for (int y = 0; y < height; y++) {
 + 		for (int x = 0; x < width; x++) {
 +-			/* Swap R and B */
 +-			const uint8_t r = p[x+3];
 +-
 +-			p[x+3] = p[x];
 +-
 +-			p[x] = r;
 ++			uint32_t c = *p;
 ++			((uint8_t *)p)[0] = (c & 0xff0000) >> 16;
 ++			((uint8_t *)p)[1] = (c & 0xff00) >> 8;
 ++			((uint8_t *)p)[2] = (c & 0xff);
 ++			((uint8_t *)p)[3] = (c & 0xff000000) >> 24;
 ++			p++;
 + 		}
 +-
 +-		p += rowstride;
 + 	}
 + }
 + 
 _______________________________________________
 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"
 
>Unformatted:
