pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   pho
Date:           Tue Jan 24 11:57:09 UTC 2023

Modified Files:
        pkgsrc/mk: haskell.mk

Log Message:
mk/haskell.mk: New package-settable variable HASKELL_ENABLE_TESTS, disabled by default

It turned out to be a bad idea to define a do-test target
unconditionally. Tests can only be run when they are built, but they
usually require additional dependencies so it can't be enabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 pkgsrc/mk/haskell.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/haskell.mk
diff -u pkgsrc/mk/haskell.mk:1.51 pkgsrc/mk/haskell.mk:1.52
--- pkgsrc/mk/haskell.mk:1.51   Tue Jan 24 04:50:24 2023
+++ pkgsrc/mk/haskell.mk        Tue Jan 24 11:57:09 2023
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.51 2023/01/24 04:50:24 pho Exp $
+# $NetBSD: haskell.mk,v 1.52 2023/01/24 11:57:09 pho Exp $
 #
 # This Makefile fragment handles Haskell Cabal packages. Package
 # configuration, building, installation, registration and unregistration
@@ -32,6 +32,15 @@
 #      Possible values: yes, no
 #      Default value: inherits ${HASKELL_ENABLE_SHARED_LIBRARY}
 #
+# HASKELL_ENABLE_TESTS
+#      Build test suites. This usually requires some additional
+#      dependencies, which is why tests aren't enabled by
+#      default. Enabling it also defines the target "do-test" unless the
+#      Makefile already defines one.
+#
+#      Possible values: yes, no
+#      Default value: no
+#
 # HASKELL_UNRESTRICT_DEPENDENCIES
 #      A list of Cabal packages that the package depends on, whose version
 #      constraints are way too restricted to solve. Listing packages in
@@ -81,6 +90,7 @@ _USER_VARS.haskell= \
        HS_UPDATE_PLIST
 _PKG_VARS.haskell= \
        HASKELL_ENABLE_DYNAMIC_EXECUTABLE \
+       HASKELL_ENABLE_TESTS \
        HASKELL_OPTIMIZATION_LEVEL \
        HASKELL_PKG_NAME \
        HASKELL_UNRESTRICT_DEPENDENCIES \
@@ -135,6 +145,7 @@ HASKELL_ENABLE_DYNAMIC_EXECUTABLE?= ${HA
 HASKELL_ENABLE_SHARED_LIBRARY?=                yes
 HASKELL_ENABLE_LIBRARY_PROFILING?=     yes
 HASKELL_ENABLE_HADDOCK_DOCUMENTATION?= yes
+HASKELL_ENABLE_TESTS?=                 no
 HASKELL_UNRESTRICT_DEPENDENCIES?=      # empty
 
 .include "../../lang/ghc92/buildlink3.mk"
@@ -222,6 +233,15 @@ CONFIGURE_ARGS+=   --with-haddock=${BUILDL
 PLIST.doc=             yes
 .endif
 
+.if ${HASKELL_ENABLE_TESTS:tl} == "yes"
+CONFIGURE_ARGS+=       --enable-tests
+.  if !target(do-test)
+do-test:
+       ${RUN} ${_ULIMIT_CMD} cd ${WRKSRC} && \
+               ./Setup test ${PKG_VERBOSE:D-v}
+.  endif
+.endif
+
 CONFIGURE_ARGS+=       -O${HASKELL_OPTIMIZATION_LEVEL}
 CONFIGURE_ARGS+=       --enable-split-sections
 
@@ -441,13 +461,6 @@ do-install:
                ${TAIL} -n 1 | \
                ${XARGS} ${RMDIR} -p 2>/dev/null || ${TRUE}
 
-.if !target(do-test)
-# Define test target.
-do-test:
-       ${RUN} ${_ULIMIT_CMD} cd ${WRKSRC} && \
-               ./Setup test ${PKG_VERBOSE:D-v}
-.endif
-
 # Substitutions for INSTALL and DEINSTALL.
 FILES_SUBST+=  HASKELL_PKG_BIN=${_HASKELL_PKG_BIN}
 FILES_SUBST+=  HASKELL_PKG_DESCR_FILE_OR_DIR=${_HASKELL_PKG_DESCR_FILE_OR_DIR}



Home | Main Index | Thread Index | Old Index