Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc mk/haskell.mk: regenerate PLIST if it is outdated
details: https://anonhg.NetBSD.org/pkgsrc/rev/d8c8315f1272
branches: trunk
changeset: 435060:d8c8315f1272
user: rillig <rillig%pkgsrc.org@localhost>
date: Mon Jun 29 22:00:58 2020 +0000
description:
mk/haskell.mk: regenerate PLIST if it is outdated
Now that haskell.mk distinguishes between plain and outdated PLIST files,
this is possible again. When haskell.mk knew only missing and outdated,
this was still ambiguous and therefore skipped.
diffstat:
mk/haskell.mk | 18 +++++++++---------
regress/infra-unittests/haskell.sh | 35 ++++++++++++++++++-----------------
2 files changed, 27 insertions(+), 26 deletions(-)
diffs (121 lines):
diff -r a2ebbae9f236 -r d8c8315f1272 mk/haskell.mk
--- a/mk/haskell.mk Mon Jun 29 21:24:39 2020 +0000
+++ b/mk/haskell.mk Mon Jun 29 22:00:58 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.24 2020/06/29 20:51:24 rillig Exp $
+# $NetBSD: haskell.mk,v 1.25 2020/06/29 22:00:58 rillig Exp $
#
# This Makefile fragment handles Haskell Cabal packages.
# See: http://www.haskell.org/cabal/
@@ -234,7 +234,6 @@
# the PLIST.
#
.if ${_HS_PLIST_STATUS} == lib-ok || ${_HS_PLIST_STATUS} == missing
-
_HASKELL_PL_INTF= ${_HASKELL_PKG_ID_FILE:H:S,^${PREFIX}/,,}
_HASKELL_PL_IMPL_AWK= prev == "import-dirs:" { dir = $$1; exit }
_HASKELL_PL_IMPL_AWK+= { prev = $$0 }
@@ -254,6 +253,7 @@
_HS_PLIST_SUBST+= HS_PKGID=${_HASKELL_PL_PKGID}
_HS_PLIST_SUBST+= HS_VER=${_HASKELL_PL_VER}
PLIST_SUBST+= ${exists(${DESTDIR}${_HASKELL_PKG_DESCR_FILE}):?${_HS_PLIST_SUBST}:}
+
_HS_PRINT_PLIST_AWK+= { sub("^${_HASKELL_PL_INTF}", "$${HS_INTF}") }
_HS_PRINT_PLIST_AWK+= { sub("^${_HASKELL_PL_IMPL}", "$${HS_IMPL}") }
_HS_PRINT_PLIST_AWK+= { sub("^${_HASKELL_PL_DOCS}", "$${HS_DOCS}") }
@@ -261,21 +261,21 @@
_HS_PRINT_PLIST_AWK+= { sub( "${_HASKELL_PL_PKGID}", "$${HS_PKGID}") }
_HS_PRINT_PLIST_AWK+= { sub( "${_HASKELL_PL_VER}", "$${HS_VER}") }
PRINT_PLIST_AWK+= ${exists(${DESTDIR}${_HASKELL_PKG_DESCR_FILE}):?${_HS_PRINT_PLIST_AWK}:}
-
-. if ${HS_UPDATE_PLIST} != no && ${_HS_PLIST_STATUS} == missing
-GENERATE_PLIST+= ${MAKE} print-PLIST > ${PKGDIR}/PLIST;
-. endif
.endif
.if ${_HS_PLIST_STATUS} == missing || ${_HS_PLIST_STATUS} == outdated
+. if ${HS_UPDATE_PLIST} == yes
+GENERATE_PLIST+= ${MAKE} print-PLIST > ${PKGDIR}/PLIST;
+. endif
GENERATE_PLIST+= \
cd ${DESTDIR:Q}${PREFIX:Q} && \
${FIND} * \( -type f -o -type l \) | ${SORT};
-PLIST_SRC= # none, because the PLIST file is outdated or missing
-. if ${_HS_PLIST_STATUS} == outdated && ${HS_UPDATE_PLIST} == no
+PLIST_SRC= # none
+.endif
+
+.if ${_HS_PLIST_STATUS} == outdated && ${HS_UPDATE_PLIST} == no
WARNINGS+= "[haskell.mk] The PLIST format is outdated."
WARNINGS+= "[haskell.mk] Set HS_UPDATE_PLIST=yes to update it automatically."
-. endif
.endif
# Define configure target. We might not have any working Haskell
diff -r a2ebbae9f236 -r d8c8315f1272 regress/infra-unittests/haskell.sh
--- a/regress/infra-unittests/haskell.sh Mon Jun 29 21:24:39 2020 +0000
+++ b/regress/infra-unittests/haskell.sh Mon Jun 29 22:00:58 2020 +0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: haskell.sh,v 1.5 2020/06/29 21:24:39 rillig Exp $
+# $NetBSD: haskell.sh,v 1.6 2020/06/29 22:00:58 rillig Exp $
#
# Tests for mk/haskell.mk.
#
@@ -71,8 +71,16 @@
.include "mk/plist/bsd.plist.mk"
.include "mk/misc/show.mk"
+# from bsd.pkg.mk
+PKGNAME_NOREV?= \${PKGNAME}
+PKGVERSION?= \${PKGNAME:C/^.*-//}
+PKGBASE?= \${PKGNAME:C/-[^-]*$//}
+
show-plist-status: .PHONY
@echo "PLIST status: "\${_HS_PLIST_STATUS:Q}
+
+show-var: .PHONY
+ @echo \${\${VARNAME}:Q}
EOF
link_from_pkgsrc 'mk/haskell.mk'
@@ -206,19 +214,12 @@
# Based on devel/hs-asn1-parse from 2020-06-22.
- create_file_lines 'Makefile' \
- 'DISTNAME= asn1-parse-0.9.5' \
- 'PKGVERSION= 0.9.5' \
- 'PKGNAME_NOREV= ${DISTNAME}' \
- '' \
- 'HS_UPDATE_PLIST= yes' \
- "PKGDIR= $PWD" \
- '' \
- '.include "../../main.mk"' \
- '.include "../../mk/haskell.mk"' \
- '' \
- 'show-haskell-plist-status: .PHONY' \
- ' @echo "PLIST status: "${_HS_PLIST_STATUS:Q}'
+ create_file 'Makefile' <<-EOF
+ DISTNAME= asn1-parse-0.9.5
+ HS_UPDATE_PLIST= yes
+
+ .include "../../main.mk"
+ EOF
create_file "$destdir$prefix/lib/asn1-parse-0.9.5/ghc-8.8.1/package-id" <<-EOF
asn1-parse-0.9.5-2HryHNyN1grJJzKM4AV1Gr
EOF
@@ -392,10 +393,10 @@
'PLIST_SUBST LOWER_VENDOR=' \
'PLIST_SUBST LOWER_OPSYS=' \
'PLIST_SUBST LOWER_OS_VERSION=' \
- 'PLIST_SUBST PKGBASE=' \
- 'PLIST_SUBST PKGNAME=' \
+ 'PLIST_SUBST PKGBASE=hs-package' \
+ 'PLIST_SUBST PKGNAME=hs-package-1.0' \
'PLIST_SUBST PKGLOCALEDIR=' \
- 'PLIST_SUBST PKGVERSION=' \
+ 'PLIST_SUBST PKGVERSION=1.0' \
'PLIST_SUBST LOCALBASE=' \
'PLIST_SUBST VIEWBASE=' \
'PLIST_SUBST X11BASE=' \
Home |
Main Index |
Thread Index |
Old Index