NetBSD Problem Report #18841
Received: (qmail 16589 invoked by uid 605); 28 Oct 2002 15:56:09 -0000
Message-Id: <20021028155605.9124C11122@narn.netbsd.org>
Date: Mon, 28 Oct 2002 07:56:05 -0800 (PST)
From: jonathan@perkin.org.uk
Sender: gnats-bugs-owner@netbsd.org
Reply-To: jonathan@perkin.org.uk
To: gnats-bugs@gnats.netbsd.org
Subject: Fix for x11/xfstt on Solaris.
X-Send-Pr-Version: www-1.0
>Number: 18841
>Category: pkg
>Synopsis: Fix for x11/xfstt on Solaris.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: solaris-pkg-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 28 15:57:01 +0000 2002
>Closed-Date: Thu Feb 07 14:16:48 +0000 2013
>Last-Modified: Thu Feb 07 14:16:48 +0000 2013
>Originator: Jonathan Perkin
>Release: 1.6
>Organization:
British Broadcasting Corporation
>Environment:
SunOS desk06 5.9 Generic_112233-01 sun4u sparc SUNW,Ultra-5_10
>Description:
Solaris (at least 9) takes caddr_t argument to m{,un}map, which breaks
this package quite severely.
This probably isn't a correct fix. But hey, "it works" [tm] (apart from
the fact this package actually requires XFree and won't build with
Open Windows, but that is a separate issue which may be resolved in a
separate PR.)
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /cache/ncvs/pkgsrc/x11/xfstt/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile 2002/09/29 12:58:37 1.11
+++ Makefile 2002/10/28 15:23:17
@@ -12,6 +12,14 @@
COMMENT= TrueType font server for X11
CXXFLAGS+= -fomit-frame-pointer -ffast-math
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+CXXFLAGS+= -DSOLARIS
+LDFLAGS+= -lsocket -lnsl
+.endif
+
MAKE_ENV+= CXXFLAGS="${CXXFLAGS}"
USE_X11BASE= YES
Index: distinfo
===================================================================
RCS file: /cache/ncvs/pkgsrc/x11/xfstt/distinfo,v
retrieving revision 1.5
diff -u -r1.5 distinfo
--- distinfo 2002/09/27 17:03:21 1.5
+++ distinfo 2002/10/28 15:16:57
@@ -7,3 +7,6 @@
SHA1 (patch-ac) = 1fa14e6211a742936eae7c9282499ae66e6c5258
SHA1 (patch-ad) = 7ad47d5a06570fa866b47e453cbcaea8af7f187d
SHA1 (patch-ae) = 4296c1a666b60548d432217c7fe03c9eccf5ea87
+SHA1 (patch-af) = af15b16947cdd00e85e1414fffff53aa33de1711
+SHA1 (patch-ag) = 3df06d9a49db4c02b1d400c013d6754e4743805e
+SHA1 (patch-ah) = 152b8ae54b3e0f8958ad90a3e5efcd5fb4099dee
--- /dev/null Mon Oct 28 15:25:32 2002
+++ patch-af Mon Oct 28 13:35:29 2002
@@ -0,0 +1,48 @@
+$NetBSD$
+
+--- TTFont.cpp.orig Thu Jan 11 01:58:31 2001
++++ TTFont.cpp
+@@ -272,11 +272,19 @@ int TTFont::patchGlyphCode( GlyphTable*
+ return 0;
+ }
+
++#ifdef SOLARIS
++int TTFont::checksum(char *buf, int len)
++#else
+ int TTFont::checksum( U8* buf, int len)
++#endif
+ {
+ len = (len + 3) >> 2;
+ int sum = 0;
++#ifdef SOLARIS
++ for(char *p = buf; --len >= 0; p += 4) {
++#else
+ for( U8* p = buf; --len >= 0; p += 4) {
++#endif
+ int val = (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
+ sum += val;
+ }
+@@ -285,13 +293,22 @@ int TTFont::checksum( U8* buf, int len)
+
+ void TTFont::updateChecksums()
+ {
++#ifdef SOLARIS
++ char *buf = base;
++ char *headTable = 0;
++#else
+ U8* buf = base;
++ U8* headTable = 0;
++#endif
+
+ int nTables = (buf[4] << 8) + buf[5];
+ //printf( "nTables = %d\n", nTables);
+- U8* headTable = 0;
+ for( int i = 0; i < nTables; ++i) {
++#ifdef SOLARIS
++ char *b = &buf[ 12 + i * 16];
++#else
+ U8* b = &buf[ 12 + i * 16];
++#endif
+ int name = (b[0]<<24) + (b[1]<<16) + (b[2]<<8) + b[3];
+ int offset = (b[8]<<24) + (b[9]<<16) + (b[10]<<8) + b[11];
+ int length = (b[12]<<24) + (b[13]<<16) + (b[14]<<8) + b[15];
--- /dev/null Mon Oct 28 15:25:32 2002
+++ patch-ag Mon Oct 28 13:23:46 2002
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- RAFile.cpp.orig Thu May 6 06:26:06 1999
++++ RAFile.cpp
+@@ -164,7 +164,11 @@ RandomAccessFile::RandomAccessFile( char
+ struct stat st;
+ fstat( fd, &st);
+ length = st.st_size;
++#ifdef SOLARIS
++ base = (char *) mmap( 0L, length, PROT_READ, MAP_SHARED, fd, 0L);
++#else
+ base = (U8*) mmap( 0L, length, PROT_READ, MAP_SHARED, fd, 0L);
++#endif
+ close( fd);
+ #endif
+ ptr = absbase = base;
+@@ -184,7 +188,11 @@ void RandomAccessFile::closeRAFile()
+ U32 RandomAccessFile::calcChecksum()
+ {
+ U32 checksum = 0;
++#ifdef SOLARIS
++ char *saveptr = ptr;
++#else
+ U8* saveptr = ptr;
++#endif
+ for( int len = length >> 2; --len >= 0;)
+ checksum += readUInt();
+ if( length & 3)
--- /dev/null Mon Oct 28 15:25:32 2002
+++ patch-ah Mon Oct 28 13:36:55 2002
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- ttf.h.orig Wed Mar 13 17:28:31 2002
++++ ttf.h
+@@ -49,9 +49,17 @@
+ class RandomAccessFile
+ {
+ protected:
++#ifdef SOLARIS
++ char *ptr, *base;
++#else
+ U8 *ptr, *base; // low offset for frequently used members
++#endif
+ private:
++#ifdef SOLARIS
++ char *absbase;
++#else
+ U8* absbase; //### hack for fileOffset();
++#endif
+ int length;
+ public:
+ RandomAccessFile( char* fileName);
+@@ -265,7 +273,11 @@ public:
+
+ // for comparing with reference implementation
+ int patchGlyphCode( GlyphTable* glyph, int instruction);
++#ifdef SOLARIS
++ int checksum(char *buf, int len);
++#else
+ int checksum( U8* buf, int len);
++#endif
+ void updateChecksums();
+ int write2File( char* filename);
+ void patchName( U8* patchData, int patchLength);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->sol-pkg-manager
Responsible-Changed-By: wiz
Responsible-Changed-When: Mon Oct 28 14:22:57 PST 2002
Responsible-Changed-Why:
Solaris problem.
State-Changed-From-To: open->feedback
State-Changed-By: grant
State-Changed-When: Fri Jan 2 05:24:17 UTC 2004
State-Changed-Why:
hi sketch,
could you please try x11/xfstt from -current pkgsrc, as it has now
been updated to 1.6.
thanks,
grant.
State-Changed-From-To: feedback->open
State-Changed-By: sketch
State-Changed-When: Fri Mar 5 16:02:39 UTC 2004
State-Changed-Why:
No, it's still broken. I'll take this one, and work on a proper fix for
SunPRO support.
Responsible-Changed-From-To: sol-pkg-manager->sketch
Responsible-Changed-By: sketch
Responsible-Changed-When: Fri Mar 5 16:02:39 UTC 2004
Responsible-Changed-Why:
I'll work on a fix for this.
Responsible-Changed-From-To: sketch->sol-pkg-manager
Responsible-Changed-By: sketch@netbsd.org
Responsible-Changed-When: Sat, 20 Oct 2007 11:58:48 +0000
Responsible-Changed-Why:
Assign this back to sol-pkg-manager as it's unlikely I'll work on this
any time soon. Fix my email address too.
Responsible-Changed-From-To: sol-pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sat, 20 Oct 2007 14:29:52 +0000
Responsible-Changed-Why:
Use correct alias.
State-Changed-From-To: open->closed
State-Changed-By: jperkin@NetBSD.org
State-Changed-When: Thu, 07 Feb 2013 14:16:48 +0000
State-Changed-Why:
I don't care to keep this PR open anymore.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.36 2007/11/24 03:27:39 kano Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.