freebsd-ports/lang/ocaml/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

143 lines
4 KiB
Makefile

# for committer: bump PORTREVISION for math/facile whenever ocaml gets updated
PORTNAME= ocaml
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
COMMENT= Objective Caml compiler and programming environment
WWW= https://ocaml.org/
LICENSE= QPL10 LGPL20
LICENSE_COMB= multi
LICENSE_NAME_QPL10= Q Public License, Version 1.0
LICENSE_FILE_QPL10= ${WRKSRC}/LICENSE
LICENSE_PERMS_QPL10= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
BROKEN_riscv64= fails to build: hasgot.c:3:12: use of undeclared identifier 'secure_getenv'
BROKEN_sparc64= No rule to make target 'none.o', needed by 'libasmrun.a'
BROKEN_mips64= No ASM support
BROKEN_mips= No ASM support
BUILD_DEPENDS= as:devel/binutils
RUN_DEPENDS= as:devel/binutils
USES= cpe compiler:c11 gmake shebangfix tar:xz
USE_LDCONFIG= yes
CPE_VENDOR= inria
HAS_CONFIGURE= yes
ALL_TARGET= world.opt
STRIP=
SSP_UNSAFE= yes
MAKE_JOBS_UNSAFE= yes
LDFLAGS_armv6= -Wl,-znotext
LDFLAGS_armv7= -Wl,-znotext
LDFLAGS_i386= -Wl,-znotext
SHEBANG_LANG= awk
awk_OLD_CMD= /bin/awk
awk_CMD= /usr/bin/awk
SHEBANG_FILES= tools/ocaml-instr-graph tools/ocaml-instr-report
CONFIGURE_ARGS= -verbose -prefix "${PREFIX}" \
-cc "${CC}" \
-aspp "${CC} -c" \
-partialld "${LD} -r"
OPTIONS_DEFINE= X11 THREADS DOCS EXAMPLES
OPTIONS_DEFAULT=X11 THREADS
CONFLICTS= metaocaml
PORTDOCS= htmlman ${DISTNAME:R}-refman.ps.gz ${DISTNAME:R}-refman.pdf
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"
.elif ${ARCH} == powerpc || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le
LLD_UNSAFE= yes
.else
CONFIGURE_ARGS+= -as "${AS} ${ASFLAGS}"
.endif
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
THR_LD= -lpthread
.else
PLIST_SUB+= THREADS="@comment "
THR_LD= #empty
CONFIGURE_ARGS+=-no-pthread
.endif
.if ${PORT_OPTIONS:MX11}
PLIST_SUB+= X11=""
USES+= xorg
USE_XORG= x11
CONFLICTS+= ocaml-nox11
CONFIGURE_ARGS+=-x11include ${LOCALBASE}/include -x11lib ${LOCALBASE}/lib
.else
PLIST_SUB+= X11="@comment "
SFX= -nox11
CONFLICTS+= ocaml
CONFIGURE_ARGS+=-no-graph
.endif
.include <bsd.port.pre.mk>
.if defined(NO_PROFILE) || ${ARCH:Mpowerpc} || ${ARCH:Mamd64}
PLIST_SUB+= PROF="@comment "
.else
PLIST_SUB+= PROF=""
.endif
.if defined(PPC_ABI) && ${PPC_ABI} == ELFv2
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-asmcomp_power_arch.ml
.endif
post-patch:
@${REINPLACE_CMD} \
-e '\|MKLIB=|s|ar rc|${AR} rc|' \
-e '\|RANLIB|s|ranlib|${RANLIB}|' \
-e '\|^ldflags=|s|""|"${LDFLAGS}"|' \
${WRKSRC}/configure
@${REINPLACE_CMD} -e 's,$$(ARCH),$$(SYSTEM_ARCH),' \
${WRKSRC}/Makefile ${WRKSRC}/Makefile.tools \
${WRKSRC}/asmrun/Makefile \
${WRKSRC}/ocamltest/Makefile \
${WRKSRC}/otherlibs/systhreads/Makefile \
${WRKSRC}/testsuite/tests/asmgen/Makefile
post-configure:
@${REINPLACE_CMD} -E \
-e '/^PTHREAD_LINK/s,-pthread,${THR_LD},g' \
${WRKSRC}/config/Makefile
check-test: do-install
@cd ${WRKSRC}/testsuite; ${RM} _log; for d in tests/* ; do \
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} one DIR=$${d} \
2>&1 | tee -a _log || ${TRUE} ; done ; \
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} report
post-install:
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKDIR} && ${COPYTREE_SHARE} htmlman ${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
@${REINPLACE_CMD} -e '/raw_spacetime_lib/d' ${TMPPLIST}
.endif
.include <bsd.port.post.mk>