aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2022-04-22 10:47:40 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2022-04-22 10:47:40 +0000
commit33ae5460742095b7415a091a3d34f1d81d85c98c (patch)
tree4fe7dcef5224d5af5f3d3e98e8e73c14a6606d5b
parentb0888f4a16cb318d6457b56f0b9eb9c653f8b762 (diff)
downloadports-33ae5460742095b7415a091a3d34f1d81d85c98c.tar.gz
ports-33ae5460742095b7415a091a3d34f1d81d85c98c.zip
lang/ocaml: simplify handling of the documentation distfiles
- Make use of the options helper, DOCS_DISTFILES, and get rid of the poorly readable .if ${PORT_OPTIONS:MDOCS} block - Drop useless `post-extract' target, all needed files are extracted automagically by the framework - GC left-over CMP_LIB_DESC, MODOPT, PATTERN, and DOCSDISTNAME knobs
-rw-r--r--lang/ocaml/Makefile40
1 files changed, 10 insertions, 30 deletions
diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile
index 618228828938..2de010864af4 100644
--- a/lang/ocaml/Makefile
+++ b/lang/ocaml/Makefile
@@ -6,6 +6,8 @@ PORTVERSION= 4.07.1
CATEGORIES= lang
MASTER_SITES= http://caml.inria.fr/pub/distrib/${DISTNAME:R}/ GENTOO \
http://caml.inria.fr/pub/distrib/${DISTNAME:R}/:docs
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+EXTRACT_ONLY= ${_DISTFILES:M*.tar.*}
PKGNAMESUFFIX= ${SFX}
MAINTAINER= michipili@gmail.com
@@ -49,28 +51,16 @@ CONFIGURE_ARGS= -verbose -prefix "${PREFIX}" \
OPTIONS_DEFINE= X11 THREADS DOCS EXAMPLES
OPTIONS_DEFAULT=X11 THREADS
-CMP_LIB_DESC= Install compiler libraries
-
-MODOPT= camlp4o camlp4r ocamlc ocamldep ocamldoc ocamllex ocamlopt
-PATTERN= [[:space:]]*(do|then)?[[:space:]]*)(\$$\(CP\)|cp)([[:space:]]
-DOCSDISTNAME= ${DISTNAME:C/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/\1.\2/}
CONFLICTS= metaocaml
-.include <bsd.port.options.mk>
+PORTDOCS= htmlman ${DISTNAME:R}-refman.ps.gz ${DISTNAME:R}-refman.pdf
-.if ${PORT_OPTIONS:MDOCS}
-DISTFILES:= ${DISTNAME}${EXTRACT_SUFX} \
- ${DOCSDISTNAME}-refman-html.tar.gz:docs \
- ${DOCSDISTNAME}-refman.ps.gz:docs \
- ${DOCSDISTNAME}-refman.pdf:docs
-EXTRACT_ONLY:= ${DISTNAME}${EXTRACT_SUFX} \
- ${DOCSDISTNAME}-refman-html.tar.gz
-PLIST_SUB+= DOC=""
-PORTDOCS= htmlman ${DOCSDISTNAME}-refman.ps.gz ${DOCSDISTNAME}-refman.pdf
-.else
-PLIST_SUB+= DOC="@comment "
-.endif
+DOCS_DISTFILES= ${DISTNAME:R}-refman-html.tar.gz:docs \
+ ${DISTNAME:R}-refman.ps.gz:docs \
+ ${DISTNAME:R}-refman.pdf:docs
+
+.include <bsd.port.options.mk>
.if ${ARCH} == armv6 || ${ARCH} == armv7
CONFIGURE_ARGS+= -as "${AS} ${ASFLAGS} -meabi=5"
@@ -119,16 +109,6 @@ USE_GCC= yes
LLD_UNSAFE= yes
.endif
-post-extract:
-.if ${PORT_OPTIONS:MDOCS}
- @if ! (cd ${WRKDIR} && \
- ${TAR} xf ${_DISTDIR}${DOCSDISTNAME}-refman-html.tar.gz \
- ) \
- then \
- exit 1; \
- fi;
-.endif
-
post-patch:
@${REINPLACE_CMD} \
-e '\|MKLIB=|s|ar rc|${AR} rc|' \
@@ -157,8 +137,8 @@ post-install:
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKDIR} && ${COPYTREE_SHARE} htmlman ${STAGEDIR}${DOCSDIR})
- ${INSTALL_DATA} ${_DISTDIR}${DOCSDISTNAME}-refman.ps.gz ${STAGEDIR}${DOCSDIR}
- ${INSTALL_DATA} ${_DISTDIR}${DOCSDISTNAME}-refman.pdf ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${_DISTDIR}${DISTNAME:R}-refman.ps.gz ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${_DISTDIR}${DISTNAME:R}-refman.pdf ${STAGEDIR}${DOCSDIR}
.endif
# Spacetime profiling is only available for native code on 64-bit targets
.if ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc