Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk mk/haskell.mk: remove variable HASKELL_COMPILER, cl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b951b4c2be8d
branches:  trunk
changeset: 435177:b951b4c2be8d
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Jul 01 14:58:43 2020 +0000

description:
mk/haskell.mk: remove variable HASKELL_COMPILER, clean up documentation

There was only a single valid value for HASKELL_COMPILER, therefore the
variable was useless.  It only made the implementation more complicated
than necessary.

diffstat:

 mk/defaults/mk.conf |    8 +--
 mk/haskell.mk       |  169 ++++++++++++---------------------------------------
 2 files changed, 41 insertions(+), 136 deletions(-)

diffs (278 lines):

diff -r 7e106dc9f425 -r b951b4c2be8d mk/defaults/mk.conf
--- a/mk/defaults/mk.conf       Wed Jul 01 14:55:12 2020 +0000
+++ b/mk/defaults/mk.conf       Wed Jul 01 14:58:43 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.311 2020/05/28 16:22:58 maya Exp $
+# $NetBSD: mk.conf,v 1.312 2020/07/01 14:58:43 rillig Exp $
 #
 
 # This file provides default values for variables that may be overridden
@@ -1070,12 +1070,6 @@
 # card at I/O offset 0x300.
 # Default: not defined
 
-HASKELL_COMPILER?=     ghc
-# Used by haskell.mk to determine which Haskell compiler should be
-# used for building Haskell packages.
-# Possible: ghc
-# Default: ghc
-
 HOWL_GROUP?= howl
 # System group to run howl's mDNS responder as.
 # Possible: any group name
diff -r 7e106dc9f425 -r b951b4c2be8d mk/haskell.mk
--- a/mk/haskell.mk     Wed Jul 01 14:55:12 2020 +0000
+++ b/mk/haskell.mk     Wed Jul 01 14:58:43 2020 +0000
@@ -1,94 +1,44 @@
-# $NetBSD: haskell.mk,v 1.25 2020/06/29 22:00:58 rillig Exp $
+# $NetBSD: haskell.mk,v 1.26 2020/07/01 14:58:43 rillig Exp $
 #
 # This Makefile fragment handles Haskell Cabal packages.
-# See: http://www.haskell.org/cabal/
-#
-# Note to users:
-#
-#   * Users choose one favourite Haskell compiler. Though the only
-#     compiler currently supported is GHC.
-#
-#   * You can't install a cabal package for more than one compilers
-#     simultaneously. In the future, this limitation can possibly be
-#     eliminated using the method used by
-#     "../../lang/python/pyversion.mk".
-#
-# Note to package developers:
-#
-#   * This file must be included *before* "../../mk/bsd.pkg.mk", or
-#     you'll get target-redefinition errors.
-#
-#   * 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.
-#
-#   * Package configuration, building, installation, registration and
-#     unregistration are fully automated. You usually don't need to do
-#     anything special.
-#
-#   * When Haskell libraries depend on other Haskell libraries, they
-#     MUST depend on, not build-depend on, such libraries. So if your
-#     package installs a library, you MUST NOT set
-#     BUILDLINK_DEPMETHOD.${PKG} to "build" in your buildlink3.mk
-#     file. Reason:
-#         1. Assume we have two libraries A and B, and B build-depends
-#            on A.
-#         2. We install package A.
-#         3. We then install package B, which build-depends on A.
-#         4. After that, a new upstream version of package A is
-#            released. We therefore update package A to the new version.
-#         5. Package B had a build-dependency on A, so pkgsrc assumes
-#            that it's still safe to use package B without
-#            recompilation of B. But in fact package B requires the
-#            very version of package A which was available when
-#            package B was compiled. So the installed package B is
-#            completely broken at this time.
+# Package configuration, building, installation, registration and
+# unregistration are fully automated.
+# See https://www.haskell.org/cabal/.
 #
 # Package-settable variables:
 #
-#   HASKELL_OPTIMIZATION_LEVEL
-#       Description:
-#           Optimization level for compilation.
-#       Possible values:
-#           0 1 2
-#       Default value:
-#           2
+# PKGNAME
+#      Defaults to hs-${DISTNAME}.
+#
+# HOMEPAGE
+# MASTER_SITES
+#      Default to HackageDB URLs.
+#
+# HASKELL_OPTIMIZATION_LEVEL
+#      Optimization level for compilation.
+#
+#      Possible values: 0 1 2
+#       Default value: 2
 #
 # User-settable variables:
 #
-#   HASKELL_COMPILER
-#       Description:
-#           The user's favourite Haskell compiler.
-#       Possible values:
-#           ghc
-#       Default value:
-#           ghc
+# HASKELL_ENABLE_SHARED_LIBRARY
+#      Whether shared library should be built or not.
 #
-#   HASKELL_ENABLE_SHARED_LIBRARY
-#       Description:
-#           Whether shared library should be built or not.
-#       Possible values:
-#           yes, no
-#       Default value:
-#           yes
+#      Possible values: yes, no
+#       Default value: yes
+#
+# HASKELL_ENABLE_LIBRARY_PROFILING
+#      Whether profiling library should be built or not.
 #
-#   HASKELL_ENABLE_LIBRARY_PROFILING
-#       Description:
-#           Whether profiling library should be built or not.
-#       Possible values:
-#           yes, no
-#       Default value:
-#           yes
+#      Possible values: yes, no
+#       Default value: yes
 #
-#   HASKELL_ENABLE_HADDOCK_DOCUMENTATION
-#       Description:
-#           Whether haddock documentation should be built or not.
-#       Possible values:
-#           yes, no
-#       Default value:
-#           yes
+# HASKELL_ENABLE_HADDOCK_DOCUMENTATION
+#      Whether haddock documentation should be built or not.
+#
+#      Possible values: yes, no
+#       Default value: yes
 
 .if !defined(HASKELL_MK)
 HASKELL_MK=    # defined
@@ -97,14 +47,10 @@
 
 HS_UPDATE_PLIST?=      no
 
-# Declare HASKELL_COMPILER as one of BUILD_DEFS variables. See
-# ../../mk/misc/show.mk
-BUILD_DEFS+=   HASKELL_COMPILER
 BUILD_DEFS+=   HASKELL_ENABLE_SHARED_LIBRARY
 BUILD_DEFS+=   HASKELL_ENABLE_LIBRARY_PROFILING
 BUILD_DEFS+=   HASKELL_ENABLE_HADDOCK_DOCUMENTATION
 
-
 # Declarations for ../../mk/misc/show.mk
 _VARGROUPS+=   haskell
 _USER_VARS.haskell= \
@@ -117,13 +63,7 @@
 _DEF_VARS.haskell= \
        HASKELL_OPTIMIZATION_LEVEL \
        HASKELL_PKG_NAME \
-       _DISTBASE \
-       _DISTVERSION \
-       _GHC_BIN \
-       _GHC_PKG_BIN \
-       _GHC_VERSION \
-       _GHC_VERSION_CMD \
-       _GHC_VERSION_FULL \
+       _HASKELL_VERSION_CMD \
        _HASKELL_BIN \
        _HASKELL_PKG_BIN \
        _HASKELL_PKG_DESCR_FILE \
@@ -132,16 +72,9 @@
 _IGN_VARS.haskell= \
        USE_TOOLS _*
 
-# PKGNAME is usually named after DISTNAME.
 PKGNAME?=      hs-${DISTNAME}
-
-# Default value of MASTER_SITES.
-_DISTBASE?=    ${DISTNAME:C/-[^-]*$//}
-_DISTVERSION?= ${DISTNAME:C/^.*-//}
 MASTER_SITES?= ${MASTER_SITE_HASKELL_HACKAGE:=${DISTNAME}/}
-
-# Default value of HOMEPAGE.
-HOMEPAGE?=     http://hackage.haskell.org/package/${_DISTBASE}
+HOMEPAGE?=     http://hackage.haskell.org/package/${DISTNAME:C/-[^-]*$//}
 
 # Cabal packages may use pkg-config, but url2pkg can't detect
 # that. (PHO: I think that should be handled by url2pkg (2009-05-20))
@@ -150,71 +83,49 @@
 # GHC can be a memory hog, so don't apply regular limits.
 UNLIMIT_RESOURCES+=    datasize virtualsize
 
-# Default value of HASKELL_OPTIMIZATION_LEVEL
 HASKELL_OPTIMIZATION_LEVEL?=           2
-
-# Default value of HASKELL_ENABLE_SHARED_LIBRARY
 HASKELL_ENABLE_SHARED_LIBRARY?=                yes
-
-# Default value of HASKELL_ENABLE_LIBRARY_PROFILING
 HASKELL_ENABLE_LIBRARY_PROFILING?=     yes
-
-# Default value of HASKELL_ENABLE_HADDOCK_DOCUMENTATION
 HASKELL_ENABLE_HADDOCK_DOCUMENTATION?= yes
 
-# Compiler specific variables and targets.
-.if ${HASKELL_COMPILER} == "ghc"
-
-# Add dependency on GHC.
 .include "../../lang/ghc88/buildlink3.mk"
 
 # Tools
-_GHC_BIN=              ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc
-_GHC_PKG_BIN=          ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc-pkg
-_HASKELL_BIN=          ${_GHC_BIN} # Expose to the outer scope.
-_HASKELL_PKG_BIN=      ${_GHC_PKG_BIN} # Expose to the outer scope.
+_HASKELL_BIN=          ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc
+_HASKELL_PKG_BIN=      ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc-pkg
 
-# Determine GHC version.
-_GHC_VERSION_CMD=      ${_GHC_BIN} -V 2>/dev/null | ${CUT} -d ' ' -f 8
-_GHC_VERSION=          ${_GHC_VERSION_CMD:sh}
-_GHC_VERSION_FULL=     ghc-${_GHC_VERSION}
-_HASKELL_VERSION=      ${_GHC_VERSION_FULL} # Expose to the outer scope.
+_HASKELL_VERSION_CMD=  ${_HASKELL_BIN} -V 2>/dev/null | ${CUT} -d ' ' -f 8
+_HASKELL_VERSION=      ghc-${_HASKELL_VERSION_CMD:sh}
 
 # Determine GHC shlib suffix
-_GHC_SHLIB_SUFFIX.dylib=       dylib
-_GHC_SHLIB_SUFFIX=             ${_GHC_SHLIB_SUFFIX.${SHLIB_TYPE}:Uso}
-_HASKELL_SHLIB_SUFFIX=         ${_GHC_SHLIB_SUFFIX}
+_HASKELL_SHLIB_SUFFIX.dylib=   dylib
+_HASKELL_SHLIB_SUFFIX=         ${_HASKELL_SHLIB_SUFFIX.${SHLIB_TYPE}:Uso}
 
 # GHC requires C compiler.
 USE_LANGUAGES+=        c
 
 # Declarations for ../../mk/configure/configure.mk
 CONFIGURE_ARGS+=       --ghc
-CONFIGURE_ARGS+=       --with-compiler=${_GHC_BIN:Q}
-CONFIGURE_ARGS+=       --with-hc-pkg=${_GHC_PKG_BIN:Q}
+CONFIGURE_ARGS+=       --with-compiler=${_HASKELL_BIN:Q}
+CONFIGURE_ARGS+=       --with-hc-pkg=${_HASKELL_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
 .else
 CONFIGURE_ARGS+=       --disable-shared --disable-executable-dynamic
 .endif
 
-# Library profiling
 .if ${HASKELL_ENABLE_LIBRARY_PROFILING} == "yes"
 CONFIGURE_ARGS+=       --enable-library-profiling
 .else
 CONFIGURE_ARGS+=       --disable-library-profiling
 .endif
 
-# Haddock documentations
 .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes"
 CONFIGURE_ARGS+=       --with-haddock=${BUILDLINK_PREFIX.ghc:Q}/bin/haddock
 .endif
 
-# Optimization
 CONFIGURE_ARGS+=       -O${HASKELL_OPTIMIZATION_LEVEL}
 
 .if !exists(${PKGDIR}/PLIST)



Home | Main Index | Thread Index | Old Index