Bug 150698 - [patch] graphics/mupdf: restore some vendor CFLAGS
Summary: [patch] graphics/mupdf: restore some vendor CFLAGS
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: Philip M. Gollucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-18 09:00 UTC by swell.k
Modified: 2010-10-06 21:40 UTC (History)
0 users

See Also:


Attachments
a.diff (814 bytes, patch)
2010-09-18 09:00 UTC, swell.k
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description swell.k 2010-09-18 09:00:15 UTC
ports/148503 broke build for HAVE_CPUDEP on i386. Runtime CPU detection
relies on MMX/SSE/etc compiler features enabled.

Fix: Attepmt to fix without downgrading _CPUCFLAGS optimization.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-09-18 09:00:20 UTC
Maintainer of graphics/mupdf,

Please note that PR ports/150698 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/150698

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2010-09-18 09:00:25 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 swell.k 2010-09-18 10:40:12 UTC
I guess it's better to not define ARCH_X86 on non-x86 ARCHs (arm, powerpc, etc)

--- b.diff begins here ---
Index: graphics/mupdf/Makefile
===================================================================
RCS file: /a/.cvsup/ports/graphics/mupdf/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- graphics/mupdf/Makefile	18 Sep 2010 06:41:12 -0000	1.9
+++ graphics/mupdf/Makefile	18 Sep 2010 09:37:22 -0000
@@ -42,7 +40,7 @@ LDFLAGS+=	-L${LOCALBASE}/lib
 BROKEN=		Does not install on sparc64
 .elif ${ARCH} == amd64
 CFLAGS+=	-DARCH_X86_64
-.else
+.elif ${ARCH} == i386
 CFLAGS+=	-DARCH_X86
 .endif
 
--- b.diff ends here ---
Comment 4 swell.k 2010-09-18 11:02:59 UTC
To be on a safe side let's keep vendor optimization disabled on non-x86.
Here is a cumulative diff.

--- a.diff begins here ---
Index: graphics/mupdf/Makefile
===================================================================
RCS file: /a/.cvsup/ports/graphics/mupdf/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- graphics/mupdf/Makefile	18 Sep 2010 06:41:12 -0000	1.9
+++ graphics/mupdf/Makefile	18 Sep 2010 10:00:18 -0000
@@ -19,8 +19,6 @@ LIB_DEPENDS=	freetype.9:${PORTSDIR}/prin
 		jbig2dec.0:${PORTSDIR}/graphics/jbig2dec \
 		openjpeg.2:${PORTSDIR}/graphics/openjpeg
 
-BROKEN=		does not build
-
 USE_GMAKE=	yes
 MAKE_ARGS+=	build=release prefix=${PREFIX}
 WRKSRC=		${WRKDIR}/${PORTNAME}
@@ -42,7 +40,7 @@ LDFLAGS+=	-L${LOCALBASE}/lib
 BROKEN=		Does not install on sparc64
 .elif ${ARCH} == amd64
 CFLAGS+=	-DARCH_X86_64
-.else
+.elif ${ARCH} == i386
 CFLAGS+=	-DARCH_X86
 .endif
 
@@ -54,7 +52,15 @@ post-patch:	.SILENT
 		-e 's/Linux/FreeBSD/g' \
 		-e '/^CC/s/=/?=/' \
 		-e '/-O3/d' \
-		-e '/-msse/d' \
 		${WRKSRC}/Makerules
 
+.if ${ARCH} == amd64 || ${ARCH} == i386
+	${REINPLACE_CMD} -e 's/-DARCH_X86//' \
+		-e 's/-march=k8/-m3dnow/' \
+		${WRKSRC}/Makerules
+.else
+	${REINPLACE_CMD} -e '/-msse/d' \
+		${WRKSRC}/Makerules
+.endif
+
 .include <bsd.port.mk>
--- a.diff ends here ---
Comment 5 swell.k 2010-09-18 11:20:04 UTC
Can I request BROKEN removed for sparc64, too? I want a new log in
pointyhat log archive. Besides, it may as well be fixed since the port
dropped jam dependency.
Comment 6 martin.dieringer 2010-09-21 15:26:03 UTC
Is this a fix for i386? As I only have an amd64 machine, I think I
cannot help here, sorry. Otherwise if nobody fixes i386, I guess it
simply should be marked BROKEN for this ARCH?
Comment 7 swell.k 2010-09-22 01:32:38 UTC
Martin Dieringer <martin.dieringer@gmx.de> writes:

> Is this a fix for i386? As I only have an amd64 machine, I think I
> cannot help here, sorry. Otherwise if nobody fixes i386, I guess it
> simply should be marked BROKEN for this ARCH?

Yes, the breakage is i386 specific[1]. As a maintainer just make sure my
latest diff doesn't break anything for you.

[1] $ cc -dM -E - </dev/null | fgrep -i -emmx -esse # i386
    $ cc -dM -E - </dev/null | fgrep -i -emmx -esse # amd64
    #define __MMX__ 1
    #define __SSE2_MATH__ 1
    #define __SSE_MATH__ 1
    #define __SSE__ 1
    #define __SSE2__ 1
Comment 8 Philip M. Gollucci freebsd_committer freebsd_triage 2010-09-22 07:12:57 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

I will take it
Comment 9 martin.dieringer 2010-09-22 09:19:03 UTC
here's a new patch for version 0.7 including yours.
I had to remove CFLAGS to make it compile, LDFLAGS is not necessary
(anymore?)


===> Generating patch
===> Viewing diff with more
diff -ruN --exclude=CVS /usr/ports/graphics/mupdf/Makefile /usr/ports/graphics/mupdf_patch/Makefile
--- /usr/ports/graphics/mupdf/Makefile	2010-09-19 04:19:54.734059060 +0200
+++ /usr/ports/graphics/mupdf_patch/Makefile	2010-09-22 10:17:20.365226037 +0200
@@ -5,11 +5,10 @@
  # $FreeBSD: ports/graphics/mupdf/Makefile,v 1.9 2010/09/18 06:41:12 erwin Exp $

  PORTNAME=	mupdf
-PORTVERSION=	0.6
-PORTREVISION=	1
+PORTVERSION=	0.7
  PORTEPOCH=	1
  CATEGORIES=	graphics
-MASTER_SITES=	http://www.mupdf.com/download/source/
+MASTER_SITES=	http://www.mupdf.com/download/

  MAINTAINER=	martin.dieringer@gmx.de
  COMMENT=	Lightweight PDF viewer and toolkit
@@ -19,11 +18,8 @@
  		jbig2dec.0:${PORTSDIR}/graphics/jbig2dec \
  		openjpeg.2:${PORTSDIR}/graphics/openjpeg

-BROKEN=		does not build
-
  USE_GMAKE=	yes
  MAKE_ARGS+=	build=release prefix=${PREFIX}
-WRKSRC=		${WRKDIR}/${PORTNAME}
  USE_XORG=	x11 xext
  USE_GNOME=	pkgconfig
  USE_GCC=	4.2+
@@ -33,16 +29,13 @@
  LICENSE=	GPLv3
  LICENSE_FILE=	${WRKSRC}/COPYING

-CFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
-
  .include <bsd.port.options.mk>

  .if ${ARCH} == "sparc64"
  BROKEN=		Does not install on sparc64
  .elif ${ARCH} == amd64
  CFLAGS+=	-DARCH_X86_64
-.else
+.elif ${ARCH} == i386
  CFLAGS+=	-DARCH_X86
  .endif

@@ -54,7 +47,15 @@
  		-e 's/Linux/FreeBSD/g' \
  		-e '/^CC/s/=/?=/' \
  		-e '/-O3/d' \
-		-e '/-msse/d' \
  		${WRKSRC}/Makerules

+.if ${ARCH} == amd64 || ${ARCH} == i386
+	${REINPLACE_CMD} -e 's/-DARCH_X86//' \
+		-e 's/-march=k8/-m3dnow/' \
+		${WRKSRC}/Makerules
+.else
+	${REINPLACE_CMD} -e '/-msse/d' \
+		${WRKSRC}/Makerules
+.endif
+
  .include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/graphics/mupdf/distinfo /usr/ports/graphics/mupdf_patch/distinfo
--- /usr/ports/graphics/mupdf/distinfo	2010-08-05 04:15:24.738783511 +0200
+++ /usr/ports/graphics/mupdf_patch/distinfo	2010-09-22 09:58:56.127157175 +0200
@@ -1,3 +1,3 @@
-MD5 (mupdf-0.6.tar.gz) = d1e1a1df8fb3e4d1c601506797b75036
-SHA256 (mupdf-0.6.tar.gz) = 6f87c4f113ee9e0f4bdfd3a316ef44052edc4febc8f7b531c4a3f44ffe149605
-SIZE (mupdf-0.6.tar.gz) = 3607245
+MD5 (mupdf-0.7.tar.gz) = 83adc4d14eb17835df791a9a0d1e8fa9
+SHA256 (mupdf-0.7.tar.gz) = e7f6307fa472575d27fe893e787ddb3fc927f03ba4ae23105f917189e81960a6
+SIZE (mupdf-0.7.tar.gz) = 3557621
===> Done
Comment 10 swell.k 2010-09-22 10:22:41 UTC
Martin Dieringer <martin.dieringer@gmx.de> writes:

> here's a new patch for version 0.7 including yours.
> I had to remove CFLAGS to make it compile, LDFLAGS is not necessary
> (anymore?)

Please, at least test plist when updating version.

  $ make deinstall
  ===>   Deinstalling mupdf-0.7,1
  pkg_delete: file 'PREFIX/include/fitz_base.h' doesn't exist
  pkg_delete: file 'PREFIX/include/fitz_draw.h' doesn't exist
  pkg_delete: file 'PREFIX/include/fitz_stream.h' doesn't exist

And from a quick look you can simplify port's Makefile a bit.

--- a.diff begins here ---
Index: graphics/mupdf/Makefile
===================================================================
RCS file: /a/.cvsup/ports/graphics/mupdf/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- graphics/mupdf/Makefile	18 Sep 2010 06:41:12 -0000	1.9
+++ graphics/mupdf/Makefile	22 Sep 2010 09:16:49 -0000
@@ -5,11 +5,10 @@
 # $FreeBSD: ports/graphics/mupdf/Makefile,v 1.9 2010/09/18 06:41:12 erwin Exp $
 
 PORTNAME=	mupdf
-PORTVERSION=	0.6
-PORTREVISION=	1
+PORTVERSION=	0.7
 PORTEPOCH=	1
 CATEGORIES=	graphics
-MASTER_SITES=	http://www.mupdf.com/download/source/
+MASTER_SITES=	http://www.mupdf.com/download/
 
 MAINTAINER=	martin.dieringer@gmx.de
 COMMENT=	Lightweight PDF viewer and toolkit
@@ -19,11 +18,8 @@ LIB_DEPENDS=	freetype.9:${PORTSDIR}/prin
 		jbig2dec.0:${PORTSDIR}/graphics/jbig2dec \
 		openjpeg.2:${PORTSDIR}/graphics/openjpeg
 
-BROKEN=		does not build
-
 USE_GMAKE=	yes
-MAKE_ARGS+=	build=release prefix=${PREFIX}
-WRKSRC=		${WRKDIR}/${PORTNAME}
+MAKE_ARGS+=	build=release prefix=${PREFIX} verbose=1
 USE_XORG=	x11 xext
 USE_GNOME=	pkgconfig
 USE_GCC=	4.2+
@@ -33,28 +29,16 @@ MAKE_JOBS_SAFE=	yes
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-CFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
-
-.include <bsd.port.options.mk>
-
-.if ${ARCH} == "sparc64"
-BROKEN=		Does not install on sparc64
-.elif ${ARCH} == amd64
-CFLAGS+=	-DARCH_X86_64
-.else
-CFLAGS+=	-DARCH_X86
-.endif
-
 post-patch:	.SILENT
 	${REINPLACE_CMD} -e 's#\(PDF.*_EXE=.*DIR./\)#\1mu_#g' \
-		-e 's/@[[:space:]]*echo[^&]*&&//' \
+		-e '/install:/,/^$$/ { /-d/d; }' \
+		-e '/install.*bin$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
+		-e '/install.*lib$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
+		-e '/install.*include$$/s/install/$$(BSD_INSTALL_DATA)/' \
 		${WRKSRC}/Makefile
 	${REINPLACE_CMD} -e 's/LAGS :=/LAGS +=/g' \
-		-e 's/Linux/FreeBSD/g' \
-		-e '/^CC/s/=/?=/' \
-		-e '/-O3/d' \
-		-e '/-msse/d' \
+		-e 's/-O2//' -e 's/-g//' \
+		-e 's|/usr/local|${LOCALBASE}|' \
 		${WRKSRC}/Makerules
 
 .include <bsd.port.mk>
Index: graphics/mupdf/distinfo
===================================================================
RCS file: /a/.cvsup/ports/graphics/mupdf/distinfo,v
retrieving revision 1.6
diff -u -p -r1.6 distinfo
--- graphics/mupdf/distinfo	4 Aug 2010 05:25:07 -0000	1.6
+++ graphics/mupdf/distinfo	22 Sep 2010 08:34:15 -0000
@@ -1,3 +1,3 @@
-MD5 (mupdf-0.6.tar.gz) = d1e1a1df8fb3e4d1c601506797b75036
-SHA256 (mupdf-0.6.tar.gz) = 6f87c4f113ee9e0f4bdfd3a316ef44052edc4febc8f7b531c4a3f44ffe149605
-SIZE (mupdf-0.6.tar.gz) = 3607245
+MD5 (mupdf-0.7.tar.gz) = 83adc4d14eb17835df791a9a0d1e8fa9
+SHA256 (mupdf-0.7.tar.gz) = e7f6307fa472575d27fe893e787ddb3fc927f03ba4ae23105f917189e81960a6
+SIZE (mupdf-0.7.tar.gz) = 3557621
Index: graphics/mupdf/pkg-plist
===================================================================
RCS file: /a/.cvsup/ports/graphics/mupdf/pkg-plist,v
retrieving revision 1.2
diff -u -p -r1.2 pkg-plist
--- graphics/mupdf/pkg-plist	10 Jul 2010 11:12:09 -0000	1.2
+++ graphics/mupdf/pkg-plist	22 Sep 2010 08:37:38 -0000
@@ -5,8 +5,5 @@ bin/mu_pdfextract
 bin/mu_pdfinfo
 bin/mu_pdfshow
 include/fitz.h
-include/fitz_base.h
-include/fitz_draw.h
-include/fitz_stream.h
 include/mupdf.h
 lib/libmupdf.a
--- a.diff ends here ---
Comment 11 Philip M. Gollucci freebsd_committer freebsd_triage 2010-09-23 02:08:53 UTC
State Changed
From-To: feedback->open

Feedback received
Comment 12 Philip M. Gollucci freebsd_committer freebsd_triage 2010-09-24 07:24:43 UTC
Responsible Changed
From-To: pgollucci->freebsd-ports-bugs

going to have enotime for the next 2 weeks, sorry
Comment 13 Philip M. Gollucci freebsd_committer freebsd_triage 2010-10-06 04:49:00 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

I will take it
Comment 14 dfilter service freebsd_committer freebsd_triage 2010-10-06 21:31:18 UTC
pgollucci    2010-10-06 20:31:12 UTC

  FreeBSD ports repository

  Modified files:
    graphics/mupdf       Makefile distinfo pkg-plist 
  Log:
  - Upate to 0.7
  - Unbreak
  
  PR:             ports/150698
  Submitted by:   swell.k@gmail.com
  Approved by:    Martin Dieringer <martin.dieringer@gmx.de> (maintainer)
  
  Revision  Changes    Path
  1.10      +9 -25     ports/graphics/mupdf/Makefile
  1.7       +3 -3      ports/graphics/mupdf/distinfo
  1.3       +0 -3      ports/graphics/mupdf/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 15 Philip M. Gollucci freebsd_committer freebsd_triage 2010-10-06 21:31:20 UTC
State Changed
From-To: open->closed

Committed, Thanks!