pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc Use tools framework for Haskell source preprocessors
details: https://anonhg.NetBSD.org/pkgsrc/rev/3d5168103896
branches: trunk
changeset: 451794:3d5168103896
user: pho <pho%pkgsrc.org@localhost>
date: Sat May 01 16:14:19 2021 +0000
description:
Use tools framework for Haskell source preprocessors
diffstat:
devel/hs-haskell-src-exts/Makefile | 5 +++--
devel/hs-pretty-show/Makefile | 4 ++--
mk/haskell.mk | 9 ++++++++-
mk/haskell/tools/alex.mk | 17 +++++++++++++++++
mk/haskell/tools/cpphs.mk | 17 +++++++++++++++++
mk/haskell/tools/happy.mk | 17 +++++++++++++++++
6 files changed, 64 insertions(+), 5 deletions(-)
diffs (123 lines):
diff -r c8b73c954d50 -r 3d5168103896 devel/hs-haskell-src-exts/Makefile
--- a/devel/hs-haskell-src-exts/Makefile Sat May 01 16:08:56 2021 +0000
+++ b/devel/hs-haskell-src-exts/Makefile Sat May 01 16:14:19 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2021/04/23 12:16:15 pho Exp $
+# $NetBSD: Makefile,v 1.9 2021/05/01 16:14:19 pho Exp $
DISTNAME= haskell-src-exts-1.23.1
CATEGORIES= devel
@@ -7,7 +7,8 @@
COMMENT= Manipulating Haskell source
LICENSE= modified-bsd
-BUILD_DEPENDS+= happy>=1.19:../../devel/happy
+USE_TOOLS+= happy
+HAPPY_REQD= 1.19
.include "../../mk/haskell.mk"
.include "../../mk/bsd.pkg.mk"
diff -r c8b73c954d50 -r 3d5168103896 devel/hs-pretty-show/Makefile
--- a/devel/hs-pretty-show/Makefile Sat May 01 16:08:56 2021 +0000
+++ b/devel/hs-pretty-show/Makefile Sat May 01 16:14:19 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2021/04/23 10:31:55 pho Exp $
+# $NetBSD: Makefile,v 1.4 2021/05/01 16:14:19 pho Exp $
DISTNAME= pretty-show-1.10
CATEGORIES= devel
@@ -7,7 +7,7 @@
COMMENT= Tools for working with derived Show instances
LICENSE= mit
-BUILD_DEPENDS+= happy-[0-9]*:../../devel/happy
+USE_TOOLS+= happy
.include "../../devel/hs-haskell-lexer/buildlink3.mk"
.include "../../mk/haskell.mk"
diff -r c8b73c954d50 -r 3d5168103896 mk/haskell.mk
--- a/mk/haskell.mk Sat May 01 16:08:56 2021 +0000
+++ b/mk/haskell.mk Sat May 01 16:14:19 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.32 2021/05/01 15:06:26 pho Exp $
+# $NetBSD: haskell.mk,v 1.33 2021/05/01 16:14:19 pho Exp $
#
# This Makefile fragment handles Haskell Cabal packages.
# Package configuration, building, installation, registration and
@@ -111,6 +111,13 @@
.include "../../lang/ghc88/buildlink3.mk"
+# Some Cabal packages requires preprocessors to build, and we don't
+# want them to implicitly depend on such tools. Place dummy scripts by
+# default.
+.include "../../mk/haskell/tools/alex.mk"
+.include "../../mk/haskell/tools/cpphs.mk"
+.include "../../mk/haskell/tools/happy.mk"
+
# Tools
_HASKELL_BIN= ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc
_HASKELL_PKG_BIN= ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc-pkg
diff -r c8b73c954d50 -r 3d5168103896 mk/haskell/tools/alex.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/haskell/tools/alex.mk Sat May 01 16:14:19 2021 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: alex.mk,v 1.1 2021/05/01 16:14:19 pho Exp $
+#
+# Usage: USE_TOOLS+= alex
+#
+
+ALEX_REQD?= 0
+TOOLS_CREATE+= alex
+
+.if !empty(USE_TOOLS:Malex)
+TOOLS_DEPENDS.alex?= alex>=${ALEX_REQD}:../../devel/alex
+TOOLS_PATH.alex= ${PREFIX}/bin/alex
+.else
+# We can't use TOOLS_FAIL because Cabal tries to invoke all of
+# relevant tools regardless of whether they are actually required.
+TOOLS_SCRIPT.alex= \
+ ${FAIL_MSG} "To use this tool, add USE_TOOLS+=alex to the package Makefile."
+.endif
diff -r c8b73c954d50 -r 3d5168103896 mk/haskell/tools/cpphs.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/haskell/tools/cpphs.mk Sat May 01 16:14:19 2021 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: cpphs.mk,v 1.1 2021/05/01 16:14:19 pho Exp $
+#
+# Usage: USE_TOOLS+= cpphs
+#
+
+CPPHS_REQD?= 0
+TOOLS_CREATE+= cpphs
+
+.if !empty(USE_TOOLS:Mcpphs)
+TOOLS_DEPENDS.cpphs?= hs-cpphs>=${CPPHS_REQD}:../../devel/hs-cpphs
+TOOLS_PATH.cpphs= ${PREFIX}/bin/cpphs
+.else
+# We can't use TOOLS_FAIL because Cabal tries to invoke all of
+# relevant tools regardless of whether they are actually required.
+TOOLS_SCRIPT.cpphs= \
+ ${FAIL_MSG} "To use this tool, add USE_TOOLS+=cpphs to the package Makefile."
+.endif
diff -r c8b73c954d50 -r 3d5168103896 mk/haskell/tools/happy.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/haskell/tools/happy.mk Sat May 01 16:14:19 2021 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: happy.mk,v 1.1 2021/05/01 16:14:19 pho Exp $
+#
+# Usage: USE_TOOLS+= happy
+#
+
+HAPPY_REQD?= 0
+TOOLS_CREATE+= happy
+
+.if !empty(USE_TOOLS:Mhappy)
+TOOLS_DEPENDS.happy?= happy>=${HAPPY_REQD}:../../devel/happy
+TOOLS_PATH.happy= ${PREFIX}/bin/happy
+.else
+# We can't use TOOLS_FAIL because Cabal tries to invoke all of
+# relevant tools regardless of whether they are actually required.
+TOOLS_SCRIPT.happy= \
+ ${FAIL_MSG} "To use this tool, add USE_TOOLS+=happy to the package Makefile."
+.endif
Home |
Main Index |
Thread Index |
Old Index