It was a long-standing issue that Haskell packages which didn't contain a
library could not be correctly handled.
There are fewer substitutions in PLIST_SUBST now. As a result existing
PLIST files will all be considered as outdated and should be updated
either by setting HS_UPDATE_PLIST=yes or by manually running print-PLIST.
They will be ignored until that.
Turned out this was necessary when using `cabal-install v2-install` outside of pkgsrc, because the command creates a per-user package environment and in turn makes Cabal hidden.
There was only a single valid value for HASKELL_COMPILER, therefore the
variable was useless. It only made the implementation more complicated
than necessary.
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.
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.
Before, running "HS_UPDATE_PLIST=yes bmake update" in wm/xmonad did not
apply the proper substitutions to the generated PLIST file since the
PLIST file was created empty during the GENERATE_PLIST command, and that
empty PLIST file changed the status to "plain" instead of "missing".
Because of that, the HS_INTF and related placeholders were not defined.
The 2 conditions for the status "missing" had to be written in separate
.if clauses because of a bug in bmake that was introduced in 2015 and
will be fixed with the next bmake update. For further details, see
src/usr.bin/make/unit-tests/cond-short.mk.
The package textproc/hs-cgrep does not install a Haskell library. This
was unexpected to mk/haskell.mk, which generated an obviously wrong PLIST
file for that package, and for 3 other packages.
Noticed by wiz.
Since GHC 7.10 or 7.8, the Haskell packages are installed in directories
whose name contains the package hash. This made it harder to predict the
exact pathname. Havin the exact pathnames in the PLIST file is the
ideal, it also helps to record the general structure of the installed
files to see whether some file unexpectedly appear or disappear.
To enable this for Haskell packages, the various base directories are
replaced with placeholders during print-PLIST. These placeholders are
translated back to their respective paths when the +PLIST is generated
from the PLIST in the package directory.
Except for 2 packages, all Haskell packages in main pkgsrc had their
package PLIST file removed. To help in adding them back, the pkgsrc
developer can set HS_UPDATE_PLIST=yes in mk.conf, which will generate the
PLIST directly into ${PKGDIR}/PLIST upon installation.
Most packages in pkgsrc-wip still have their old PLIST, and these are
migrated automatically as well.
Used to form _HASKELL_PKG_DESCR_DIR. Defaults to DISTNAME, but for
some packages (hledger, incoming), the same DISTNAME is shared by
multiple packages. So let the package define it explicitly if need
be.
Starting from somewhere around GHC 7.8, Cabal installs packages with a
hashed package key instead of just "{NAME}-{VERSION}". In other words,
the pair of the plain package name and the version is no longer unique
in the package DB, and using it for uninstallation may also remove
packages that we didn't mean to remove.
This is paricularly problematic because GHC comes with several bundled
Cabal packages. Installing and uninstalling a package with the same
name could break GHC itself, if the uninstallation is performed
without hashed keys.
* HASKELL_ENABLE_LIBRARY_PROFILING and HASKELL_ENABLE_HADDOCK_DOCUMENTATION
are "User-settable variables", not "Package-settable variables".
* Change to HASKELL_ENABLE_HADDOCK_DOCUMENTATION=yes by default.
* Add HASKELL_ENABLE_SHARED_LIBRARY("yes" by default), to enable shlib support.
* Add support for dynamically conditional PLIST entries handling for
HASKELL_ENABLE_SHARED_LIBRARY and HASKELL_ENABLE_LIBRARY_PROFILING.
discussed with pho@ and szptvlfn@.