pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc
Module Name: pkgsrc
Committed By: rillig
Date: Mon Jun 29 20:30:13 UTC 2020
Modified Files:
pkgsrc/mk: haskell.mk
pkgsrc/regress/infra-unittests: haskell.sh
Log Message:
mk/haskell.mk: only add PLIST_SUBST and PRINT_PLIST_AWK if useful
The PLIST_SUBST and PLIST_PRINT_AWK definitions for Haskell library
packages are only useful if the package-description file exists. If
that file is absent though, these are skipped.
The test whether the file exists is made as late as possible since that
file does not yet exist at the point where the package Makefile is
parsed.
This also affects the show-all-haskell target, which only shows these
values after the install phase. This is not perfect but good enough for
practical cases.
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 pkgsrc/mk/haskell.mk
cvs rdiff -u -r1.2 -r1.3 pkgsrc/regress/infra-unittests/haskell.sh
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.22 pkgsrc/mk/haskell.mk:1.23
--- pkgsrc/mk/haskell.mk:1.22 Mon Jun 29 18:07:45 2020
+++ pkgsrc/mk/haskell.mk Mon Jun 29 20:30:13 2020
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.22 2020/06/29 18:07:45 rillig Exp $
+# $NetBSD: haskell.mk,v 1.23 2020/06/29 20:30:13 rillig Exp $
#
# This Makefile fragment handles Haskell Cabal packages.
# See: http://www.haskell.org/cabal/
@@ -246,18 +246,20 @@ _HASKELL_PL_PKGID_CMD= ${CAT} ${DESTDIR}
_HASKELL_PL_PKGID= ${_HASKELL_PL_PKGID_CMD:sh}
_HASKELL_PL_VER= ${_HASKELL_VERSION:S,-,,}
-PLIST_SUBST+= HS_INTF=${_HASKELL_PL_INTF}
-PLIST_SUBST+= HS_IMPL=${_HASKELL_PL_IMPL}
-PLIST_SUBST+= HS_DOCS=${_HASKELL_PL_DOCS}
-PLIST_SUBST+= HS_PLATFORM=${_HASKELL_PL_PLATFORM}
-PLIST_SUBST+= HS_PKGID=${_HASKELL_PL_PKGID}
-PLIST_SUBST+= HS_VER=${_HASKELL_PL_VER}
-PRINT_PLIST_AWK+= { sub("^${_HASKELL_PL_INTF}", "$${HS_INTF}") }
-PRINT_PLIST_AWK+= { sub("^${_HASKELL_PL_IMPL}", "$${HS_IMPL}") }
-PRINT_PLIST_AWK+= { sub("^${_HASKELL_PL_DOCS}", "$${HS_DOCS}") }
-PRINT_PLIST_AWK+= { sub("/${_HASKELL_PL_PLATFORM}/", "/$${HS_PLATFORM}/") }
-PRINT_PLIST_AWK+= { sub( "${_HASKELL_PL_PKGID}", "$${HS_PKGID}") }
-PRINT_PLIST_AWK+= { sub( "${_HASKELL_PL_VER}", "$${HS_VER}") }
+_HS_PLIST_SUBST+= HS_INTF=${_HASKELL_PL_INTF}
+_HS_PLIST_SUBST+= HS_IMPL=${_HASKELL_PL_IMPL}
+_HS_PLIST_SUBST+= HS_DOCS=${_HASKELL_PL_DOCS}
+_HS_PLIST_SUBST+= HS_PLATFORM=${_HASKELL_PL_PLATFORM}
+_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}") }
+_HS_PRINT_PLIST_AWK+= { sub("/${_HASKELL_PL_PLATFORM}/", "/$${HS_PLATFORM}/") }
+_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}:}
HS_UPDATE_PLIST?= no
Index: pkgsrc/regress/infra-unittests/haskell.sh
diff -u pkgsrc/regress/infra-unittests/haskell.sh:1.2 pkgsrc/regress/infra-unittests/haskell.sh:1.3
--- pkgsrc/regress/infra-unittests/haskell.sh:1.2 Mon Jun 29 20:12:34 2020
+++ pkgsrc/regress/infra-unittests/haskell.sh Mon Jun 29 20:30:13 2020
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: haskell.sh,v 1.2 2020/06/29 20:12:34 rillig Exp $
+# $NetBSD: haskell.sh,v 1.3 2020/06/29 20:30:13 rillig Exp $
#
# Tests for mk/haskell.mk.
#
@@ -427,23 +427,6 @@ if test_case_begin 'neither package-id n
assert_that "$tmpdir/output" --file-is-lines \
'_HS_PLIST_STATUS=missing' \
- "awk: can't open file $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-description" \
- ' source line number 1' \
- 'bmake: "awk '\''prev == "import-dirs:" { dir = $1; exit } { prev = $0 } END { print(dir ? dir : "never_match_this") }'\''
'"$destdir""$prefix"'/lib/package-1.0/ghc-8.8.1/package-description" returned non-zero status' \
- "awk: can't open file $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-description" \
- ' source line number 1' \
- 'bmake: "awk '\''prev == "import-dirs:" { dir = $1; exit } { prev = $0 } END { print(dir ? dir : "never_match_this") }'\''
'"$destdir""$prefix"'/lib/package-1.0/ghc-8.8.1/package-description" returned non-zero status' \
- "awk: can't open file $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-description" \
- ' source line number 1' \
- 'bmake: "awk '\''prev == "import-dirs:" { dir = $1; exit } { prev = $0 } END { print(dir ? dir : "never_match_this") }'\''
'"$destdir""$prefix"'/lib/package-1.0/ghc-8.8.1/package-description" returned non-zero status' \
- "cat: $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-id: No such file or directory" \
- "$make: \"cat $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-id\" returned non-zero status" \
- 'PLIST_SUBST HS_INTF=lib/package-1.0/ghc-8.8.1' \
- 'PLIST_SUBST HS_IMPL=' \
- 'PLIST_SUBST HS_DOCS=' \
- 'PLIST_SUBST HS_PLATFORM=never_match_this' \
- 'PLIST_SUBST HS_PKGID=' \
- 'PLIST_SUBST HS_VER=ghc8.8.1' \
'PLIST_SUBST OPSYS=Opsys' \
'PLIST_SUBST OS_VERSION=' \
'PLIST_SUBST MACHINE_ARCH=arch' \
@@ -469,43 +452,7 @@ if test_case_begin 'neither package-id n
'PLIST_SUBST TRUE=true' \
'PLIST_SUBST PKGGNUDIR=' \
'PLIST_SUBST PKGMANDIR=' \
- "awk: can't open file $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-description" \
- ' source line number 1' \
- 'bmake: "awk '\''prev == "import-dirs:" { dir = $1; exit } { prev = $0 } END { print(dir ? dir : "never_match_this") }'\''
'"$destdir""$prefix"'/lib/package-1.0/ghc-8.8.1/package-description" returned non-zero status' \
- "awk: can't open file $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-description" \
- ' source line number 1' \
- 'bmake: "awk '\''prev == "import-dirs:" { dir = $1; exit } { prev = $0 } END { print(dir ? dir : "never_match_this") }'\''
'"$destdir""$prefix"'/lib/package-1.0/ghc-8.8.1/package-description" returned non-zero status' \
- "awk: can't open file $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-description" \
- ' source line number 1' \
- 'bmake: "awk '\''prev == "import-dirs:" { dir = $1; exit } { prev = $0 } END { print(dir ? dir : "never_match_this") }'\''
'"$destdir""$prefix"'/lib/package-1.0/ghc-8.8.1/package-description" returned non-zero status' \
- "cat: $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-id: No such file or directory" \
- "$make: \"cat $destdir$prefix/lib/package-1.0/ghc-8.8.1/package-id\" returned non-zero status" \
- 'PRINT_PLIST_AWK {' \
- 'PRINT_PLIST_AWK sub("^lib/package-1.0/ghc-8.8.1",' \
- 'PRINT_PLIST_AWK "")' \
- 'PRINT_PLIST_AWK }' \
- 'PRINT_PLIST_AWK {' \
- 'PRINT_PLIST_AWK sub("^",' \
- 'PRINT_PLIST_AWK "")' \
- 'PRINT_PLIST_AWK }' \
- 'PRINT_PLIST_AWK {' \
- 'PRINT_PLIST_AWK sub("^",' \
- 'PRINT_PLIST_AWK "")' \
- 'PRINT_PLIST_AWK }' \
- 'PRINT_PLIST_AWK {' \
- 'PRINT_PLIST_AWK sub("/never_match_this/",' \
- 'PRINT_PLIST_AWK "//")' \
- 'PRINT_PLIST_AWK }' \
- 'PRINT_PLIST_AWK {' \
- 'PRINT_PLIST_AWK sub(' \
- 'PRINT_PLIST_AWK "",' \
- 'PRINT_PLIST_AWK "")' \
- 'PRINT_PLIST_AWK }' \
- 'PRINT_PLIST_AWK {' \
- 'PRINT_PLIST_AWK sub(' \
- 'PRINT_PLIST_AWK "ghc8.8.1",' \
- 'PRINT_PLIST_AWK "")' \
- 'PRINT_PLIST_AWK }'
+ 'PRINT_PLIST_AWK '
test_case_end
fi
Home |
Main Index |
Thread Index |
Old Index