1 { lib, haskellPackages, haskell, removeReferencesTo
2 # “Plugins” are a fancy way of saying gitit will invoke
3 # GHC at *runtime*, which in turn makes it pull GHC
4 # into its runtime closure. Only enable if you really need
5 # that feature. But if you do you’ll want to use gitit
7 , pluginSupport ? false
10 # this is similar to what we do with the pandoc executable
13 plain = haskellPackages.gitit;
17 else haskell.lib.compose.disableCabalFlag "plugins" plain;
18 static = haskell.lib.compose.justStaticExecutables plugins;
21 (haskell.lib.compose.overrideCabal (drv: {
22 buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ];
23 }) static).overrideAttrs (drv: {
25 # These libraries are still referenced, because they generate
26 # a `Paths_*` module for figuring out their version.
27 # The `Paths_*` module is generated by Cabal, and contains the
28 # version, but also paths to e.g. the data directories, which
29 # lead to a transitive runtime dependency on the whole GHC distribution.
30 # This should ideally be fixed in haskellPackages (or even Cabal),
31 # but a minimal gitit is important enough to patch it manually.
32 disallowedReferences = [
33 haskellPackages.pandoc-types
35 haskellPackages.pandoc
36 haskellPackages.happstack-server
37 haskellPackages.filestore
40 remove-references-to \
41 -t ${haskellPackages.pandoc-types} \
43 remove-references-to \
44 -t ${haskellPackages.HTTP} \
46 remove-references-to \
47 -t ${haskellPackages.pandoc} \
49 remove-references-to \
50 -t ${haskellPackages.happstack-server} \
52 remove-references-to \
53 -t ${haskellPackages.filestore} \
58 maintainers = drv.meta.maintainers or []
59 ++ [ lib.maintainers.Profpatsch ];