diff options
author | olivierd <olivierd@FreeBSD.org> | 2016-10-07 03:51:19 +0800 |
---|---|---|
committer | olivierd <olivierd@FreeBSD.org> | 2016-10-07 03:51:19 +0800 |
commit | cc1185d954caffa5fdcc8a68388b644d371d1fbf (patch) | |
tree | f192247f7d7c703f0af8999e97e5f77211415e23 /editors | |
parent | 7a9a7a66cf9181ca0b0df9491ff28fa6084a9915 (diff) | |
download | freebsd-ports-graphics-cc1185d954caffa5fdcc8a68388b644d371d1fbf.tar.gz freebsd-ports-graphics-cc1185d954caffa5fdcc8a68388b644d371d1fbf.tar.zst freebsd-ports-graphics-cc1185d954caffa5fdcc8a68388b644d371d1fbf.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)
Diffstat (limited to 'editors')
-rw-r--r-- | editors/mg/Makefile | 15 | ||||
-rw-r--r-- | editors/mg/distinfo | 5 | ||||
-rw-r--r-- | editors/mg/files/extra-patch-def.h | 11 | ||||
-rw-r--r-- | editors/mg/files/patch-GNUmakefile | 22 | ||||
-rw-r--r-- | editors/mg/files/patch-Makefile | 2 | ||||
-rw-r--r-- | editors/mg/files/patch-autoexec.c | 34 | ||||
-rw-r--r-- | editors/mg/files/patch-def.h | 11 | ||||
-rw-r--r-- | editors/mg/files/patch-display.c | 40 | ||||
-rw-r--r-- | editors/mg/files/reallocarray.c | 39 | ||||
-rw-r--r-- | editors/mg/pkg-descr | 15 |
10 files changed, 67 insertions, 127 deletions
diff --git a/editors/mg/Makefile b/editors/mg/Makefile index 8860aa4b1c6..1aa1fcdd5e2 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 ce88d648dff..210a46059b2 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 00000000000..d22292c786f --- /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 8aaf7ab71e4..00000000000 --- 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 fa86826ccd8..46af7b05916 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 aa851258f3c..00000000000 --- 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 cdd9c9678db..00000000000 --- 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 d7335885697..00000000000 --- 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 00000000000..21b0914fe48 --- /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 220cca276b3..e30ec0e2aed 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/ |