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: Sun Apr 28 08:55:37 UTC 2024
Modified Files:
pkgsrc/mk: haskell.mk
pkgsrc/mk/haskell: DEINSTALL.in INSTALL.in
Log Message:
mk/haskell/{DE,}INSTALL.in: Be explicit about Haskell package DB to work with
Prior to this change the DEINSTALL hook for Haskell packages left garbage files in ${LOCALBASE}/lib/ghc-X.Y.Z/lib/package.conf.d when the major version of GHC changed.
To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 pkgsrc/mk/haskell.mk
cvs rdiff -u -r1.3 -r1.4 pkgsrc/mk/haskell/DEINSTALL.in \
pkgsrc/mk/haskell/INSTALL.in
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.59 pkgsrc/mk/haskell.mk:1.60
--- pkgsrc/mk/haskell.mk:1.59 Sun Apr 28 08:33:44 2024
+++ pkgsrc/mk/haskell.mk Sun Apr 28 08:55:37 2024
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.59 2024/04/28 08:33:44 pho Exp $
+# $NetBSD: haskell.mk,v 1.60 2024/04/28 08:55:37 pho Exp $
#
# This Makefile fragment handles Haskell Cabal packages. Package
# configuration, building, installation, registration and unregistration
@@ -109,6 +109,7 @@ _DEF_VARS.haskell= \
DEINSTALL_TEMPLATES \
UNLIMIT_RESOURCES \
_HASKELL_BIN \
+ _HASKELL_GLOBAL_PKG_DB \
_HASKELL_PKG_BIN \
_HASKELL_PKG_DESCR_FILE_OR_DIR \
_HASKELL_PKG_ID_FILE \
@@ -121,7 +122,9 @@ _USE_VARS.haskell= \
MASTER_SITE_HASKELL_HACKAGE \
PKGDIR DESTDIR \
PREFIX \
- WRKSRC
+ WRKSRC \
+ _MAKE_JOBS_N \
+ _PATH_ORIG
_SORTED_VARS.haskell= \
HASKELL_UNRESTRICT_DEPENDENCIES
_LISTED_VARS.haskell= \
@@ -167,6 +170,13 @@ _HASKELL_VERSION:= ghc-${_HASKELL_VERSIO
.endif
MAKEVARS+= _HASKELL_VERSION
+# Determine the path to the global Haskell package database. We need this
+# in our INSTALL and DEINSTALL hooks.
+.if !defined(_HASKELL_GLOBAL_PKG_DB)
+_HASKELL_GLOBAL_PKG_DB!= ${_HASKELL_BIN:Q} --print-global-package-db
+.endif
+MAKEVARS+= _HASKELL_GLOBAL_PKG_DB
+
# By default GHC uses a per-user default environment file if one is
# available. Cabal has to be visible in order to compile Setup.?hs,
# but per-user default environment files usually don't mark it as
@@ -306,7 +316,7 @@ _HS_PLIST_STATUS= ok
# description of "base" (which always exists) and extract the platform
# from it.
.if !defined(_HS_PLIST.platform)
-_HS_PLIST.platform.cmd= ${_HASKELL_PKG_BIN} --simple-output field base data-dir
+_HS_PLIST.platform.cmd= ${_HASKELL_PKG_BIN:Q} --simple-output field base data-dir
_HS_PLIST.platform:= ${_HS_PLIST.platform.cmd:sh:H:T}
.endif
MAKEVARS+= _HS_PLIST.platform
@@ -472,9 +482,10 @@ do-install:
${XARGS} ${RMDIR} -p 2>/dev/null || ${TRUE}
# 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}
-FILES_SUBST+= HASKELL_PKG_ID_FILE=${_HASKELL_PKG_ID_FILE}
+FILES_SUBST+= HASKELL_GLOBAL_PKG_DB=${_HASKELL_GLOBAL_PKG_DB:Q}
+FILES_SUBST+= HASKELL_PKG_BIN=${_HASKELL_PKG_BIN:Q}
+FILES_SUBST+= HASKELL_PKG_DESCR_FILE_OR_DIR=${_HASKELL_PKG_DESCR_FILE_OR_DIR:Q}
+FILES_SUBST+= HASKELL_PKG_ID_FILE=${_HASKELL_PKG_ID_FILE:Q}
FILES_SUBST+= AWK=${AWK:Q}
FILES_SUBST+= EXPR=${EXPR:Q}
FILES_SUBST+= TRUE=${TRUE:Q}
Index: pkgsrc/mk/haskell/DEINSTALL.in
diff -u pkgsrc/mk/haskell/DEINSTALL.in:1.3 pkgsrc/mk/haskell/DEINSTALL.in:1.4
--- pkgsrc/mk/haskell/DEINSTALL.in:1.3 Fri Feb 11 01:11:57 2022
+++ pkgsrc/mk/haskell/DEINSTALL.in Sun Apr 28 08:55:37 2024
@@ -1,6 +1,7 @@
# -*- sh -*-
-# $NetBSD: DEINSTALL.in,v 1.3 2022/02/11 01:11:57 pho Exp $
+# $NetBSD: DEINSTALL.in,v 1.4 2024/04/28 08:55:37 pho Exp $
#
+HASKELL_GLOBAL_PKG_DB="@HASKELL_GLOBAL_PKG_DB@"
HASKELL_PKG_BIN="@HASKELL_PKG_BIN@"
HASKELL_PKG_ID_FILE="@HASKELL_PKG_ID_FILE@"
AWK="@AWK@"
@@ -19,7 +20,11 @@ case ${STAGE} in
print lines[j--] }' "${HASKELL_PKG_ID_FILE}" |
while read pkg_id; do
${ECHO} "Unregistering \`$pkg_id'..."
- ${HASKELL_PKG_BIN} unregister --force --ipid "$pkg_id"
+ ${HASKELL_PKG_BIN} \
+ --package-db="${HASKELL_GLOBAL_PKG_DB}" \
+ --force \
+ --ipid \
+ unregister "$pkg_id"
done
fi
;;
Index: pkgsrc/mk/haskell/INSTALL.in
diff -u pkgsrc/mk/haskell/INSTALL.in:1.3 pkgsrc/mk/haskell/INSTALL.in:1.4
--- pkgsrc/mk/haskell/INSTALL.in:1.3 Fri Feb 11 01:11:57 2022
+++ pkgsrc/mk/haskell/INSTALL.in Sun Apr 28 08:55:37 2024
@@ -1,6 +1,7 @@
# -*- sh -*-
-# $NetBSD: INSTALL.in,v 1.3 2022/02/11 01:11:57 pho Exp $
+# $NetBSD: INSTALL.in,v 1.4 2024/04/28 08:55:37 pho Exp $
#
+HASKELL_GLOBAL_PKG_DB="@HASKELL_GLOBAL_PKG_DB@"
HASKELL_PKG_BIN="@HASKELL_PKG_BIN@"
HASKELL_PKG_DESCR_FILE_OR_DIR="@HASKELL_PKG_DESCR_FILE_OR_DIR@"
EXPR="@EXPR@"
@@ -10,7 +11,9 @@ case ${STAGE} in
POST-INSTALL)
if [ -f "${HASKELL_PKG_DESCR_FILE_OR_DIR}" ]; then
# The package contains a single library.
- ${HASKELL_PKG_BIN} register "${HASKELL_PKG_DESCR_FILE_OR_DIR}";
+ ${HASKELL_PKG_BIN} \
+ --package-db="${HASKELL_GLOBAL_PKG_DB}" \
+ register "${HASKELL_PKG_DESCR_FILE_OR_DIR}";
elif [ -d "${HASKELL_PKG_DESCR_FILE_OR_DIR}" ]; then
# The package contains two or more libraries. The order of
@@ -20,6 +23,7 @@ case ${STAGE} in
while ${TRUE}; do
if [ -f "${HASKELL_PKG_DESCR_FILE_OR_DIR}/${i}" ]; then
${HASKELL_PKG_BIN} \
+ --package-db="${HASKELL_GLOBAL_PKG_DB}" \
register "${HASKELL_PKG_DESCR_FILE_OR_DIR}/${i}"
i=`${EXPR} $i + 1`
else
Home |
Main Index |
Thread Index |
Old Index