Mon Dec 24 01:50:58 2012 UTC ()
Fix LP64 problems and patch up some other stuff that appeared while
doing so.


(dholland)
diff -r1.11 -r1.12 pkgsrc/print/bibtool/Makefile
diff -r1.1.1.1 -r1.2 pkgsrc/print/bibtool/distinfo
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-configure
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-main.c
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-parse.c
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-regex-0.12_regex.c

cvs diff -r1.11 -r1.12 pkgsrc/print/bibtool/Makefile (expand / switch to unified diff)

--- pkgsrc/print/bibtool/Makefile 2012/12/24 00:56:19 1.11
+++ pkgsrc/print/bibtool/Makefile 2012/12/24 01:50:57 1.12
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.11 2012/12/24 00:56:19 dholland Exp $ 1# $NetBSD: Makefile,v 1.12 2012/12/24 01:50:57 dholland Exp $
2 2
3DISTNAME= BibTool-2.48 3DISTNAME= BibTool-2.48
 4PKGREVISION= 1
4CATEGORIES= print 5CATEGORIES= print
5MASTER_SITES= ${MASTER_SITE_TEX_CTAN:=biblio/bibtex/utils/bibtool/} 6MASTER_SITES= ${MASTER_SITE_TEX_CTAN:=biblio/bibtex/utils/bibtool/}
6 7
7MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
8HOMEPAGE= http://www.gerd-neugebauer.de/software/TeX/BibTool.en.html 9HOMEPAGE= http://www.gerd-neugebauer.de/software/TeX/BibTool.en.html
9COMMENT= Tool to manipulate BibTeX databases 10COMMENT= Tool to manipulate BibTeX databases
10#LICENSE= gnu-gpl-v1 11#LICENSE= gnu-gpl-v1
11 12
12BUILD_DEPENDS+= tex-bibtex-[0-9]*:../../print/tex-bibtex 13BUILD_DEPENDS+= tex-bibtex-[0-9]*:../../print/tex-bibtex
13BUILD_DEPENDS+= tex-latex-bin-[0-9]*:../../print/tex-latex-bin 14BUILD_DEPENDS+= tex-latex-bin-[0-9]*:../../print/tex-latex-bin
14BUILD_DEPENDS+= tex-tools-[0-9]*:../../print/tex-tools 15BUILD_DEPENDS+= tex-tools-[0-9]*:../../print/tex-tools
15BUILD_DEPENDS+= makeindexk-[0-9]*:../../textproc/makeindexk 16BUILD_DEPENDS+= makeindexk-[0-9]*:../../textproc/makeindexk
16 17

cvs diff -r1.1.1.1 -r1.2 pkgsrc/print/bibtool/distinfo (expand / switch to unified diff)

--- pkgsrc/print/bibtool/distinfo 2006/03/31 03:11:56 1.1.1.1
+++ pkgsrc/print/bibtool/distinfo 2012/12/24 01:50:57 1.2
@@ -1,7 +1,11 @@ @@ -1,7 +1,11 @@
1$NetBSD: distinfo,v 1.1.1.1 2006/03/31 03:11:56 smb Exp $ 1$NetBSD: distinfo,v 1.2 2012/12/24 01:50:57 dholland Exp $
2 2
3SHA1 (BibTool-2.48.tar.gz) = ed4d20823be38f4b90179613049a3be83dc51ab2 3SHA1 (BibTool-2.48.tar.gz) = ed4d20823be38f4b90179613049a3be83dc51ab2
4RMD160 (BibTool-2.48.tar.gz) = 7928faf26316ec1e014a4f8234f9510a32d0e6b9 4RMD160 (BibTool-2.48.tar.gz) = 7928faf26316ec1e014a4f8234f9510a32d0e6b9
5Size (BibTool-2.48.tar.gz) = 634267 bytes 5Size (BibTool-2.48.tar.gz) = 634267 bytes
6SHA1 (patch-aa) = c145084288db91c4fc32ecc45c4205c9ee0a5ff3 6SHA1 (patch-aa) = c145084288db91c4fc32ecc45c4205c9ee0a5ff3
7SHA1 (patch-ab) = a57258c20dea53c924f4ecafcb9881db2ac9ee93 7SHA1 (patch-ab) = a57258c20dea53c924f4ecafcb9881db2ac9ee93
 8SHA1 (patch-configure) = 6762349941de9086711fe9ec988f4f5784dd5d65
 9SHA1 (patch-main.c) = 26fa84025ae93002ae73d42d78f52640d713f705
 10SHA1 (patch-parse.c) = 5e9371428c4fe8324703ed97bff0283d03f6d441
 11SHA1 (patch-regex-0.12_regex.c) = ebffe11aec2c1ff40b4f4c41c3b9342c9426ea7a

File Added: pkgsrc/print/bibtool/patches/patch-configure
$NetBSD: patch-configure,v 1.1 2012/12/24 01:50:57 dholland Exp $

Disable a highly obsolete configure test that exercises undefined
behavior.

--- configure~	2012-12-24 01:44:27.000000000 +0000
+++ configure
@@ -2789,7 +2789,8 @@ fi
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  # disabled 20121222, IRIX 4 is long dead and this test exercises UB.
+  if true; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF

File Added: pkgsrc/print/bibtool/patches/Attic/patch-main.c
$NetBSD: patch-main.c,v 1.1 2012/12/24 01:50:57 dholland Exp $

Remove wrong casts.

--- main.c~	2004-02-08 09:41:38.000000000 +0000
+++ main.c
@@ -789,10 +789,10 @@ static int update_crossref(db,rec)		   /
 						   /*			     */
   t = *++hp; t++;				   /*			     */
   (void)sp_open(t);				   /* Try to extract	     */
-  if ( (s = SParseSymbol(&t)) == (Uchar)NULL )	   /*  the crossref as symbol*/
+  if ( (s = SParseSymbol(&t)) == NULL )		   /*  the crossref as symbol*/
   { return 0; }					   /*			     */
 						   /*			     */
-  if ( (s = db_new_key(db,s)) == (Uchar)NULL )	   /*			     */
+  if ( (s = db_new_key(db,s)) == NULL )		   /*			     */
   { ERROR2("Crossref not found: ",(char*)s);	   /*			     */
     return 0;					   /*			     */
   }						   /*			     */

File Added: pkgsrc/print/bibtool/patches/patch-parse.c
$NetBSD: patch-parse.c,v 1.1 2012/12/24 01:50:58 dholland Exp $

Fix bug handling EOF, detected by gcc.

--- parse.c~	2004-02-08 09:41:45.000000000 +0000
+++ parse.c
@@ -533,13 +533,15 @@ static void parse_number()			   /*			   
 static int parse_string(quotep)			   /*			     */
   int   quotep;				   	   /*			     */
 { Uchar c;					   /*                        */
+  int   c1;					   /*                        */
   int   left;				   	   /*			     */
   int   start_flno = flno;			   /*                        */
 						   /*			     */
   left = 0;					   /*			     */
   if ( quotep ) (void)sbputchar('"',parse_sb);	   /*"			     */
   do						   /*			     */
-  { switch ( c=skip_nl() )			   /*			     */
+  { c=c1=skip_nl();				   /*                        */
+    switch ( c1 )				   /*			     */
     { case EOF:					   /*                        */
 	UnterminatedError("Unterminated double quote",
 			  start_flno);

File Added: pkgsrc/print/bibtool/patches/patch-regex-0.12_regex.c
$NetBSD: patch-regex-0.12_regex.c,v 1.1 2012/12/24 01:50:58 dholland Exp $

Use the right config.h. This package misuses autoconf fairly
extensively, and has its own config.h with its own config in it where
where autoconf packages would normally put autoconf's output config.h.

Also patch up some integer/pointer casts.

--- regex-0.12/regex.c.orig	2000-12-16 09:49:55.000000000 +0000
+++ regex-0.12/regex.c
@@ -30,7 +30,7 @@
 #include <sys/types.h>
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "bibtool/config.h"
 #endif
 
 /* The `emacs' switch turns on certain matching commands
@@ -65,9 +65,12 @@
 
 #ifdef STDC_HEADERS
 #include <stdlib.h>
+#include <stdint.h>
 #else
 char *malloc ();
 char *realloc ();
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
 #endif
 
 
@@ -2404,10 +2407,10 @@ typedef struct
       }									\
 									\
     DEBUG_PRINT2 ("  Pushing  low active reg: %d\n", lowest_active_reg);\
-    PUSH_FAILURE_ITEM (lowest_active_reg);				\
+    PUSH_FAILURE_ITEM ((uintptr_t)lowest_active_reg);			\
 									\
     DEBUG_PRINT2 ("  Pushing high active reg: %d\n", highest_active_reg);\
-    PUSH_FAILURE_ITEM (highest_active_reg);				\
+    PUSH_FAILURE_ITEM ((uintptr_t)highest_active_reg);			\
 									\
     DEBUG_PRINT2 ("  Pushing pattern 0x%x: ", pattern_place);		\
     DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend);		\
@@ -2492,10 +2495,10 @@ typedef struct
   DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend);			\
 									\
   /* Restore register info.  */						\
-  high_reg = (unsigned) POP_FAILURE_ITEM ();				\
+  high_reg = (unsigned)(uintptr_t) POP_FAILURE_ITEM ();			\
   DEBUG_PRINT2 ("  Popping high active reg: %d\n", high_reg);		\
 									\
-  low_reg = (unsigned) POP_FAILURE_ITEM ();				\
+  low_reg = (unsigned)(uintptr_t) POP_FAILURE_ITEM ();			\
   DEBUG_PRINT2 ("  Popping  low active reg: %d\n", low_reg);		\
 									\
   for (this_reg = high_reg; this_reg >= low_reg; this_reg--)		\
@@ -3762,7 +3765,7 @@ re_match_2 (bufp, string1, size1, string
                           regstart[r] = old_regstart[r];
 
                           /* xx why this test?  */
-                          if ((int) old_regend[r] >= (int) regstart[r])
+                          if ((intptr_t) old_regend[r] >= (intptr_t) regstart[r])
                             regend[r] = old_regend[r];
                         }     
                     }