Subject: Re: pkg/30711
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Matthew Luckie <mjl@luckie.org.nz>
List: pkgsrc-bugs
Date: 07/11/2005 10:52:02
The following reply was made to PR pkg/30711; it has been noted by GNATS.

From: Matthew Luckie <mjl@luckie.org.nz>
To: gnats-bugs@netbsd.org
Cc: joerg@leaf.dragonflybsd.org
Subject: Re: pkg/30711
Date: Mon, 11 Jul 2005 22:37:40 +1200

 Hi
 
 I'm the maintainer for nss and nspr.  Can someone commit these two
 sets of patches against nss and nspr?  They enable nss and nspr to work
 on DragonFly according to patches submitted by joerg@dragonflybsd.org
 
 the nss patch differs from that submitted by Joerg in that
 nss/patches/patch-ai is now nss/files/DragonFly.mk
 
 I have tested this patch on NetBSD 2.0.2 and it does not break nspr or
 nss on it.
 
 Finally, pkglint reveals a couple of whitespace warnings on the Makefiles
 of nss and nspr.  these patches do not address those, but if a committer
 could tidy them at the same time it would be appreciated.
 
 Thanks in advance.
 
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/nspr/distinfo,v
 retrieving revision 1.3
 diff -u -p -r1.3 distinfo
 --- distinfo    23 Feb 2005 22:24:22 -0000      1.3
 +++ distinfo    11 Jul 2005 10:13:10 -0000
 @@ -5,7 +5,7 @@ RMD160 (nspr-4.4.1.tar.gz) = 7e07e66652c
  Size (nspr-4.4.1.tar.gz) = 1324075 bytes
  SHA1 (patch-aa) = 41cf591b7553175cd5f60a1f30fb5659bab8af8f
  SHA1 (patch-ab) = 80d88458a1209f9b0fd79b1cffad168cdb6e6c71
 -SHA1 (patch-ac) = aa551173541bb651dd573120dfeb516e6f28612b
 +SHA1 (patch-ac) = 68c05d7f41fe33d2b6c6abcf2808db379aa81cf8
  SHA1 (patch-ad) = 4945ca7de73bf3294e369607a06b59bdab00653c
  SHA1 (patch-ae) = f09efe0defd526eaedf736d9c3df3bdd2a2600b8
  SHA1 (patch-af) = b8b09a97b026905418b7bcd6cd6434f6665586c4
 cvs diff: Diffing patches
 Index: patches/patch-ac
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/nspr/patches/patch-ac,v
 retrieving revision 1.1
 diff -u -p -r1.1 patch-ac
 --- patches/patch-ac    25 Jan 2005 14:50:39 -0000      1.1
 +++ patches/patch-ac    11 Jul 2005 10:13:10 -0000
 @@ -2,7 +2,16 @@ $NetBSD: patch-ac,v 1.1 2005/01/25 14:50
  
  --- ../configure.in.orig       2004-04-17 07:28:02.000000000 +0900
  +++ ../configure.in    2004-07-27 01:25:32.000000000 +0900
 -@@ -933,6 +933,9 @@
 +@@ -913,7 +913,7 @@ case "$target" in
 +     PR_MD_CSRCS=dgux.c
 +     ;;
 + 
 +-*-freebsd*)
 ++*-freebsd* | *-dragonfly*)
 +     if test -z "$USE_NSPR_THREADS"; then
 +         USE_PTHREADS=1
 +     fi
 +@@ -932,6 +932,9 @@ case "$target" in
       DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
       MDCPUCFG_H=_freebsd.cfg
       PR_MD_CSRCS=freebsd.c
 @@ -12,7 +21,7 @@ $NetBSD: patch-ac,v 1.1 2005/01/25 14:50
       ;;
   
   *-hpux*)
 -@@ -1409,6 +1412,7 @@
 +@@ -1408,6 +1411,7 @@ mips-nec-sysv*)
       AC_DEFINE(XP_UNIX)
       AC_DEFINE(NETBSD)
       AC_DEFINE(HAVE_BSD_FLOCK)
 @@ -20,3 +29,21 @@ $NetBSD: patch-ac,v 1.1 2005/01/25 14:50
       USE_NSPR_THREADS=1
       MDCPUCFG_H=_netbsd.cfg
       PR_MD_CSRCS=netbsd.c
 +@@ -2165,7 +2169,7 @@ if test -n "$USE_PTHREADS"; then
 +             _PTHREAD_LDFLAGS=
 +         fi
 +           ;;
 +-    *-freebsd*)
 ++    *-freebsd* | *-dragonfly*)
 +           AC_DEFINE(_REENTRANT)
 +           AC_DEFINE(_THREAD_SAFE)
 +           dnl -pthread links in -lc_r, so don't specify it explicitly.
 +@@ -2236,7 +2240,7 @@ case "$target" in
 +         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
 +     fi
 +     ;;
 +-*-freebsd*)
 ++*-freebsd* | *-dragonfly*)
 +     if test -n "$USE_NSPR_THREADS"; then
 +         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
 +     fi
 
 
 
 ===================
 
 
 
 diff -uNr nss.orig/Makefile nss/Makefile
 --- nss.orig/Makefile	2005-05-23 08:07:54.000000000 +1200
 +++ nss/Makefile	2005-07-11 21:51:52.000000000 +1200
 @@ -31,6 +31,10 @@
  .endif
  PLIST_SUBST+=		SO_SUFFIX=${SO_SUFFIX}
  
 +pre-configure:
 +	${CP} ${FILESDIR}/DragonFly.mk \
 +		${WRKDIR}/${DISTNAME}/mozilla/security/coreconf/
 +
  do-install:
  	${INSTALL_DATA_DIR} ${PREFIX}/include/nss
  	${INSTALL_DATA_DIR} ${PREFIX}/lib/nss
 diff -uNr nss.orig/distinfo nss/distinfo
 --- nss.orig/distinfo	2005-02-24 11:24:22.000000000 +1300
 +++ nss/distinfo	2005-07-11 21:18:01.000000000 +1200
 @@ -7,6 +7,8 @@
  SHA1 (patch-ab) = 21008be57eb73f4ddd36cf89d9ca56aa082a43ee
  SHA1 (patch-ac) = f1857c2e7de7746e66602155cc3d10996a62fc6b
  SHA1 (patch-ad) = 0fecd3fc1e5865525bcfce2fc6140622bc7a8f19
 -SHA1 (patch-ae) = 89a316ddd87ac65c675beae33fabc5c0c12667f2
 +SHA1 (patch-ae) = 6cf30e68b5e434b23c7cd8382109e70c88281ea7
  SHA1 (patch-af) = 4c933d1cfb1ec4708b69dec18ea6b3acfbd91cfa
  SHA1 (patch-ag) = e99c7396f4a6b7430321124e7c03528ab6e7681c
 +SHA1 (patch-ah) = 88f9691a3f112fdd6ccb6d811c0bbdf10c7aed8e
 +SHA1 (patch-ai) = 689577f1d94396e6683a04c07698d8f95c25a8a8
 diff -uNr nss.orig/files/DragonFly.mk nss/files/DragonFly.mk
 --- nss.orig/files/DragonFly.mk	1970-01-01 12:00:00.000000000 +1200
 +++ nss/files/DragonFly.mk	2005-07-11 21:17:13.000000000 +1200
 @@ -0,0 +1,81 @@
 +#
 +# The contents of this file are subject to the Mozilla Public
 +# License Version 1.1 (the "License"); you may not use this file
 +# except in compliance with the License. You may obtain a copy of
 +# the License at http://www.mozilla.org/MPL/
 +# 
 +# Software distributed under the License is distributed on an "AS
 +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 +# implied. See the License for the specific language governing
 +# rights and limitations under the License.
 +# 
 +# The Original Code is the Netscape security libraries.
 +# 
 +# The Initial Developer of the Original Code is Netscape
 +# Communications Corporation.  Portions created by Netscape are 
 +# Copyright (C) 1994-2000 Netscape Communications Corporation.  All
 +# Rights Reserved.
 +# 
 +# Contributor(s):
 +# 
 +# Alternatively, the contents of this file may be used under the
 +# terms of the GNU General Public License Version 2 or later (the
 +# "GPL"), in which case the provisions of the GPL are applicable 
 +# instead of those above.  If you wish to allow use of your 
 +# version of this file only under the terms of the GPL and not to
 +# allow others to use your version of this file under the MPL,
 +# indicate your decision by deleting the provisions above and
 +# replace them with the notice and other provisions required by
 +# the GPL.  If you do not delete the provisions above, a recipient
 +# may use your version of this file under either the MPL or the
 +# GPL.
 +#
 +# Config stuff for DragonFly
 +#
 +
 +include $(CORE_DEPTH)/coreconf/UNIX.mk
 +
 +DEFAULT_COMPILER	= gcc
 +CC			= gcc
 +CCC			= g++
 +RANLIB			= ranlib
 +
 +ifeq ($(OS_TEST),alpha)
 +CPU_ARCH		= alpha
 +else
 +CPU_ARCH		= x86
 +endif
 +
 +OS_CFLAGS		= $(DSO_CFLAGS) -ansi -Wall -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
 +
 +DSO_CFLAGS		= -fPIC
 +DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
 +
 +#
 +# The default implementation strategy for FreeBSD is pthreads.
 +#
 +ifndef CLASSIC_NSPR
 +USE_PTHREADS		= 1
 +DEFINES			+= -D_THREAD_SAFE -D_REENTRANT
 +OS_LIBS			+= -pthread $(BSD_LDOPTS)
 +DSO_LDOPTS		+= -pthread $(BSD_LDOPTS)
 +endif
 +
 +ARCH			= freebsd
 +
 +MOZ_OBJFORMAT		:= $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
 +
 +ifeq ($(MOZ_OBJFORMAT),elf)
 +DLL_SUFFIX		= so
 +else
 +DLL_SUFFIX		= so.1.0
 +endif
 +
 +MKSHLIB			= $(CC) $(DSO_LDOPTS)
 +ifdef MAPFILE
 +# Add LD options to restrict exported symbols to those in the map file
 +endif
 +# Change PROCESS to put the mapfile in the correct format for this platform
 +PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
 +
 +INCLUDES		+= -I/usr/X11R6/include
 diff -uNr nss.orig/patches/patch-ae nss/patches/patch-ae
 --- nss.orig/patches/patch-ae	2005-02-02 10:51:12.000000000 +1300
 +++ nss/patches/patch-ae	2005-07-11 21:04:26.000000000 +1200
 @@ -2,7 +2,16 @@
  
  --- cmd/platlibs.mk.orig	Thu Jan 20 06:55:35 2005
  +++ cmd/platlibs.mk	Thu Jan 20 06:56:07 2005
 -@@ -216,6 +216,7 @@
 +@@ -182,7 +182,7 @@ endif
 + # If GNU ld is used, we must use the -rpath-link option to tell
 + # the linker where to find libsoftokn3.so, an implicit dependency
 + # of libnss3.so.
 +-ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD, $(OS_ARCH)))
 ++ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD DragonFly, $(OS_ARCH)))
 + EXTRA_SHARED_LIBS += -Wl,-rpath-link,$(DIST)/lib
 + endif
 + 
 +@@ -216,6 +216,7 @@ EXTRA_SHARED_LIBS += \
   	-L$(DIST)/lib \
   	-lssl3 \
   	-lsmime3 \
 diff -uNr nss.orig/patches/patch-ah nss/patches/patch-ah
 --- nss.orig/patches/patch-ah	1970-01-01 12:00:00.000000000 +1200
 +++ nss/patches/patch-ah	2005-07-11 21:04:26.000000000 +1200
 @@ -0,0 +1,13 @@
 +$NetBSD$
 +
 +--- ../coreconf/config.mk.orig	2005-07-09 20:57:08.000000000 +0000
 ++++ ../coreconf/config.mk
 +@@ -59,7 +59,7 @@ endif
 + #######################################################################
 + 
 + TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
 +-              OpenVMS AIX
 ++              OpenVMS AIX DragonFly
 + 
 + ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
 + include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
 diff -uNr nss.orig/patches/patch-ai nss/patches/patch-ai
 --- nss.orig/patches/patch-ai	1970-01-01 12:00:00.000000000 +1200
 +++ nss/patches/patch-ai	2005-07-11 21:04:26.000000000 +1200
 @@ -0,0 +1,13 @@
 +$NetBSD$
 +
 +--- ../../dbm/src/mktemp.c.orig	2005-07-09 21:08:37.000000000 +0000
 ++++ ../../dbm/src/mktemp.c
 +@@ -100,7 +100,7 @@ mktemp(char *path)
 + static int 
 + _gettemp(char *path, register int *doopen, int extraFlags)
 + {    
 +-#if !defined(_WINDOWS) || defined(_WIN32)
 ++#if (!defined(_WINDOWS) || defined(_WIN32)) && !defined(errno)
 + 	extern int errno;                    
 + #endif
 + 	register char *start, *trv;