pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Support GHC 7.10.x and later



details:   https://anonhg.NetBSD.org/pkgsrc/rev/14ad148d0686
branches:  trunk
changeset: 406695:14ad148d0686
user:      pho <pho%pkgsrc.org@localhost>
date:      Sun Dec 29 16:59:55 2019 +0000

description:
Support GHC 7.10.x and later

diffstat:

 mk/haskell.mk |  80 ++++++++++++++++++++++++++++------------------------------
 1 files changed, 38 insertions(+), 42 deletions(-)

diffs (171 lines):

diff -r 74083cd33d20 -r 14ad148d0686 mk/haskell.mk
--- a/mk/haskell.mk     Sun Dec 29 16:59:24 2019 +0000
+++ b/mk/haskell.mk     Sun Dec 29 16:59:55 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.4 2016/04/10 15:58:02 joerg Exp $
+# $NetBSD: haskell.mk,v 1.5 2019/12/29 16:59:55 pho Exp $
 #
 # This Makefile fragment handles Haskell Cabal packages.
 # See: http://www.haskell.org/cabal/
@@ -20,7 +20,7 @@
 #
 #   * PKGNAME will automatically be "hs-${DISTNAME}" unless you
 #     explicitly declare it.
-# 
+#
 #   * If your package is on the HackageDB, MASTER_SITES and HOMEPAGE
 #     can be omitted.
 #
@@ -124,7 +124,7 @@
 MASTER_SITES?= ${MASTER_SITE_HASKELL_HACKAGE:=${DISTNAME}/}
 
 # Default value of HOMEPAGE.
-HOMEPAGE?=     http://hackage.haskell.org/cgi-bin/hackage-scripts/package/${_DISTBASE}
+HOMEPAGE?=     http://hackage.haskell.org/package/${_DISTBASE}
 
 # Cabal packages may use pkg-config, but url2pkg can't detect
 # that. (PHO: I think that should be handled by url2pkg (2009-05-20))
@@ -152,15 +152,16 @@
 _HASKELL_PKG_BIN=      ${_GHC_PKG_BIN} # Expose to the outer scope.
 
 # Determine GHC version.
-_GHC_VERSION_CMD=      ${_GHC_BIN} -V | ${CUT} -d ' ' -f 8
-_GHC_VERSION=          ${_GHC_VERSION_CMD:sh}
+.if exists(${_GHC_BIN})
+_GHC_VERSION!=         ${_GHC_BIN} -V | ${CUT} -d ' ' -f 8
+.endif
 _GHC_VERSION_SUFFIX=   ghc${_GHC_VERSION}
 _GHC_VERSION_FULL=     ghc-${_GHC_VERSION}
 _HASKELL_VERSION_SUFFIX=       ${_GHC_VERSION_SUFFIX}
 _HASKELL_VERSION=      ${_GHC_VERSION_FULL} # Expose to the outer scope.
 
 # Determine GHC shlib suffix
-_GHC_SHLIB_SUFFIX.dylib=       dylib   
+_GHC_SHLIB_SUFFIX.dylib=       dylib
 _GHC_SHLIB_SUFFIX=             ${_GHC_SHLIB_SUFFIX.${SHLIB_TYPE}:Uso}
 _HASKELL_SHLIB_SUFFIX=         ${_GHC_SHLIB_SUFFIX}
 
@@ -169,15 +170,14 @@
 
 # Declarations for ../../mk/configure/configure.mk
 CONFIGURE_ARGS+=       --ghc
-CONFIGURE_ARGS+=       --with-compiler=${_GHC_BIN}
-CONFIGURE_ARGS+=       --with-hc-pkg=${_GHC_PKG_BIN}
-CONFIGURE_ARGS+=       --prefix=${PREFIX}
+CONFIGURE_ARGS+=       --with-compiler=${_GHC_BIN:Q}
+CONFIGURE_ARGS+=       --with-hc-pkg=${_GHC_PKG_BIN:Q}
+CONFIGURE_ARGS+=       --prefix=${PREFIX:Q}
 .endif # ${HASKELL_COMPILER}
 
 # Shared libraries
 .if ${HASKELL_ENABLE_SHARED_LIBRARY} == "yes"
 CONFIGURE_ARGS+=       --enable-shared --enable-executable-dynamic
-CONFIGURE_ARGS+=       "--ghc-option=-optl ${COMPILER_RPATH_FLAG}${PREFIX}/lib/${_GHC_VERSION_FULL}/${DISTNAME}"
 .endif
 
 # Library profiling
@@ -187,36 +187,31 @@
 
 
 # Haddock documentations
-PLIST_VARS+=           doc
 .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes"
-CONFIGURE_ARGS+=       --with-haddock=${BUILDLINK_PREFIX.ghc}/bin/haddock
-PLIST.doc=             yes
+CONFIGURE_ARGS+=       --with-haddock=${BUILDLINK_PREFIX.ghc:Q}/bin/haddock
 .endif
 
 # Optimization
 CONFIGURE_ARGS+=       -O2
 
-# package.conf and package.conf.old should be ignored at all.
-PRINT_PLIST_AWK+= \
-       /\/package\.conf(\.old)?$$/ { next; }
-
-# _HASKELL_VERSION should be substituted in PLIST.
-PLIST_SUBST+=  HASKELL_VERSION=${_HASKELL_VERSION}
-PLIST_SUBST+=  HASKELL_VERSION_SUFFIX=${_HASKELL_VERSION_SUFFIX}
-PRINT_PLIST_AWK+= \
-       ($$0 ~ /-${_HASKELL_VERSION_SUFFIX}\.${_HASKELL_SHLIB_SUFFIX}$$/) { next; } \
-       ($$0 ~ /lib\/.*_p\.a$$/) { next; } \
-       ($$0 ~ /\.dyn_hi$$/) { next; } \
-       ($$0 ~ /\.p_hi$$/) { next; } \
-       ($$0 ~ /^share\/doc\/${DISTNAME}\/html\//) \
-       { $$0 = "$${PLIST.doc}" $$0; } \
-       { gsub(/${_HASKELL_VERSION_SUFFIX}/, "$${HASKELL_VERSION_SUFFIX}"); } \
-       { gsub(/${_HASKELL_VERSION}/, "$${HASKELL_VERSION}"); }
-PLIST_AWK+=    -f ${PKGSRCDIR}/mk/plist/plist-haskell.awk
-PLIST_AWK_ENV+=        HASKELL_VERSION_SUFFIX=${_HASKELL_VERSION_SUFFIX}
-PLIST_AWK_ENV+=        HASKELL_SHLIB_SUFFIX=${_HASKELL_SHLIB_SUFFIX}
-PLIST_AWK_ENV+=        HASKELL_ENABLE_SHARED_LIBRARY=${HASKELL_ENABLE_SHARED_LIBRARY}
-PLIST_AWK_ENV+=        HASKELL_ENABLE_LIBRARY_PROFILING=${HASKELL_ENABLE_LIBRARY_PROFILING}
+# Starting from GHC 7.10 (or 7.8?), packages are installed in
+# directories with a hashed name so we can no longer predict the
+# contents of PLIST.
+GENERATE_PLIST+= \
+       cd ${DESTDIR:Q}${PREFIX:Q} && \
+               ${FIND} * \( -type f -o -type l \) | ${SORT};
+# But since our packages may still have PLIST files, it is necessary
+# to ignore them until we get rid of them all. Or they all will be
+# broken.
+PLIST_SRC=             # none
+.if ${PKG_DEVELOPER:Uno:tl} != "no"
+.PHONY: _check-ignored-plist
+privileged-install-hook: _check-ignored-plist
+_check-ignored-plist: error-check
+       ${RUN}if ${TEST} -f PLIST; then \
+               ${DELAYED_WARNING_MSG} "[haskell.mk] The PLIST file is no longer used. Please remove it."; \
+       fi
+.endif
 
 # We might not have any working Haskell interpreter so compile
 # Setup.?hs to a binary.
@@ -224,33 +219,35 @@
 
 ${WRKSRC}/Setup:
        ${RUN} cd ${WRKSRC} && \
-               ${_HASKELL_BIN} --make Setup
+               ${_HASKELL_BIN:Q} --make Setup
 
 # Define configure target.
 do-configure:
-       ${RUN} cd ${WRKSRC} && \
+       ${RUN} cd ${WRKSRC:Q} && \
                ${SETENV} ${CONFIGURE_ENV} \
                        ./Setup configure ${CONFIGURE_ARGS}
 
 # Define build target.
 do-build:
-       ${RUN} cd ${WRKSRC} && \
+       ${RUN} cd ${WRKSRC:Q} && \
                ./Setup build
 .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes"
-       ${RUN} cd ${WRKSRC} && \
+       ${RUN} cd ${WRKSRC:Q} && \
                ./Setup haddock
 .endif
 
 # Define install target. We need installed-pkg-config to be installed
 # for package registration (if any).
-_HASKELL_PKG_DESCR_FILE=       ${PREFIX}/lib/${DISTNAME}/${_HASKELL_VERSION}/package-description
+_HASKELL_PKG_DESCR_DIR=                ${PREFIX}/lib/${DISTNAME}/${_HASKELL_VERSION}
+_HASKELL_PKG_DESCR_FILE=       ${_HASKELL_PKG_DESCR_DIR}/package-description
 
+INSTALLATION_DIRS+=            ${_HASKELL_PKG_DESCR_DIR}
 do-install:
        ${RUN} cd ${WRKSRC} && \
                ./Setup register --gen-pkg-config=dist/package-description && \
-               ./Setup copy --destdir=${DESTDIR} && \
+               ./Setup copy --destdir=${DESTDIR:Q} && \
                if [ -f dist/package-description ]; then \
-                       ${INSTALL_DATA} dist/package-description ${DESTDIR}${_HASKELL_PKG_DESCR_FILE}; \
+                       ${INSTALL_DATA} dist/package-description ${DESTDIR:Q}${_HASKELL_PKG_DESCR_FILE:Q}; \
                fi \
 
 # Define test target.
@@ -266,5 +263,4 @@
 INSTALL_TEMPLATES+=    ../../mk/haskell/INSTALL.in
 DEINSTALL_TEMPLATES+=  ../../mk/haskell/DEINSTALL.in
 
-
 .endif # HASKELL_MK



Home | Main Index | Thread Index | Old Index