On 2022/07/20 18:58, Klemens Nanni wrote:
> On Wed, Jul 20, 2022 at 07:25:08PM +0100, Stuart Henderson wrote:
> > On 2022/07/20 16:15, Klemens Nanni wrote:
> > > On Wed, Jul 20, 2022 at 09:45:22AM +0100, Stuart Henderson wrote:
> > > > Seems simpler to update it.
> > >
> > > Looking good port-wise except for this:
> > >
> > > > Index: pkg/PLIST
> > > > ===================================================================
> > > > RCS file: /cvs/ports/textproc/multimarkdown/pkg/PLIST,v
> > > > retrieving revision 1.2
> > > > diff -u -p -r1.2 PLIST
> > > > --- pkg/PLIST 11 Mar 2022 20:02:48 -0000 1.2
> > > > +++ pkg/PLIST 20 Jul 2022 08:44:03 -0000
> > > > @@ -1 +1,56 @@
> > > > +LICENSE.txt
> > > > +README.txt
> > >
> > > Right under /usr/local/.
> >
> > Oops yes.
>
> I'm fine with your update once these are fixed.
> Haven't run-tested anything, though.
>
> > > > +bin/markdown
> > > > +@comment bin/mmd
> > >
> > > Just leave it out or @conflict mtools-*?
> > >
> > > pkglocate bin/mmd | grep mmd$
> > > mtools-4.0.27:sysutils/mtools:/usr/local/bin/mmd
> > >
> >
> > I didn't think the conflict makes sense when it is just a wrapper.
> > If it's just left out, a future update will bring it back, @conflict
> > prevents that (or it could be "rm" in the Makefile instead).
>
> Right, @comment seems good enough.
On second thoughts, we can install it as mmd2xhtml, I think that
makes more sense. If there are no objections I'll go with this.
attila, do you want to stay listed as maintainer on your ports?
(go-goptlib, greg, p5-Data-SExpression, obfs4proxy, go-ed25519
and this)
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile 11 Mar 2022 20:02:48 -0000 1.5
+++ Makefile 21 Jul 2022 10:41:45 -0000
@@ -1,43 +1,23 @@
-V = 5.4.0
COMMENT = marked-up plain text to formatted document converter
-DISTNAME = ${GH_PROJECT}-${V}
-PKGNAME = multimarkdown-${V:C/-/./}
CATEGORIES = textproc
GH_ACCOUNT = fletcher
-GH_PROJECT = MultiMarkdown-5
-GH_TAGNAME = ${V}
+GH_PROJECT = MultiMarkdown-6
+GH_TAGNAME = 6.6.0
+PKGNAME = multimarkdown-${GH_TAGNAME}
-TESTS_COMMIT = 8d5ad66e3bbaeb0de8646783bfe964261ddb39c7
-DIST_SUBDIR = multimarkdown
-MASTER_SITES_GITHUB = https://github.com/fletcher/MMD-Test-Suite/archive/
-DISTFILES = ${DISTNAME}${EXTRACT_SUFX} ${TESTS_COMMIT}${EXTRACT_SUFX}
-HOMEPAGE = http://fletcherpenney.net/multimarkdown/
-MAINTAINER = Sean Levy <[email protected]>
+HOMEPAGE = https://fletcherpenney.net/multimarkdown/
-# Dual licensed: MIT and GPLv2+
+# MIT (see LICENSE)
PERMIT_PACKAGE = Yes
# uses pledge()
-WANTLIB += c
-
-BUILD_DEPENDS = devel/greg
+WANTLIB += c
MODULES = devel/cmake
-CFLAGS += -DHAVE_SRAND_DETERMINISTIC
-
-CONFIGURE_ARGS += -DGREG=${LOCALBASE}/bin/greg
-
-post-extract:
- rm -rf ${WRKSRC}/submodules/MarkdownTest
- cp -r ${WRKDIR}/MMD-Test-Suite-${TESTS_COMMIT} \
- ${WRKSRC}/submodules/MarkdownTest
-
-pre-configure:
- touch ${WRKBUILD}/README.html
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKBUILD}/multimarkdown ${PREFIX}/bin/
+post-install:
+ rm ${PREFIX}/{LICENSE.txt,README.txt}
+ mv ${PREFIX}/bin/{mmd,mmd2xhtml} # avoid conflict with mtools
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo 12 Apr 2017 18:42:34 -0000 1.2
+++ distinfo 21 Jul 2022 10:41:45 -0000
@@ -1,4 +1,2 @@
-SHA256 (multimarkdown/8d5ad66e3bbaeb0de8646783bfe964261ddb39c7.tar.gz) =
xGdoX+aZ/y+8ND+LXK24XSgNCccYJV9S6qAW2NI/DKw=
-SHA256 (multimarkdown/MultiMarkdown-5-5.4.0.tar.gz) =
HMA4X/1sghwmXpcPgcxOwAnH7Lv7EuDhFce7WzPQmoM=
-SIZE (multimarkdown/8d5ad66e3bbaeb0de8646783bfe964261ddb39c7.tar.gz) = 185408
-SIZE (multimarkdown/MultiMarkdown-5-5.4.0.tar.gz) = 136693
+SHA256 (MultiMarkdown-6-6.6.0.tar.gz) =
ZJa0PJM9L5P/a+gPUCnTfpV2pdXqy5CQDmsoyQQFA38=
+SIZE (MultiMarkdown-6-6.6.0.tar.gz) = 3347116
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 11 Mar 2022 20:02:48 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-Use installed greg
---- CMakeLists.txt.orig Mon Feb 22 20:05:02 2016
-+++ CMakeLists.txt Tue Mar 22 12:45:41 2016
-@@ -149,7 +149,7 @@ endif ()
- # Need to build parser.c via greg
- add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parser.c
-- COMMAND ${PROJECT_SOURCE_DIR}/submodules/greg/greg -o
${CMAKE_CURRENT_BINARY_DIR}/parser.c ${PROJECT_SOURCE_DIR}/src/parser.leg
-+ COMMAND ${GREG} -o ${CMAKE_CURRENT_BINARY_DIR}/parser.c
${PROJECT_SOURCE_DIR}/src/parser.leg
- )
-
- # src_files are the primary files, and will be included in doxygen
documentation
Index: patches/patch-src_html_c
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/patches/patch-src_html_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_html_c
--- patches/patch-src_html_c 11 Mar 2022 20:02:48 -0000 1.2
+++ patches/patch-src_html_c 21 Jul 2022 10:41:45 -0000
@@ -1,51 +1,31 @@
Use srand_deterministic(3) if available.
---- src/html.c.orig Fri Aug 5 09:08:36 2016
-+++ src/html.c Thu Sep 15 15:35:50 2016
-@@ -115,7 +115,11 @@ void print_html_node(GString *out, node *n, scratch_pa
- scratch->footnote_para_counter --;
- if (scratch->footnote_para_counter == 0) {
+Index: src/html.c
+--- src/html.c.orig
++++ src/html.c
+@@ -834,7 +834,7 @@ void mmd_export_token_html(DString * out, const char *
+ temp_short =
scratch->footnote_being_printed;
+
if (scratch->extensions &
EXT_RANDOM_FOOT) {
-+#ifdef HAVE_SRAND_DETERMINISTIC
-+
srand_deterministic(scratch->random_seed_base + scratch->footnote_to_print);
-+#else
- srand(scratch->random_seed_base
+ scratch->footnote_to_print);
-+#endif /* HAVE_SRAND_DETERMINISTIC */
- random = rand() % 99999 + 1;
+- srand(scratch->random_seed_base
+ temp_short);
++
srand_deterministic(scratch->random_seed_base + temp_short);
+ temp_short = rand() % 32000 + 1;
+ }
+
+@@ -1611,7 +1611,7 @@ parse_citation:
+ // This is a re-use of a previously
used note
+
+ if (scratch->extensions &
EXT_RANDOM_FOOT) {
+- srand(scratch->random_seed_base
+ temp_short);
++
srand_deterministic(scratch->random_seed_base + temp_short);
+ temp_short3 = rand() % 32000 +
1;
} else {
- random =
scratch->footnote_to_print;
-@@ -604,7 +608,11 @@ 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_SRAND_DETERMINISTIC
-+ srand_deterministic(scratch->random_seed_base +
lev);
-+#else
- srand(scratch->random_seed_base + lev);
-+#endif /* HAVE_SRAND_DETERMINISTIC */
- random = rand() % 99999 + 1;
- } else {
- random = lev;
-@@ -658,7 +666,11 @@ void print_html_node(GString *out, node *n, scratch_pa
- fprintf(stderr, "matching cite found -
%d\n",lev);
- #endif
+ temp_short3 = temp_short;
+@@ -1623,7 +1623,7 @@ parse_citation:
+ // This is the first time this note was
used
+
if (scratch->extensions &
EXT_RANDOM_FOOT) {
-+#ifdef HAVE_SRAND_DETERMINISTIC
-+
srand_deterministic(scratch->random_seed_base + lev);
-+#else
- srand(scratch->random_seed_base
+ lev);
-+#endif /* HAVE_SRAND_DETERMINISTIC */
- random = rand() % 99999 + 1;
+- srand(scratch->random_seed_base
+ temp_short);
++
srand_deterministic(scratch->random_seed_base + temp_short);
+ temp_short3 = rand() % 32000 +
1;
} else {
- random = lev;
-@@ -951,7 +963,11 @@ void print_html_endnotes(GString *out, scratch_pad *sc
- pad(out, 1, scratch);
-
- if (scratch->extensions & EXT_RANDOM_FOOT) {
-+#ifdef HAVE_SRAND_DETERMINISTIC
-+ srand_deterministic(scratch->random_seed_base +
counter);
-+#else
- srand(scratch->random_seed_base + counter);
-+#endif /* HAVE_SRAND_DETERMINISTIC */
- random = rand() % 99999 + 1;
- } else {
- random = counter;
+ temp_short3 = temp_short;
Index: patches/patch-src_latex_c
===================================================================
RCS file: patches/patch-src_latex_c
diff -N patches/patch-src_latex_c
--- patches/patch-src_latex_c 11 Mar 2022 20:02:48 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-Switch from strcat(3) to safer idiom, ensure bogus input doesn't result
-in out of bounds pointer.
---- src/latex.c.orig Sat Oct 1 11:12:24 2016
-+++ src/latex.c Sat Oct 1 11:23:02 2016
-@@ -1219,16 +1219,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 ((result_len > 1) && strstr(&result[result_len-2],"px"))
-+ result[result_len-1] = 't';
-+
- return result;
- }
Index: patches/patch-src_main_c
===================================================================
RCS file: patches/patch-src_main_c
diff -N patches/patch-src_main_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_main_c 21 Jul 2022 10:41:45 -0000
@@ -0,0 +1,28 @@
+Index: src/main.c
+--- src/main.c.orig
++++ src/main.c
+@@ -54,11 +54,13 @@
+ */
+
+ #include <ctype.h>
++#include <errno.h>
+ #include <libgen.h>
+ #include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+
+
+ #include "argtable3.h"
+@@ -213,6 +215,10 @@ int main(int argc, char ** argv) {
+ goto exit2;
+ }
+
++ if (pledge("stdio rpath wpath cpath", NULL) == -1) {
++ fprintf(stderr,"pledge: error #%d\n", errno);
++ exit(EXIT_FAILURE);
++ }
+
+ // Parse options
+ unsigned long extensions = EXT_SMART | EXT_NOTES | EXT_CRITIC |
EXT_TRANSCLUDE;
Index: patches/patch-src_multimarkdown_c
===================================================================
RCS file: patches/patch-src_multimarkdown_c
diff -N patches/patch-src_multimarkdown_c
--- patches/patch-src_multimarkdown_c 11 Mar 2022 20:02:48 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-Use pledge(2) on OpenBSD.
---- src/multimarkdown.c.orig Fri Aug 5 09:08:36 2016
-+++ src/multimarkdown.c Thu Sep 15 17:28:27 2016
-@@ -58,6 +58,7 @@
- */
-
-
-+#include <errno.h>
- #include <getopt.h>
- #include <libgen.h>
- #include "parser.h"
-@@ -262,6 +263,11 @@ int main(int argc, char **argv)
- abort();
- }
- }
-+
-+ if (pledge("stdio rpath wpath cpath", NULL) == -1) {
-+ fprintf(stderr,"pledge: error #%d\n", errno);
-+ exit(EXIT_FAILURE);
-+ }
-
- /* Compatibility mode emulates the behavior of Markdown.pl */
- if (compatibility_flag) {
Index: patches/patch-src_parse_utilities_c
===================================================================
RCS file: patches/patch-src_parse_utilities_c
diff -N patches/patch-src_parse_utilities_c
--- patches/patch-src_parse_utilities_c 11 Mar 2022 20:02:48 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-Use srand_deterministic(3) on OpenBSD
---- src/parse_utilities.c.orig Fri Aug 5 09:08:36 2016
-+++ src/parse_utilities.c Thu Sep 15 15:35:50 2016
-@@ -268,10 +268,18 @@ scratch_pad * mk_scratch_pad(unsigned long extensions)
- result->inside_footnote = 0;
-
- if (extensions & EXT_RANDOM_FOOT) {
-+#ifdef HAVE_SRAND_DETERMINISTIC
-+ srand_deterministic((int)time(NULL));
-+#else
- srand((int)time(NULL));
-+#endif /* HAVE_SRAND_DETERMINISTIC */
- result->random_seed_base = rand() % 32000;
- } else {
-+#ifdef HAVE_SRAND_DETERMINISTIC
-+ srand_deterministic(1);
-+#else
- srand(1);
-+#endif /* HAVE_SRAND_DETERMINISTIC */
- result->random_seed_base = 0;
- }
- ran_start(310952L);
-@@ -909,4 +917,4 @@ char * my_strndup(const char * source, size_t n) {
- result[len] = '\0';
-
- return result;
--}
-\ No newline at end of file
-+}
Index: patches/patch-src_parser_leg
===================================================================
RCS file: patches/patch-src_parser_leg
diff -N patches/patch-src_parser_leg
--- patches/patch-src_parser_leg 11 Mar 2022 20:02:48 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-Switch from sprintf(3) to safer idiom. Handle errors as elsewhere in code.
---- src/parser.leg.orig Fri Aug 5 09:08:36 2016
-+++ src/parser.leg Sat Oct 1 14:05:54 2016
-@@ -637,8 +637,12 @@ AutoLinkUrl = '<' < [A-Za-z]+ "://" ( !Newline !'>'
-
- AutoLinkEmail = '<' ( "mailto:" )? < [-A-Za-z0-9+_./!%~$]+ '@' ( !Newline
!'>' . )+ > '>'
- {
-- char *mailto = malloc(strlen(yytext) + 8);
-- sprintf(mailto, "mailto:%s", yytext);
-+ char *mailto = NULL;
-+ if (asprintf(&mailto, "mailto:%s", yytext) == -1) {
-+ fprintf(stderr, "error copying mailto link: %s\n",
-+ yytext);
-+ exit(1);
-+ }
- $$ = mk_link(str(yytext), NULL, mailto, NULL, NULL);
- free(mailto);
- }
Index: patches/patch-src_writer_c
===================================================================
RCS file: patches/patch-src_writer_c
diff -N patches/patch-src_writer_c
--- patches/patch-src_writer_c 11 Mar 2022 20:02:48 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-Switch from strcat(3) to a safer idiom, make sure bogus dimension does
-not result in out of bounds pointer.
---- src/writer.c.orig Sat Oct 1 11:18:59 2016
-+++ src/writer.c Sat Oct 1 11:22:21 2016
-@@ -690,6 +690,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;
-@@ -698,6 +699,7 @@ char * dimension_for_attribute(char *querystring, node
- #endif
-
- dimension = strdup(attribute->children->str);
-+ dimension_len = strlen(dimension);
- upper = strdup(attribute->children->str);
-
- for(i = 0; dimension[ i ]; i++)
-@@ -709,15 +711,14 @@ 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_len > 0) &&
-+ (dimension[dimension_len-1] != '%')) {
- /* no units */
- g_string_append_printf(result, "pt");
- }
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/multimarkdown/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 11 Mar 2022 20:02:48 -0000 1.2
+++ pkg/PLIST 21 Jul 2022 10:41:45 -0000
@@ -1 +1,55 @@
+bin/markdown
+@comment bin/mmd
+bin/mmd2all
+bin/mmd2epub
+bin/mmd2fodt
+bin/mmd2odt
+bin/mmd2opml
+bin/mmd2pdf
+bin/mmd2tex
+bin/mmd2xhtml
@bin bin/multimarkdown
+share/texmf/
+share/texmf/tex/
+share/texmf/tex/latex/
+share/texmf/tex/latex/mmd6/
+share/texmf/tex/latex/mmd6/Portfolio.png
+share/texmf/tex/latex/mmd6/README.md
+share/texmf/tex/latex/mmd6/Vintage.png
+share/texmf/tex/latex/mmd6/beamerthemekeynote-gradient.sty
+share/texmf/tex/latex/mmd6/beamerthemekeynote-portfolio.sty
+share/texmf/tex/latex/mmd6/beamerthemekeynote-vintage.sty
+share/texmf/tex/latex/mmd6/manuscript.sty
+share/texmf/tex/latex/mmd6/mmd-envelope.sty
+share/texmf/tex/latex/mmd6/mmd-letterhead.sty
+share/texmf/tex/latex/mmd6/mmd6-article-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-article-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-article-leader.tex
+share/texmf/tex/latex/mmd6/mmd6-beamer-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-beamer-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-beamer-leader.tex
+share/texmf/tex/latex/mmd6/mmd6-criticmarkup.tex
+share/texmf/tex/latex/mmd6/mmd6-default-metadata.tex
+share/texmf/tex/latex/mmd6/mmd6-letterhead-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-letterhead-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-letterhead-leader.tex
+share/texmf/tex/latex/mmd6/mmd6-manuscript-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-manuscript-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-manuscript-leader.tex
+share/texmf/tex/latex/mmd6/mmd6-manuscript-packages.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-book-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-book-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-book-leader.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-copyright.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-layout-8.5x11.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-packages.tex
+share/texmf/tex/latex/mmd6/mmd6-memoir-setup.tex
+share/texmf/tex/latex/mmd6/mmd6-title.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-book-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-book-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-book-leader.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-handout-begin.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-handout-footer.tex
+share/texmf/tex/latex/mmd6/mmd6-tufte-handout-leader.tex