git: 848c5afb3647 - main - x11-toolkits/ocaml-labltk: stop guessing Tcl/Tk version and be verbose

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Sat, 23 Apr 2022 15:06:34 UTC
The branch main has been updated by danfe:

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

commit 848c5afb364722e8078eba4c4abfd119657e50b4
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-04-23 15:05:42 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-04-23 15:05:42 +0000

    x11-toolkits/ocaml-labltk: stop guessing Tcl/Tk version and be verbose
    
    When specific Tcl/Tk definitions are not passed to the configure script,
    it tries to guess installed version, header paths, and the libraries.
    This routine is not robust and can easily brake in custom environments
    or in the future.  Pass the correct values conveniently offered by our
    framework instead; this would also slightly speed up configure process.
    
    While here, do not pass ${STAGEDIR} via MAKE_ENV, it is already passed
    on the MAKE_ARGS (as DESTDIR).  Adjust the port's Makefile accordingly.
---
 x11-toolkits/ocaml-labltk/Makefile | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/x11-toolkits/ocaml-labltk/Makefile b/x11-toolkits/ocaml-labltk/Makefile
index 488b62ca2ef5..b37267bda580 100644
--- a/x11-toolkits/ocaml-labltk/Makefile
+++ b/x11-toolkits/ocaml-labltk/Makefile
@@ -13,17 +13,20 @@ LICENSE=	LGPL20
 
 USES=		gmake tk
 HAS_CONFIGURE=	yes
+CONFIGURE_ARGS=	-tkdefs "-I${LOCALBASE}/include -I${TCL_INCLUDEDIR}\
+		-I${TK_INCLUDEDIR}" \
+		-tklibs "-L${LOCALBASE}/lib -ltcl${TCL_SHLIB_VER}\
+		-ltk${TK_SHLIB_VER}" -verbose
 MAKE_JOBS_UNSAFE=yes
-MAKE_ENV+=	STAGEDIR="${STAGEDIR}"
 USE_OCAML=	yes
 
 ALL_TARGET=	all opt
 
 post-patch:
 	@${FIND} ${WRKSRC} -name 'Makefile*' | ${XARGS} ${REINPLACE_CMD} \
-		-e 's/$$(INSTALLDIR)/$$(STAGEDIR)$$(INSTALLDIR)/g' \
-		-e 's/$$(INSTALLBINDIR)/$$(STAGEDIR)$$(INSTALLBINDIR)/g' \
-		-e 's/$$(STUBLIBDIR)/$$(STAGEDIR)$$(STUBLIBDIR)/g' \
+		-e 's/$$(INSTALLDIR)/$$(DESTDIR)$$(INSTALLDIR)/g' \
+		-e 's/$$(INSTALLBINDIR)/$$(DESTDIR)$$(INSTALLBINDIR)/g' \
+		-e 's/$$(STUBLIBDIR)/$$(DESTDIR)$$(STUBLIBDIR)/g' \
 		-e 's/mkdir /& -p /g'
 	@${REINPLACE_CMD} -e 's|%%SCRIPTBASE%%|${PREFIX}/lib/ocaml/labltk/|g' \
 		${WRKSRC}/lib/Makefile