pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

emacs-current: Replace hacks.mk with patches suggested by upstream.



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Thu Apr 28 00:51:30 2016 +0200
Changeset:	d0b85c07cdd80459028f3d5b40506bcddff24fde

Added Files:
	emacs-current/patches/patch-configure.ac
	emacs-current/patches/patch-src_Makefile.in
Removed Files:
	emacs-current/hacks.mk

Log Message:
emacs-current: Replace hacks.mk with patches suggested by upstream.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d0b85c07cdd80459028f3d5b40506bcddff24fde

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 emacs-current/hacks.mk                      | 23 ---------
 emacs-current/patches/patch-configure.ac    | 73 +++++++++++++++++++++++++++++
 emacs-current/patches/patch-src_Makefile.in | 61 ++++++++++++++++++++++++
 3 files changed, 134 insertions(+), 23 deletions(-)

diffs:
diff --git a/emacs-current/hacks.mk b/emacs-current/hacks.mk
deleted file mode 100644
index 2eee6df..0000000
--- a/emacs-current/hacks.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-# $NetBSD: hacks.mk,v 1.2 2016/04/12 13:25:21 ryoon Exp $
-
-.if !defined(EMACS_HACKS_MK)
-EMACS_HACKS_MK=	defined
-
-.include "../../mk/compiler.mk"
-
-### PaX is enabled, bootstrap-emacs command dumps core with segfault.
-### src/Makefile.in does not support NetBSD paxctl(8) syntax.
-### http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23371
-###
-.  if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64)
-.    if exists(/usr/sbin/paxctl)
-SUBST_CLASSES+=			paxctl
-SUBST_STAGE.paxctl=		pre-configure
-SUBST_MESSAGE.paxctl=		Setting paxctl command
-SUBST_FILES.paxctl+=		src/Makefile.in
-SUBST_SED.paxctl+=		-e 's,$$(PAXCTL_if_present) -zex,/usr/sbin/paxctl +a,g'
-SUBST_SED.paxctl+=		-e 's,$$(PAXCTL_if_present) -r,/usr/sbin/paxctl +a,g'
-.    endif
-.  endif
-
-.endif  # EMACS_HACKS_MK
diff --git a/emacs-current/patches/patch-configure.ac b/emacs-current/patches/patch-configure.ac
new file mode 100644
index 0000000..1c6444c
--- /dev/null
+++ b/emacs-current/patches/patch-configure.ac
@@ -0,0 +1,73 @@
+$NetBSD$
+
+Problem reported by Thomas Klausner (Bug#23371).
+* configure.ac (PAXCTL_dumped, PAXCTL_notdumped): New vars.
+Set them to setfattr and/or paxctl commands appropriate for
+GNU/Linux and/or NetBSD; the latter prefers paxctl +a.  Search
+for paxctl only if setfattr is not found.
+* src/Makefile.in (PAXCTL_dumped, PAXCTL_notdumped):
+New vars, replacing PAXCTL_if_present and SETFATTR_if_present.
+All uses changed.
+
+--- configure.ac.orig	2016-04-22 16:23:52.000000000 +0000
++++ configure.ac
+@@ -1159,16 +1159,9 @@ AC_PATH_PROG(GZIP_PROG, gzip)
+ test $with_compress_install != yes && test -n "$GZIP_PROG" && \
+    GZIP_PROG=" # $GZIP_PROG # (disabled by configure --without-compress-install)"
+ 
++PAXCTL_dumped=
++PAXCTL_notdumped=
+ if test $opsys = gnu-linux; then
+-  AC_PATH_PROG(PAXCTL, paxctl,,
+-    [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
+-  if test "X$PAXCTL" != X; then
+-    AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header])
+-    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+-      [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then AC_MSG_RESULT(yes)
+-      else AC_MSG_RESULT(no); PAXCTL=""; fi])
+-  fi
+-
+   if test "${SETFATTR+set}" != set; then
+     AC_CACHE_CHECK([for setfattr],
+       [emacs_cv_prog_setfattr],
+@@ -1179,6 +1172,7 @@ if test $opsys = gnu-linux; then
+ 	 emacs_cv_prog_setfattr=no
+        fi])
+     if test "$emacs_cv_prog_setfattr" = yes; then
++      PAXCTL_notdumped='$(SETFATTR) -n user.pax.flags -v er'
+       SETFATTR=setfattr
+     else
+       SETFATTR=
+@@ -1187,6 +1181,32 @@ if test $opsys = gnu-linux; then
+     AC_SUBST([SETFATTR])
+   fi
+ fi
++case $opsys,$PAXCTL_notdumped in
++  gnu-linux, | netbsd,)
++    AC_PATH_PROG([PAXCTL], [paxctl], [],
++      [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
++    if test -n "$PAXCTL"; then
++      if test "$opsys" = netbsd; then
++	PAXCTL_dumped='$(PAXCTL) +a'
++	PAXCTL_notdumped='$(PAXCTL) +a'
++      else
++	AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header])
++	AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
++	  [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then
++	     AC_MSG_RESULT([yes])
++	   else
++	     AC_MSG_RESULT([no])
++	     PAXCTL=
++	   fi])
++	if test -n "$PAXCTL"; then
++	  PAXCTL_dumped='$(PAXCTL) -zex'
++	  PAXCTL_notdumped='$(PAXCTL) -r'
++	fi
++      fi
++    fi;;
++esac
++AC_SUBST([PAXCTL_dumped])
++AC_SUBST([PAXCTL_notdumped])
+ 
+ ## Need makeinfo >= 4.7 (?) to build the manuals.
+ if test "$MAKEINFO" != "no"; then
diff --git a/emacs-current/patches/patch-src_Makefile.in b/emacs-current/patches/patch-src_Makefile.in
new file mode 100644
index 0000000..d7e3d51
--- /dev/null
+++ b/emacs-current/patches/patch-src_Makefile.in
@@ -0,0 +1,61 @@
+$NetBSD$
+
+Problem reported by Thomas Klausner (Bug#23371).
+* configure.ac (PAXCTL_dumped, PAXCTL_notdumped): New vars.
+Set them to setfattr and/or paxctl commands appropriate for
+GNU/Linux and/or NetBSD; the latter prefers paxctl +a.  Search
+for paxctl only if setfattr is not found.
+* src/Makefile.in (PAXCTL_dumped, PAXCTL_notdumped):
+New vars, replacing PAXCTL_if_present and SETFATTR_if_present.
+All uses changed.
+
+--- src/Makefile.in.orig	2016-04-17 20:51:40.000000000 +0000
++++ src/Makefile.in
+@@ -114,8 +114,9 @@ TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(L
+ ## around this, newer ones setfattr.  See Bug#11398 and Bug#16343.
+ PAXCTL = @PAXCTL@
+ SETFATTR = @SETFATTR@
+-PAXCTL_if_present = $(or $(PAXCTL),: paxctl)
+-SETFATTR_if_present = $(or $(SETFATTR),: setfattr)
++## Commands to set PaX flags on dumped and not-dumped instances of Emacs.
++PAXCTL_dumped = @PAXCTL_dumped@
++PAXCTL_notdumped = @PAXCTL_notdumped@
+ 
+ ## Some systems define this to request special libraries.
+ LIBS_SYSTEM=@LIBS_SYSTEM@
+@@ -542,8 +543,10 @@ ifeq ($(CANNOT_DUMP),yes)
+ 	ln -f temacs$(EXEEXT) $@
+ else
+ 	LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup dump
+-	$(PAXCTL_if_present) -zex $@
++ifneq ($(PAXCTL_dumped),)
++	$(PAXCTL_dumped) $@
++endif
+ 	ln -f $@ bootstrap-emacs$(EXEEXT)
+ endif
+ 
+ ## We run make-docfile twice because the command line may get too long
+@@ -606,8 +612,9 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) 
+ 	  -o temacs $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)
+ 	$(MKDIR_P) $(etc)
+ ifneq ($(CANNOT_DUMP),yes)
+-	$(PAXCTL_if_present) -r $@
+-	$(SETFATTR_if_present) -n user.pax.flags -v er $@
++  ifneq ($(PAXCTL_notdumped),)
++	$(PAXCTL_notdumped) $@
++  endif
+ endif
+ 
+ ## The following oldxmenu-related rules are only (possibly) used if
+@@ -748,8 +755,10 @@ ifeq ($(CANNOT_DUMP),yes)
+ 	ln -f temacs$(EXEEXT) $@
+ else
+ 	$(RUN_TEMACS) --batch $(BUILD_DETAILS) --load loadup bootstrap
+-	$(PAXCTL_if_present) -zex emacs$(EXEEXT)
++ifneq ($(PAXCTL_dumped),)
++	$(PAXCTL_dumped) emacs$(EXEEXT)
++endif
+ 	mv -f emacs$(EXEEXT) $@
+ endif
+ 	@: Compile some files earlier to speed up further compilation.
+ 	$(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)"


Home | Main Index | Thread Index | Old Index