Commit graph

36 commits

Author SHA1 Message Date
nia
7fad5b5799 Disable MKPIE in Haskell.
Presumably there's a way to make this work, but it probably requires
changes to the bootstrap kits.
2021-09-27 14:30:47 +00:00
pho
3c537cb057 Support PKGSRC_USE_RELRO 2021-05-04 15:44:33 +00:00
pho
453fae4479 Switch the default compiler to lang/ghc90 2021-05-02 13:39:25 +00:00
pho
443566c5fb Use tools framework for Haskell source preprocessors 2021-05-01 16:14:19 +00:00
pho
5fba640853 Move lengthy awk and shell scripts out of haskell.mk 2021-05-01 15:06:26 +00:00
pho
56b10e6f5c Fix a bug in my previous commit 2021-05-01 14:24:21 +00:00
pho
aaed0e0c91 Support Cabal packages that lack Setup.?hs
They currently have Setup.hs in ${FILESDIR} with almost always the same
content. We can do better than that.
2021-05-01 14:10:55 +00:00
pho
187301d3fc Rework the PLIST handling to support executable-only packages
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.
2021-04-23 03:57:16 +00:00
pho
f369c8d13b mk/haskell.mk: Ignore per-user package environment file while building 'Setup'
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.
2021-03-14 08:19:24 +00:00
rillig
7c3702e7d7 mk/haskell.mk: clean up _VARGROUPS section and unused variables 2020-07-01 15:07:25 +00:00
rillig
207c2f13df 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.
2020-07-01 14:58:43 +00:00
rillig
ab8c506b0b mk/haskell.mk: regenerate PLIST if it is outdated
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.
2020-06-29 22:00:58 +00:00
rillig
c8f6fed1ea mk/haskell.mk: fix PLIST status detection
As seen in devel/hs-hashable/PLIST r1.1, which listed only the
package-description but not the package-id.
2020-06-29 20:51:24 +00:00
rillig
a5039d7c3c 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.
2020-06-29 20:30:13 +00:00
rillig
aeff688767 mk/haskell.mk: fix PLIST status detection
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.
2020-06-29 18:07:45 +00:00
rillig
c842ae6257 mk/haskell.mk: fix PLIST generation for Haskell packages
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.
2020-06-21 22:21:02 +00:00
rillig
3c7198b683 mk/haskell.mk: allow to generate PLIST files
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.
2020-05-10 17:46:59 +00:00
riastradh
ea504032f9 Missed a spot -- set MAKE_ENV during haddock build too. 2020-03-30 18:23:48 +00:00
riastradh
270c7f3e7b In Haskell packages, set MAKE_ENV while running ./Setup build. 2020-03-30 17:51:07 +00:00
riastradh
4c01312406 New package variable HASKELL_PKG_NAME.
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.
2020-03-30 16:51:53 +00:00
joerg
a1e7953bb0 Don't use normal memory size limits with GHC for module builds. 2020-03-24 20:43:17 +00:00
pho
865567336f Build ${WRKSRC}/Setup in the do-configure phase
Doing it in pre-configure makes it unable to do SUBST in that phase.
2020-01-20 14:14:33 +00:00
pho
a1f59741bc Use _MAKE_JOBS_N defined in build/build.mk 2020-01-19 23:45:06 +00:00
pho
9bbb8420be Configurable optimization level and compilation parallelism 2020-01-18 01:39:01 +00:00
pho
024aad2263 Switch from ghc7 to ghc88 2020-01-11 07:47:18 +00:00
pho
ee9f90656c Use hashed package keys for (un)installing Cabal packages
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.
2020-01-09 12:29:32 +00:00
pho
0215d2d16a Be explicit about shared libraries
Recent versions of Cabal appears to build shared libraries by default unless --disable-shared is explicitly given.
2020-01-02 16:45:15 +00:00
pho
f20c406612 Pass -v to ./Setup when PKG_VERBOSE is defined 2020-01-02 16:34:47 +00:00
pho
d3ea0027a2 Suppress an error occurs when buildlink is not present 2020-01-01 04:54:10 +00:00
pho
e8f85a7b71 Remove unused variables 2020-01-01 04:35:29 +00:00
pho
1589ba417e For "Setup" try dynamic linkage first 2019-12-31 07:16:25 +00:00
pho
a62b984936 Support GHC 7.10.x and later 2019-12-29 16:59:55 +00:00
joerg
639d5b402f Remove support for USE_DESTDIR=no. 2016-04-10 15:58:02 +00:00
joerg
d686fdbc97 rpath flag and directory are one option, don't pass the path without
-Wl prefix.
2015-02-17 13:57:47 +00:00
obache
1c90fa81ef Some improvements and changes for Haskell Cabal support.
* 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@.
2014-04-18 13:42:59 +00:00
obache
d761adbc39 add Haskell Cabal support files. 2014-02-05 07:02:30 +00:00