Hi ports@,
The attached patch brings textproc/multimarkdown up to the latest
release (5.1.0). It ditches a bunch of patches, some of which are no
longer necessary and some of which I tried and failed to sell to the
upstream.
Works okay for me on i386. Sadly I have no other -current machines
right now.
Pax, -A
--
http://haqistan.net/~attila | [email protected] | 0xE6CC1EDB
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile 5 Apr 2015 13:31:15 -0000 1.2
+++ Makefile 16 Mar 2016 01:00:52 -0000
@@ -1,13 +1,13 @@
# $OpenBSD: Makefile,v 1.2 2015/04/05 13:31:15 sthen Exp $
-V = 4.7.1
+V = 5.1.0
COMMENT = marked-up plain text to formatted document converter
DISTNAME = ${GH_PROJECT}-${V}
PKGNAME = multimarkdown-${V}
CATEGORIES = textproc
GH_ACCOUNT = fletcher
-GH_PROJECT = MultiMarkdown-4
+GH_PROJECT = MultiMarkdown-5
GH_TAGNAME = ${V}
HOMEPAGE = http://fletcherpenney.net/multimarkdown/
@@ -21,14 +21,18 @@ WANTLIB += c
BUILD_DEPENDS = devel/greg
USE_GMAKE = Yes
-ALL_TARGET = ALL
-MAKE_FLAGS = CFLAGS="${CFLAGS} -include GLibFacade.h -DHAVE_ARC4RANDOM" \
- GREG=${LOCALBASE}/bin/greg
+# avoid using cmake, not necc for us
+ALL_TARGET = deprecated
+
+# golf MAKE_FLAGS down to 80chars.. :-|
+_i = -include
+_incs = ${_i} src/GLibFacade.h ${_i} src/version.h ${_i} src/parser.h
+MAKE_FLAGS = CFLAGS="${CFLAGS} ${_incs}"
# Test files aren't included in distfile.
NO_TEST = Yes
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/multimarkdown ${PREFIX}/bin/
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/multimarkdown ${PREFIX}/bin/
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ distinfo 16 Mar 2016 01:00:52 -0000
@@ -1,2 +1,2 @@
-SHA256 (MultiMarkdown-4-4.7.1.tar.gz) = gy5dzm+hv/TWfmSsLMJPCSCujZEoDlPqh5I3odQ/SGU=
-SIZE (MultiMarkdown-4-4.7.1.tar.gz) = 120896
+SHA256 (MultiMarkdown-5-5.1.0.tar.gz) = ZdT8mzDrZq9vYLN8HzJBlf3xqSb/umBoLd9+/MH4eGg=
+SIZE (MultiMarkdown-5-5.1.0.tar.gz) = 135170
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/patches/patch-Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-Makefile
--- patches/patch-Makefile 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ patches/patch-Makefile 16 Mar 2016 01:00:52 -0000
@@ -1,37 +1,40 @@
-$OpenBSD: patch-Makefile,v 1.1.1.1 2015/03/24 19:16:13 okan Exp $
+$OpenBSD$
-Make it possible to pass GREG=/usr/local/bin/greg in on the
-command line and avoid git submodules.
-
---- Makefile.orig Mon Mar 23 18:21:56 2015
-+++ Makefile Mon Mar 23 18:32:22 2015
-@@ -32,18 +32,25 @@ ifeq ($(MAKECMDGOALS),static)
- LDFLAGS += -static -static-libgcc
- endif
-
--GREG= greg/greg
-+# OUR_GREG: the version of greg in a submodule
-+# GREG: the path to greg we want to use for parser.leg
-+#
-+# This way we can pass GREG=/usr/local/bin/greg in on
-+# the command line if we have greg installed already.
-
-+OUR_GREG=greg/greg
-+GREG?=$(OUR_GREG)
-+
- ALL : $(PROGRAM) enumMap.txt
- static : $(PROGRAM) enumMap.txt
-
- %.o : %.c parser.h
- $(CC) -c $(CFLAGS) -o $@ $<
-
--parser.c : parser.leg greg/greg parser.h
-- greg/greg -o parser.c parser.leg
-+parser.c : parser.leg $(GREG) parser.h
-+ $(GREG) -o parser.c parser.leg
-
--$(GREG): greg
-+$(OUR_GREG): greg
- $(MAKE) -C greg
+Patch up Makefile so we can use it instead of cmake.
+--- Makefile.orig Mon Feb 22 20:05:02 2016
++++ Makefile Tue Mar 15 18:56:50 2016
+@@ -1,6 +1,6 @@
+ BUILD_DIR = build
+
+-GREG = submodules/greg/greg
++GREG = /usr/local/bin/greg
+
+ # The release target will perform additional optimization
+ .PHONY : release
+@@ -81,7 +81,7 @@ $(GREG):
+ $(MAKE) -C submodules/greg
+
+ # Create build directory if it doesn't exist
+-$(BUILD_DIR): CHANGELOG
++$(BUILD_DIR):
+ -mkdir $(BUILD_DIR) 2>/dev/null
+ -cd $(BUILD_DIR); rm -rf *
+
+@@ -100,7 +100,7 @@ CHANGELOG:
+ #
+ # I don't recommend this approach, but it should work in a pinch
+
+-CFLAGS ?= -Wall -g -O3 -include src/GLibFacade.h -include src/version.h -include src/parser.h
++#CFLAGS ?= -Wall -g -O3 -include src/GLibFacade.h -include src/version.h -include src/parser.h
+ PROGRAM = multimarkdown
+
+ OBJS = build/multimarkdown.o build/parse_utilities.o build/parser.o build/GLibFacade.o build/writer.o build/text.o build/html.o build/latex.o build/memoir.o build/beamer.o build/lyx.o build/lyxbeamer.o build/opml.o build/odf.o build/critic.o build/rng.o build/rtf.o build/transclude.o build/toc.o
+@@ -119,7 +119,7 @@ src/parser.c: src/parser.leg $(GREG) src/parser.h
+ $(GREG) -o src/parser.c src/parser.leg
+
+ .PHONY : deprecated
+-deprecated: $(GREG) build/$(PROGRAM)
++deprecated: build/$(PROGRAM)
- $(PROGRAM) : $(OBJS)
+ build/$(PROGRAM): $(OBJS) $(BUILD_DIR) src/version.h
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS); \
Index: patches/patch-html_c
===================================================================
RCS file: patches/patch-html_c
diff -N patches/patch-html_c
--- patches/patch-html_c 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-$OpenBSD: patch-html_c,v 1.1.1.1 2015/03/24 19:16:13 okan Exp $
-
-Switch to using arc4random(3) everywhere, since they don't really want
-repeatability (as evidenced by the arguments they pass to srand(3)).
-
---- html.c.orig Mon Mar 9 18:52:39 2015
-+++ html.c Sat Mar 21 15:44:10 2015
-@@ -112,8 +112,12 @@ void print_html_node(GString *out, node *n, scratch_pa
- scratch->footnote_para_counter --;
- if (scratch->footnote_para_counter == 0) {
- if (scratch->extensions & EXT_RANDOM_FOOT) {
-+#ifdef HAVE_ARC4RANDOM
-+ random = arc4random_uniform(99999) + 1;
-+#else
- srand(scratch->random_seed_base + scratch->footnote_to_print);
- random = rand() % 99999 + 1;
-+#endif
- } else {
- random = scratch->footnote_to_print;
- }
-@@ -574,8 +578,12 @@ void print_html_node(GString *out, node *n, scratch_pa
- temp_node = node_for_count(scratch->used_notes, lev);
-
- if (scratch->extensions & EXT_RANDOM_FOOT) {
-+#ifdef HAVE_ARC4RANDOM
-+ random = arc4random_uniform(99999) + 1;
-+#else
- srand(scratch->random_seed_base + lev);
- random = rand() % 99999 + 1;
-+#endif
- } else {
- random = lev;
- }
-@@ -628,8 +636,12 @@ void print_html_node(GString *out, node *n, scratch_pa
- fprintf(stderr, "matching cite found - %d\n",lev);
- #endif
- if (scratch->extensions & EXT_RANDOM_FOOT) {
-+#ifdef HAVE_ARC4RANDOM
-+ random = arc4random_uniform(99999) + 1;
-+#else
- srand(scratch->random_seed_base + lev);
- random = rand() % 99999 + 1;
-+#endif
- } else {
- random = lev;
- }
-@@ -901,8 +913,12 @@ void print_html_endnotes(GString *out, scratch_pad *sc
- pad(out, 1, scratch);
-
- if (scratch->extensions & EXT_RANDOM_FOOT) {
-+#ifdef HAVE_ARC4RANDOM
-+ random = arc4random_uniform(99999) + 1;
-+#else
- srand(scratch->random_seed_base + counter);
- random = rand() % 99999 + 1;
-+#endif
- } else {
- random = counter;
- }
Index: patches/patch-latex_c
===================================================================
RCS file: patches/patch-latex_c
diff -N patches/patch-latex_c
--- patches/patch-latex_c 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-$OpenBSD: patch-latex_c,v 1.1.1.1 2015/03/24 19:16:13 okan Exp $
-
-Switch from strcat(3) to a safer idiom.
-
---- latex.c.orig Mon Mar 9 18:52:39 2015
-+++ latex.c Sat Mar 21 15:44:10 2015
-@@ -1202,16 +1202,16 @@ void print_latex_url(GString *out, char *str, scratch_
- char * correct_dimension_units(char *original) {
- char *result;
- int i;
--
-+ size_t result_len;
-+
- result = strdup(original);
--
-+ result_len = strlen(result);
-+
- for (i = 0; result[i]; i++)
- result[i] = tolower(result[i]);
-
-- if (strstr(&result[strlen(result)-2],"px")) {
-- result[strlen(result)-2] = '\0';
-- strcat(result, "pt");
-- }
-+ if (strstr(&result[result_len-2],"px"))
-+ result[result_len-1] = 't';
-
- return result;
- }
Index: patches/patch-parse_utilities_c
===================================================================
RCS file: patches/patch-parse_utilities_c
diff -N patches/patch-parse_utilities_c
--- patches/patch-parse_utilities_c 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,52 +0,0 @@
-$OpenBSD: patch-parse_utilities_c,v 1.1.1.1 2015/03/24 19:16:13 okan Exp $
-
-ifdef out pragmas that don't work under OpenBSD. Use arc4random(3).
-
---- parse_utilities.c.orig Mon Sep 22 12:57:41 2014
-+++ parse_utilities.c Wed Jan 7 16:02:19 2015
-@@ -22,7 +22,9 @@
- #include "parser.h"
- #include <libgen.h>
-
-+#ifndef __OpenBSD__
- #pragma mark - Parse Tree
-+#endif /* __OpenBSD__ */
-
- /* Create a new node in the parse tree */
- node * mk_node(int key) {
-@@ -219,7 +221,9 @@ void append_list(node *new, node *list) {
- }
- }
-
-+#ifndef __OpenBSD__
- #pragma mark - Parser Data
-+#endif /* __OpenBSD__ */
-
- /* Create parser data - this is where you stash stuff to communicate
- into and out of the parser */
-@@ -250,7 +254,9 @@ void free_parser_data(parser_data *data) {
- }
-
- /* mk_scratch_pad -- store stuff here while exporting the result tree */
-+#ifndef HAVE_ARC4RANDOM
- void ran_start(long seed);
-+#endif
- scratch_pad * mk_scratch_pad(unsigned long extensions) {
- scratch_pad *result = (scratch_pad *)malloc(sizeof(scratch_pad));
- result->extensions = extensions;
-@@ -277,6 +283,7 @@ scratch_pad * mk_scratch_pad(unsigned long extensions)
- result->table_alignment = NULL;
- result->table_column = 0;
-
-+#ifndef HAVE_ARC4RANDOM
- if (extensions & EXT_RANDOM_FOOT) {
- srand((int)time(NULL));
- result->random_seed_base = rand() % 32000;
-@@ -285,6 +292,7 @@ scratch_pad * mk_scratch_pad(unsigned long extensions)
- result->random_seed_base = 0;
- }
- ran_start(310952L);
-+#endif /* !HAVE_ARC4RANDOM */
-
- result->lyx_para_type = PARA; /* CRC - Simple paragraph */
- result->lyx_level = 0; /* CRC - out outside level */
Index: patches/patch-parser_leg
===================================================================
RCS file: patches/patch-parser_leg
diff -N patches/patch-parser_leg
--- patches/patch-parser_leg 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-parser_leg,v 1.1.1.1 2015/03/24 19:16:13 okan Exp $
-
-Switch from sprintf(3) to snprintf(3)
-
---- parser.leg.orig Mon Mar 9 18:52:39 2015
-+++ parser.leg Sat Mar 21 15:44:10 2015
-@@ -562,8 +562,10 @@ AutoLinkUrl = '<' < [A-Za-z]+ "://" ( !Newline !'>'
-
- AutoLinkEmail = '<' ( "mailto:" )? < [-A-Za-z0-9+_./!%~$]+ '@' ( !Newline !'>' . )+ > '>'
- {
-- char *mailto = malloc(strlen(yytext) + 8);
-- sprintf(mailto, "mailto:%s", yytext);
-+ size_t mailto_len = strlen(yytext) + 8;
-+ char *mailto = malloc(mailto_len);
-+ assert(mailto);
-+ assert(snprintf(mailto,mailto_len,"mailto:%s",yytext) < mailto_len);
- $$ = mk_link(str(yytext), NULL, mailto, NULL, NULL);
- free(mailto);
- }
Index: patches/patch-writer_c
===================================================================
RCS file: patches/patch-writer_c
diff -N patches/patch-writer_c
--- patches/patch-writer_c 24 Mar 2015 19:16:13 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-$OpenBSD: patch-writer_c,v 1.1.1.1 2015/03/24 19:16:13 okan Exp $
-
-Switch from strcat to a safer idiom.
-
---- writer.c.orig Mon Mar 9 18:52:39 2015
-+++ writer.c Sat Mar 21 15:44:10 2015
-@@ -648,6 +648,7 @@ char * dimension_for_attribute(char *querystring, node
- int i;
- char *upper;
- GString *result;
-+ size_t dimension_len;
-
- attribute = node_for_attribute(querystring, list);
- if (attribute == NULL) return NULL;
-@@ -655,6 +656,7 @@ char * dimension_for_attribute(char *querystring, node
- fprintf(stderr, "a\n");
- #endif
-
-+ dimension_len = strlen(attribute->children->str);
- dimension = strdup(attribute->children->str);
- upper = strdup(attribute->children->str);
-
-@@ -667,15 +669,13 @@ char * dimension_for_attribute(char *querystring, node
- fprintf(stderr, "b\n");
- #endif
-
-- if (strstr(dimension, "px")) {
-- ptr = strstr(dimension,"px");
-- ptr[0] = '\0';
-- strcat(ptr,"pt");
-- }
-+ ptr = strstr(dimension, "px");
-+ if (ptr)
-+ ptr[1] = 't';
-
- result = g_string_new(dimension);
-
-- if ((strcmp(dimension,upper) == 0) && (dimension[strlen(dimension) -1] != '%')) {
-+ if ((strcmp(dimension,upper) == 0) && (dimension[dimension_len-1] != '%')) {
- /* no units */
- g_string_append_printf(result, "pt");
- }