Mon Nov 26 16:56:16 2012 UTC ()
Use openpty() from libutil on *BSD (patch from Peter Bex).
Declare proper POSIX version for fcntl.h *at functions.


(martin)
diff -r1.9 -r1.10 pkgsrc/editors/emacs24/Makefile
diff -r1.6 -r1.7 pkgsrc/editors/emacs24/distinfo
diff -r1.3 -r1.4 pkgsrc/editors/emacs24/patches/patch-aa
diff -r1.3 -r1.4 pkgsrc/editors/emacs24/patches/patch-ab
diff -r0 -r1.1 pkgsrc/editors/emacs24/patches/patch-lib-careadlinkat.h
diff -r0 -r1.1 pkgsrc/editors/emacs24/patches/patch-src-s-bsd--common.h

cvs diff -r1.9 -r1.10 pkgsrc/editors/emacs24/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/editors/emacs24/Attic/Makefile 2012/10/08 23:01:26 1.9
+++ pkgsrc/editors/emacs24/Attic/Makefile 2012/11/26 16:56:15 1.10
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.9 2012/10/08 23:01:26 adam Exp $ 1# $NetBSD: Makefile,v 1.10 2012/11/26 16:56:15 martin Exp $
2 2
3PKGREVISION= 3 3PKGREVISION= 4
4 4
5CONFLICTS+= emacs-nox11-[0-9]* 5CONFLICTS+= emacs-nox11-[0-9]*
6 6
7.include "../../editors/emacs24/Makefile.common" 7.include "../../editors/emacs24/Makefile.common"
8 8
9.include "options.mk" 9.include "options.mk"
10 10
11SUBST_CLASSES+= prefix 11SUBST_CLASSES+= prefix
12SUBST_STAGE.prefix= pre-configure 12SUBST_STAGE.prefix= pre-configure
13SUBST_VARS.prefix= PREFIX 13SUBST_VARS.prefix= PREFIX
14SUBST_FILES.prefix= src/s/netbsd.h 14SUBST_FILES.prefix= src/s/netbsd.h
15 15
16.include "../../graphics/hicolor-icon-theme/buildlink3.mk" 16.include "../../graphics/hicolor-icon-theme/buildlink3.mk"

cvs diff -r1.6 -r1.7 pkgsrc/editors/emacs24/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/editors/emacs24/Attic/distinfo 2012/10/03 21:32:42 1.6
+++ pkgsrc/editors/emacs24/Attic/distinfo 2012/11/26 16:56:15 1.7
@@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
1$NetBSD: distinfo,v 1.6 2012/10/03 21:32:42 marino Exp $ 1$NetBSD: distinfo,v 1.7 2012/11/26 16:56:15 martin Exp $
2 2
3SHA1 (emacs-24.2.tar.gz) = 5fc4fe7797f821f2021ac415a81f5f190c52c0b2 3SHA1 (emacs-24.2.tar.gz) = 5fc4fe7797f821f2021ac415a81f5f190c52c0b2
4RMD160 (emacs-24.2.tar.gz) = 26f6c2b671ed7f160875d62e47c89afec085110f 4RMD160 (emacs-24.2.tar.gz) = 26f6c2b671ed7f160875d62e47c89afec085110f
5Size (emacs-24.2.tar.gz) = 51471017 bytes 5Size (emacs-24.2.tar.gz) = 51471017 bytes
6SHA1 (patch-aa) = e8e2e174a87c6d052af3fde2907f29f76d3554bd 6SHA1 (patch-aa) = ea9f7acf0142c7ae169da9674fa16e6492b30479
7SHA1 (patch-ab) = ca3fb1ee6652f6a33758bc07cf93a7eeff2afcd2 7SHA1 (patch-ab) = 8687278fcc8f8ae072c72681ae05ce1f12481cba
8SHA1 (patch-ad) = 2dcb0f4b43c599d0c4af83b5f7e1f2797f96bdac 8SHA1 (patch-ad) = 2dcb0f4b43c599d0c4af83b5f7e1f2797f96bdac
9SHA1 (patch-ag) = 3e6ee4774189185af10eada9c935120491318313 9SHA1 (patch-ag) = 3e6ee4774189185af10eada9c935120491318313
 10SHA1 (patch-lib-careadlinkat.h) = f236d182e609bf7111c70e83e10806a75a220c29
 11SHA1 (patch-src-s-bsd--common.h) = bea4405e7cbe0a71b41f8ea52030eeb629d95a40

cvs diff -r1.3 -r1.4 pkgsrc/editors/emacs24/patches/Attic/patch-aa (expand / switch to unified diff)

--- pkgsrc/editors/emacs24/patches/Attic/patch-aa 2012/10/03 21:32:42 1.3
+++ pkgsrc/editors/emacs24/patches/Attic/patch-aa 2012/11/26 16:56:16 1.4
@@ -1,34 +1,43 @@ @@ -1,34 +1,43 @@
1$NetBSD: patch-aa,v 1.3 2012/10/03 21:32:42 marino Exp $ 1$NetBSD: patch-aa,v 1.4 2012/11/26 16:56:16 martin Exp $
2 2
3Add DragonFly 3Add DragonFly
4 4
5--- configure.in.orig 2012-08-23 05:33:42.000000000 +0000 5--- configure.in.orig 2012-08-23 05:33:42.000000000 +0000
6+++ configure.in 6+++ configure.in
7@@ -469,6 +469,14 @@ case "${canonical}" in 7@@ -469,6 +469,14 @@ case "${canonical}" in
8 vax-*) machine=vax ;; 8 vax-*) machine=vax ;;
9 esac 9 esac
10 ;; 10 ;;
11+ ## DragonFly ports 11+ ## DragonFly ports
12+ *-*-dragonfly*) 12+ *-*-dragonfly*)
13+ opsys=dragonfly 13+ opsys=dragonfly
14+ case "${canonical}" in 14+ case "${canonical}" in
15+ i[3456]86-*-dragonfly*) machine=intel386 ;; 15+ i[3456]86-*-dragonfly*) machine=intel386 ;;
16+ amd64-*-dragonfly*|x86_64-*-dragonfly*) machine=amdx86-64 ;; 16+ amd64-*-dragonfly*|x86_64-*-dragonfly*) machine=amdx86-64 ;;
17+ esac 17+ esac
18+ ;; 18+ ;;
19  19
20 ## OpenBSD ports 20 ## OpenBSD ports
21 *-*-openbsd* ) 21 *-*-openbsd* )
 22@@ -955,7 +955,7 @@
 23 ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
 24 aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
 25
 26- freebsd) LIBS_SYSTEM="-lutil" ;;
 27+ freebsd|netbsd|openbsd) LIBS_SYSTEM="-lutil" ;;
 28
 29 hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
 30
22@@ -999,6 +1007,11 @@ case $opsys in 31@@ -999,6 +1007,11 @@ case $opsys in
23 LIB_MATH= 32 LIB_MATH=
24 START_FILES='pre-crt0.o' 33 START_FILES='pre-crt0.o'
25 ;; 34 ;;
26+ dragonfly ) 35+ dragonfly )
27+ # This base version is appended below 36+ # This base version is appended below
28+ LIB_STANDARD='-lc $(CRT_DIR)/crtn.o' 37+ LIB_STANDARD='-lc $(CRT_DIR)/crtn.o'
29+ START_FILES='$(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o' 38+ START_FILES='$(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
30+ ;; 39+ ;;
31 freebsd ) 40 freebsd )
32 LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' 41 LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
33 START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' 42 START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
34@@ -1095,6 +1108,28 @@ fi # crt_fi 43@@ -1095,6 +1108,28 @@ fi # crt_fi

cvs diff -r1.3 -r1.4 pkgsrc/editors/emacs24/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/editors/emacs24/patches/Attic/patch-ab 2012/10/03 21:32:42 1.3
+++ pkgsrc/editors/emacs24/patches/Attic/patch-ab 2012/11/26 16:56:16 1.4
@@ -1,35 +1,44 @@ @@ -1,35 +1,44 @@
1$NetBSD: patch-ab,v 1.3 2012/10/03 21:32:42 marino Exp $ 1$NetBSD: patch-ab,v 1.4 2012/11/26 16:56:16 martin Exp $
2 2
3Add DragonFly 3Add DragonFly
4 4
5--- configure.orig 2012-08-23 06:37:10.000000000 +0000 5--- configure.orig 2012-08-23 06:37:10.000000000 +0000
6+++ configure 6+++ configure
7@@ -4476,6 +4476,15 @@ case "${canonical}" in 7@@ -4476,6 +4476,15 @@ case "${canonical}" in
8 esac 8 esac
9 ;; 9 ;;
10  10
11+ ## DragonFly ports 11+ ## DragonFly ports
12+ *-*-dragonfly*) 12+ *-*-dragonfly*)
13+ opsys=dragonfly 13+ opsys=dragonfly
14+ case "${canonical}" in 14+ case "${canonical}" in
15+ i[3456]86-*-dragonfly*) machine=intel386 ;; 15+ i[3456]86-*-dragonfly*) machine=intel386 ;;
16+ amd64-*-dragonfly*|x86_64-*-dragonfly*) machine=amdx86-64 ;; 16+ amd64-*-dragonfly*|x86_64-*-dragonfly*) machine=amdx86-64 ;;
17+ esac 17+ esac
18+ ;; 18+ ;;
19+ 19+
20 ## OpenBSD ports 20 ## OpenBSD ports
21 *-*-openbsd* ) 21 *-*-openbsd* )
22 opsys=openbsd 22 opsys=openbsd
 23@@ -7854,7 +7854,7 @@
 24 ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
 25 aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
 26
 27- freebsd) LIBS_SYSTEM="-lutil" ;;
 28+ freebsd|netbsd|openbsd) LIBS_SYSTEM="-lutil" ;;
 29
 30 hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
 31
23@@ -8095,6 +8104,11 @@ case $opsys in 32@@ -8095,6 +8104,11 @@ case $opsys in
24 LIB_MATH= 33 LIB_MATH=
25 START_FILES='pre-crt0.o' 34 START_FILES='pre-crt0.o'
26 ;; 35 ;;
27+ dragonfly ) 36+ dragonfly )
28+ # This base version is appended below 37+ # This base version is appended below
29+ LIB_STANDARD='-lc $(CRT_DIR)/crtn.o' 38+ LIB_STANDARD='-lc $(CRT_DIR)/crtn.o'
30+ START_FILES='$(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o' 39+ START_FILES='$(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
31+ ;; 40+ ;;
32 freebsd ) 41 freebsd )
33 LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' 42 LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
34 START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' 43 START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
35@@ -8209,6 +8223,51 @@ fi # crt_fi 44@@ -8209,6 +8223,51 @@ fi # crt_fi

File Added: pkgsrc/editors/emacs24/patches/Attic/patch-lib-careadlinkat.h
$NetBSD: patch-lib-careadlinkat.h,v 1.1 2012/11/26 16:56:16 martin Exp $

# the *at functions are only available for newer POSIX versions

--- lib/careadlinkat.h.orig	2012-08-23 07:33:42.000000000 +0200
+++ lib/careadlinkat.h	2012-11-26 17:22:41.000000000 +0100
@@ -20,6 +20,7 @@
 #ifndef _GL_CAREADLINKAT_H
 #define _GL_CAREADLINKAT_H
 
+#define _POSIX_C_SOURCE	200809L
 #include <fcntl.h>
 #include <unistd.h>
 

File Added: pkgsrc/editors/emacs24/patches/Attic/patch-src-s-bsd--common.h
$NetBSD: patch-src-s-bsd--common.h,v 1.1 2012/11/26 16:56:16 martin Exp $

# make NetBSD use openpty(), like MacOS

--- src/s/bsd-common.h.orig	2012-11-14 22:04:22.000000000 +0100
+++ src/s/bsd-common.h	2012-11-14 22:23:22.000000000 +0100
@@ -59,6 +59,21 @@
 
 /* Define HAVE_PTYS if the system supports pty devices.  */
 #define HAVE_PTYS
+/* Run only once.  We need a `for'-loop because the code uses `continue'.  */
+#define PTY_ITERATION	int i; for (i = 0; i < 1; i++)
+#define PTY_NAME_SPRINTF	/* none */
+#define PTY_TTY_NAME_SPRINTF	/* none */
+
+#define PTY_OPEN						\
+  do								\
+    {								\
+      int slave;						\
+      if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1)	\
+	fd = -1;						\
+      else							\
+	emacs_close (slave);					\
+    }								\
+  while (0)
 
 /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
 #define HAVE_SOCKETS