git: ad83ddc0b407 - main - textproc/R-cran-downlit: new port, Syntax Highlighting and Automatic Linking

From: Zsolt Udvari <uzsolt_at_FreeBSD.org>
Date: Tue, 13 Aug 2024 05:44:12 UTC
The branch main has been updated by uzsolt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ad83ddc0b4075fae1b7bae680de0bef1d97c88bc

commit ad83ddc0b4075fae1b7bae680de0bef1d97c88bc
Author:     Zsolt Udvari <uzsolt@FreeBSD.org>
AuthorDate: 2024-08-13 05:37:50 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-08-13 05:42:15 +0000

    textproc/R-cran-downlit: new port, Syntax Highlighting and Automatic Linking
    
    Syntax highlighting of R code, specifically designed for the needs of
    'RMarkdown' packages like 'pkgdown', 'hugodown', and 'bookdown'. It includes
    linking of function calls to their documentation on the web, and automatic
    translation of ANSI escapes in output to the equivalent HTML.
    
    The math/R doesn't ship grid library's vignette so should remove one
    test.
    
    This port is needed to update of devel/R-cran-devtools.
---
 textproc/Makefile                                  |  1 +
 textproc/R-cran-downlit/Makefile                   | 36 ++++++++++++++++++++++
 textproc/R-cran-downlit/distinfo                   |  3 ++
 .../files/patch-tests_testthat_test-link.R         | 13 ++++++++
 textproc/R-cran-downlit/pkg-descr                  |  4 +++
 5 files changed, 57 insertions(+)

diff --git a/textproc/Makefile b/textproc/Makefile
index 15b67f597bd7..62b14f964178 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -9,6 +9,7 @@
     SUBDIR += R-cran-brew
     SUBDIR += R-cran-cellranger
     SUBDIR += R-cran-commonmark
+    SUBDIR += R-cran-downlit
     SUBDIR += R-cran-formatR
     SUBDIR += R-cran-highr
     SUBDIR += R-cran-htmlTable
diff --git a/textproc/R-cran-downlit/Makefile b/textproc/R-cran-downlit/Makefile
new file mode 100644
index 000000000000..eada95198c9e
--- /dev/null
+++ b/textproc/R-cran-downlit/Makefile
@@ -0,0 +1,36 @@
+PORTNAME=	downlit
+DISTVERSION=	0.4.4
+CATEGORIES=	textproc
+DISTNAME=	${PORTNAME}_${PORTVERSION}
+
+MAINTAINER=	uzsolt@FreeBSD.org
+COMMENT=	Syntax Highlighting and Automatic Linking
+WWW=		https://cran.r-project.org/web/packages/downlit/
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+CRAN_DEPENDS=	R-cran-brio>0:devel/R-cran-brio \
+		R-cran-desc>0:devel/R-cran-desc \
+		R-cran-digest>0:security/R-cran-digest \
+		R-cran-evaluate>0:devel/R-cran-evaluate \
+		R-cran-fansi>0:devel/R-cran-fansi \
+		R-cran-memoise>0:devel/R-cran-memoise \
+		R-cran-rlang>0:devel/R-cran-rlang \
+		R-cran-vctrs>0:devel/R-cran-vctrs \
+		R-cran-withr>0:devel/R-cran-withr \
+		R-cran-yaml>0:textproc/R-cran-yaml
+BUILD_DEPENDS=	${CRAN_DEPENDS}
+RUN_DEPENDS=	${CRAN_DEPENDS}
+TEST_DEPENDS=	R-cran-covr>0:devel/R-cran-covr \
+		R-cran-htmltools>0:textproc/R-cran-htmltools \
+		R-cran-jsonlite>0:converters/R-cran-jsonlite \
+		R-cran-pkgload>0:devel/R-cran-pkgload \
+		R-cran-rmarkdown>0:textproc/R-cran-rmarkdown \
+		R-cran-testthat>0:devel/R-cran-testthat \
+		R-cran-tidyverse>0:devel/R-cran-tidyverse \
+		R-cran-xml2>0:textproc/R-cran-xml2
+
+USES=		cran:auto-plist
+
+.include <bsd.port.mk>
diff --git a/textproc/R-cran-downlit/distinfo b/textproc/R-cran-downlit/distinfo
new file mode 100644
index 000000000000..2c9361bcc3cf
--- /dev/null
+++ b/textproc/R-cran-downlit/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1723491653
+SHA256 (downlit_0.4.4.tar.gz) = 55c377dcee4adc48c1060e14079f3d1832453d066a2cf070530caa210c48f828
+SIZE (downlit_0.4.4.tar.gz) = 37162
diff --git a/textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R b/textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R
new file mode 100644
index 000000000000..d76be78b37e7
--- /dev/null
+++ b/textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R
@@ -0,0 +1,13 @@
+--- tests/testthat/test-link.R.orig	2024-08-13 05:33:03 UTC
++++ tests/testthat/test-link.R
+@@ -217,10 +217,6 @@ test_that("looks in attached packages", {
+     href_expr_(vignette("sha1")),
+     "https://cran.rstudio.com/web/packages/digest/vignettes/sha1.html"
+   )
+-  expect_equal(
+-    href_expr_(vignette("moveline")),
+-    "https://cran.rstudio.com/web/packages/grid/vignettes/moveline.pdf"
+-  )
+ })
+ 
+ test_that("fail gracefully with non-working calls", {
diff --git a/textproc/R-cran-downlit/pkg-descr b/textproc/R-cran-downlit/pkg-descr
new file mode 100644
index 000000000000..0af9982a9ee4
--- /dev/null
+++ b/textproc/R-cran-downlit/pkg-descr
@@ -0,0 +1,4 @@
+Syntax highlighting of R code, specifically designed for the needs of
+'RMarkdown' packages like 'pkgdown', 'hugodown', and 'bookdown'. It includes
+linking of function calls to their documentation on the web, and automatic
+translation of ANSI escapes in output to the equivalent HTML.