Tuesday, January 04, 2022

Re: devel/catch2: set pkg_arch, defer test build to test target

On Tue, Jan 04, 2022 at 10:06:30AM +0100, Rafael Sadowski wrote:
> On Tue Jan 04, 2022 at 08:32:59AM +0000, Klemens Nanni wrote:
> > `make package' for this header-only package builds 117 c++ files, but
> > they're all for tests.
> >
> > Set NO_BUILD=Yes to enable quick packaging and TEST_TARGET=all to defer
> > compilation to when it's needed.
> >
> > While here, simplify PKGNAME handling.
> >
> > No PLIST change, `make test' works as before.
>
> Are you sure?

Sorry, here is the right diff that avoids this ordering/dependency issue
(we can't rely on cmake/ninja building and testing in this order).

Building explicitly in pre-test and testing in test is guaranteed to
work as things are ordered, even with MAKE_JOBS > 1.

> Current:

> 96% tests passed, 1 tests failed out of 24

> With your diff:

> 0% tests passed, 24 tests failed out of 24

OK?

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/devel/catch2/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- Makefile 4 Jan 2022 06:05:30 -0000 1.37
+++ Makefile 4 Jan 2022 09:28:48 -0000
@@ -5,8 +5,8 @@ COMMENT = C++-native, header-only, test
GH_ACCOUNT = catchorg
GH_PROJECT = Catch2
GH_TAGNAME = v2.13.8
-
-DISTNAME = catch2-${GH_TAGNAME:S/v//}
+PKGNAME = ${DISTNAME:L}
+REVISION = 0

CATEGORIES = devel

@@ -23,7 +23,16 @@ MODULES = devel/cmake \

MODPY_RUNDEP = No

+# just header files
+PKG_ARCH = *
+
+# compile tests only when testing
+NO_BUILD = Yes
+
pre-configure:
ln -sf ${MODPY_BIN} ${WRKDIR}/bin/python
+
+pre-test:
+ ${MODCMAKE_BUILD_TARGET}

.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/devel/catch2/distinfo,v
retrieving revision 1.35
diff -u -p -r1.35 distinfo
--- distinfo 4 Jan 2022 06:05:30 -0000 1.35
+++ distinfo 4 Jan 2022 08:30:05 -0000
@@ -1,2 +1,2 @@
-SHA256 (catch2-2.13.8.tar.gz) = ubWSvXQ8CfE+5L81/DDu7idIljGE9r6oNrFG5swqWFo=
-SIZE (catch2-2.13.8.tar.gz) = 661711
+SHA256 (Catch2-2.13.8.tar.gz) = ubWSvXQ8CfE+5L81/DDu7idIljGE9r6oNrFG5swqWFo=
+SIZE (Catch2-2.13.8.tar.gz) = 661711

No comments:

Post a Comment