aboutsummaryrefslogtreecommitdiff
path: root/editors/mg
diff options
context:
space:
mode:
authorOlivier Duchateau <olivierd@FreeBSD.org>2016-10-06 19:51:19 +0000
committerOlivier Duchateau <olivierd@FreeBSD.org>2016-10-06 19:51:19 +0000
commit0f3528e19a95717b8e308ee0bd6816dea54955b4 (patch)
treef192247f7d7c703f0af8999e97e5f77211415e23 /editors/mg
parent2851c7e1e1e824f4bf4679052b9c9101316404ed (diff)
downloadports-0f3528e19a95717b8e308ee0bd6816dea54955b4.tar.gz
ports-0f3528e19a95717b8e308ee0bd6816dea54955b4.zip
- Update to 20160912 snapshot
- Remove GNUmakefile patch, port doesn't use gmake - Replace patches by another, when reallocarray(3) is missing - Pass maintainership to submitter - Add LICENSE - Update pkg-descr PR: 212634 Submitted by: Tobias Kortkamp Approved by: <darcsis@gmail.com> (previous maintainer, timeout > 3 weeks)
Notes
Notes: svn path=/head/; revision=423435
Diffstat (limited to 'editors/mg')
-rw-r--r--editors/mg/Makefile15
-rw-r--r--editors/mg/distinfo5
-rw-r--r--editors/mg/files/extra-patch-def.h11
-rw-r--r--editors/mg/files/patch-GNUmakefile22
-rw-r--r--editors/mg/files/patch-Makefile2
-rw-r--r--editors/mg/files/patch-autoexec.c34
-rw-r--r--editors/mg/files/patch-def.h11
-rw-r--r--editors/mg/files/patch-display.c40
-rw-r--r--editors/mg/files/reallocarray.c39
-rw-r--r--editors/mg/pkg-descr15
10 files changed, 67 insertions, 127 deletions
diff --git a/editors/mg/Makefile b/editors/mg/Makefile
index 8860aa4b1c66..1aa1fcdd5e2d 100644
--- a/editors/mg/Makefile
+++ b/editors/mg/Makefile
@@ -2,14 +2,15 @@
# $FreeBSD$
PORTNAME= mg
-PORTVERSION= 20160421
-PORTREVISION= 1
+PORTVERSION= 20160912
CATEGORIES= editors
MASTER_SITES= http://homepage.boetes.org/software/mg/
-MAINTAINER= darcsis@gmail.com
+MAINTAINER= t@tobik.me
COMMENT= Small, fast Emacs-like editor
+LICENSE= PD
+
USES= ncurses
PLIST_FILES= bin/mg man/man1/mg.1.gz
PORTDOCS= README tutorial
@@ -22,6 +23,14 @@ OPTIONS_DEFINE= DOCS
BROKEN= does not build, requires futimens system call
.endif
+.if ${OSVERSION} >= 1002506 && ${OSVERSION} < 1100072
+EXTRA_PATCHES= ${FILESDIR}/extra-patch-def.h
+
+post-patch:
+ ${CP} ${FILESDIR}/reallocarray.c ${WRKSRC}
+ @${REINPLACE_CMD} -e 's| theo.c| theo.c reallocarray.c|' ${WRKSRC}/Makefile
+.endif
+
pre-configure:
@${REINPLACE_CMD} -e 's|__dead|__dead2|' ${WRKSRC}/main.c
diff --git a/editors/mg/distinfo b/editors/mg/distinfo
index ce88d648dff5..210a46059b26 100644
--- a/editors/mg/distinfo
+++ b/editors/mg/distinfo
@@ -1,2 +1,3 @@
-SHA256 (mg-20160421.tar.gz) = b5dd8fbecb8a0ff0f32588c448f22f25fafcbfb297857e76d2883598a3e63a9a
-SIZE (mg-20160421.tar.gz) = 145187
+TIMESTAMP = 1473715513
+SHA256 (mg-20160912.tar.gz) = 0b050456b78d767d13839486e01705de6acf407f27052c204505e166eb698176
+SIZE (mg-20160912.tar.gz) = 145176
diff --git a/editors/mg/files/extra-patch-def.h b/editors/mg/files/extra-patch-def.h
new file mode 100644
index 000000000000..d22292c786f1
--- /dev/null
+++ b/editors/mg/files/extra-patch-def.h
@@ -0,0 +1,11 @@
+--- def.h.orig 2016-09-01 15:30:59 UTC
++++ def.h
+@@ -328,6 +328,8 @@ struct undo_rec {
+ * Prototypes.
+ */
+
++void *reallocarray(void*, size_t, size_t);
++
+ /* tty.c X */
+ void ttinit(void);
+ void ttreinit(void);
diff --git a/editors/mg/files/patch-GNUmakefile b/editors/mg/files/patch-GNUmakefile
deleted file mode 100644
index 8aaf7ab71e43..000000000000
--- a/editors/mg/files/patch-GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
---- GNUmakefile.orig 2016-01-18 15:01:49 UTC
-+++ GNUmakefile
-@@ -17,16 +17,10 @@ PKG_CONFIG= /usr/bin/pkg-config
- INSTALL= /usr/bin/install
- STRIP= /usr/bin/strip
-
--UNAME:= $(shell uname)
--ifeq ($(UNAME),FreeBSD)
-- BSD_CPPFLAGS:=
-- BSD_LIBS:= -lutil
--else
-- BSD_CPPFLAGS:=$(shell $(PKG_CONFIG) --cflags libbsd-overlay)
-- BSD_LIBS:= $(shell $(PKG_CONFIG) --libs libbsd-overlay)
--endif
-+BSD_CPPFLAGS:=
-+BSD_LIBS:= -lutil
-
--CURSES_LIBS= -lcurses
-+CURSES_LIBS= -lncurses
-
- CC?= gcc
- CFLAGS?= -O2 -pipe
diff --git a/editors/mg/files/patch-Makefile b/editors/mg/files/patch-Makefile
index fa86826ccd80..46af7b059161 100644
--- a/editors/mg/files/patch-Makefile
+++ b/editors/mg/files/patch-Makefile
@@ -1,4 +1,4 @@
---- Makefile.orig 2016-01-07 18:55:54 UTC
+--- Makefile.orig 2016-09-12 16:36:25 UTC
+++ Makefile
@@ -2,7 +2,7 @@
diff --git a/editors/mg/files/patch-autoexec.c b/editors/mg/files/patch-autoexec.c
deleted file mode 100644
index aa851258f3c9..000000000000
--- a/editors/mg/files/patch-autoexec.c
+++ /dev/null
@@ -1,34 +0,0 @@
---- autoexec.c.orig 2015-03-23 11:03:05 UTC
-+++ autoexec.c
-@@ -2,12 +2,17 @@
- /* this file is in the public domain */
- /* Author: Vincent Labrecque <vincent@openbsd.org> April 2002 */
-
-+#include <sys/param.h>
- #include <sys/queue.h>
- #include <fnmatch.h>
- #include <signal.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#ifndef __OpenBSD__
-+#include <stdlib.h>
-+#include <malloc_np.h>
-+#endif
-
- #include "def.h"
- #include "funmap.h"
-@@ -44,8 +49,13 @@ find_autoexec(const char *fname)
- SLIST_FOREACH(ae, &autos, next) {
- if (fnmatch(ae->pattern, fname, 0) == 0) {
- if (used >= have) {
-+ #if defined(__OpenBSD__)
- npfl = reallocarray(pfl, have + AUTO_GROW + 1,
- sizeof(PF));
-+ #else
-+ npfl = realloc(pfl, (have + AUTO_GROW + 1) *
-+ sizeof(PF));
-+ #endif
- if (npfl == NULL)
- panic("out of memory");
- pfl = npfl;
diff --git a/editors/mg/files/patch-def.h b/editors/mg/files/patch-def.h
deleted file mode 100644
index cdd9c9678db9..000000000000
--- a/editors/mg/files/patch-def.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- def.h.orig 2015-03-23 11:23:30 UTC
-+++ def.h
-@@ -13,6 +13,8 @@
- #include "chrdef.h"
- #include "ttydef.h"
-
-+#include <sys/types.h>
-+
-
- /* necesarry to get asprintf & friends with glibc XXX doesn't work for some
- * mysterious reason! */
diff --git a/editors/mg/files/patch-display.c b/editors/mg/files/patch-display.c
deleted file mode 100644
index d73358856978..000000000000
--- a/editors/mg/files/patch-display.c
+++ /dev/null
@@ -1,40 +0,0 @@
---- display.c.orig 2015-03-16 14:39:00 UTC
-+++ display.c
-@@ -170,14 +170,6 @@ vtresize(int force, int newrow, int newc
- (a) = tmp; \
- } while (0)
-
--#define TRYREALLOCARRAY(a, n, m) do { \
-- void *tmp; \
-- if ((tmp = reallocarray((a), (n), (m))) == NULL) {\
-- panic("out of memory in display code"); \
-- } \
-- (a) = tmp; \
-- } while (0)
--
- /* No update needed */
- if (!first_run && !force && !rowchanged && !colchanged)
- return (TRUE);
-@@ -206,10 +198,10 @@ vtresize(int force, int newrow, int newc
- }
- }
-
-- TRYREALLOCARRAY(score, newrow, newrow * sizeof(struct score));
-- TRYREALLOCARRAY(vscreen, (newrow - 1), sizeof(struct video *));
-- TRYREALLOCARRAY(pscreen, (newrow - 1), sizeof(struct video *));
-- TRYREALLOCARRAY(video, (newrow - 1), 2 * sizeof(struct video));
-+ TRYREALLOC(score, newrow * newrow * sizeof(struct score));
-+ TRYREALLOC(vscreen, (newrow - 1) * sizeof(struct video *));
-+ TRYREALLOC(pscreen, (newrow - 1) * sizeof(struct video *));
-+ TRYREALLOC(video, ((newrow - 1) * 2) * sizeof(struct video));
-
- /*
- * Zero-out the entries we just allocated.
-@@ -247,7 +239,6 @@ vtresize(int force, int newrow, int newc
- }
-
- #undef TRYREALLOC
--#undef TRYREALLOCARRAY
-
- /*
- * Initialize the data structures used
diff --git a/editors/mg/files/reallocarray.c b/editors/mg/files/reallocarray.c
new file mode 100644
index 000000000000..21b0914fe484
--- /dev/null
+++ b/editors/mg/files/reallocarray.c
@@ -0,0 +1,39 @@
+/* $OpenBSD: reallocarray.c,v 1.3 2015/09/13 08:31:47 guenther Exp $ */
+/*
+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/*
+ * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
+ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
+ */
+#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
+
+void *
+reallocarray(void *optr, size_t nmemb, size_t size)
+{
+ if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+ nmemb > 0 && SIZE_MAX / nmemb < size) {
+ errno = ENOMEM;
+ return NULL;
+ }
+ return realloc(optr, size * nmemb);
+}
+
diff --git a/editors/mg/pkg-descr b/editors/mg/pkg-descr
index 220cca276b3f..e30ec0e2aed3 100644
--- a/editors/mg/pkg-descr
+++ b/editors/mg/pkg-descr
@@ -3,17 +3,4 @@ editor maintained by the OpenBSD Project. It is intended for people
who can't, or don't want to, run the real GNU Emacs, or are not
familiar with the vi(1) editor.
-Although it is intended to be largely compatible with GNU Emacs, Mg
-doesn't have special modes for tasks other than editing plain text.
-Moreover, since it is written entirely in C, there is no language in
-which to write extensions in (read: no builtin Lisp interpreter).
-
-If you are looking for something that looks like Emacs (don't want to
-learn another editor) but don't have the resources to run the latter,
-this may be what you're looking for.
-
-Enjoy!
-
- Dima Dorfman
- dima@unixfreak.org
- 14 May 2001
+WWW: http://homepage.boetes.org/software/mg/