Merge pull request #102383 from NixOS/haskell-updates
Update Haskell package set (plus other fixes)
This commit is contained in:
commit
6b47c89f66
6 changed files with 1980 additions and 547 deletions
|
@ -1,6 +1,6 @@
|
|||
{ fetchurl }:
|
||||
|
||||
fetchurl {
|
||||
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/197a82b352062bfeeefd4b62bfec19dd51a3728d.tar.gz";
|
||||
sha256 = "11c9a67j421vf6a7vvh280gsmssf49rxqnamdp1n9iljkhlfh5z1";
|
||||
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/59ba02b3424684458764210fa9e32ca08e516db2.tar.gz";
|
||||
sha256 = "0m4scz6b7xg7kisy6zlnw258pkfksmzzppw9gp0g6rdl0cxly239";
|
||||
}
|
||||
|
|
|
@ -104,4 +104,6 @@ in stdenv.mkDerivation {
|
|||
|
||||
meta.platforms = passthru.bootPkgs.ghc.meta.platforms;
|
||||
meta.maintainers = [lib.maintainers.elvishjerricco];
|
||||
meta.hydraPlatforms = [];
|
||||
meta.broken = true; # https://hydra.nixos.org/build/129701778
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ self: super: {
|
|||
name = "git-annex-${super.git-annex.version}-src";
|
||||
url = "git://git-annex.branchable.com/";
|
||||
rev = "refs/tags/" + super.git-annex.version;
|
||||
sha256 = "05yvl09ksyvzykibs95996rni9x6w03yfqyv2fadd73z1m6lq5bf";
|
||||
sha256 = "1g5ba1lv0v4zjk5ghdp78wxgszspfda1lrl734fi7hyavqrfjxkz";
|
||||
};
|
||||
}).override {
|
||||
dbus = if pkgs.stdenv.isLinux then self.dbus else null;
|
||||
|
@ -922,8 +922,9 @@ self: super: {
|
|||
# This package refers to the wrong library (itself in fact!)
|
||||
vulkan = super.vulkan.override { vulkan = pkgs.vulkan-loader; };
|
||||
|
||||
# Compiles some C++ source which requires these headers
|
||||
# Compiles some C or C++ source which requires these headers
|
||||
VulkanMemoryAllocator = addExtraLibrary super.VulkanMemoryAllocator pkgs.vulkan-headers;
|
||||
vulkan-utils = addExtraLibrary super.vulkan-utils pkgs.vulkan-headers;
|
||||
|
||||
# https://github.com/dmwit/encoding/pull/3
|
||||
encoding = doJailbreak (appendPatch super.encoding ./patches/encoding-Cabal-2.0.patch);
|
||||
|
@ -1172,9 +1173,6 @@ self: super: {
|
|||
# 2020-06-22: NOTE: > 0.4.0 => rm Jailbreak: https://github.com/serokell/nixfmt/issues/71
|
||||
nixfmt = doJailbreak super.nixfmt;
|
||||
|
||||
# 2020-06-22: NOTE: QuickCheck upstreamed https://github.com/phadej/binary-instances/issues/7
|
||||
binary-instances = dontCheck super.binary-instances;
|
||||
|
||||
# The test suite depends on an impure cabal-install installation in
|
||||
# $HOME, which we don't have in our build sandbox.
|
||||
cabal-install-parsers = dontCheck super.cabal-install-parsers;
|
||||
|
@ -1254,41 +1252,8 @@ self: super: {
|
|||
x509-validation = dontCheck super.x509-validation;
|
||||
tls = dontCheck super.tls;
|
||||
|
||||
patch = appendPatches super.patch [
|
||||
# Upstream PR: https://github.com/reflex-frp/patch/pull/20
|
||||
# Makes tests work with hlint 3
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/reflex-frp/patch/commit/3ed23a4e4049ee17e64a1a5bbebf1990cdbe033a.patch";
|
||||
sha256 ="1hfa980wln8kzbqw1lr8ddszgcibw25xf12ki2jb9xkl464aynzf";
|
||||
})
|
||||
# Upstream PR: https://github.com/reflex-frp/patch/pull/17
|
||||
# Bumps version dependencies
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/reflex-frp/patch/commit/a191ed9ded708ed7ff0cf53ad6dafaf54db5b95a.patch";
|
||||
sha256 ="1x9w5fimhk3a0l2aa5z91nqaa6s2irz1775iidd0191m6w25vszp";
|
||||
})
|
||||
];
|
||||
|
||||
reflex = appendPatches super.reflex [
|
||||
# Upstream PR: https://github.com/reflex-frp/reflex/pull/434
|
||||
# Bump version bounds
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/reflex-frp/reflex/commit/e6104bdfd7f664f524b6765275490722e376df4d.patch";
|
||||
sha256 ="1awp5p4640cnhfd50dplsvp0kzy6h8r0hpbw1s40blni74r3dhzr";
|
||||
})
|
||||
# Upstream PR: https://github.com/reflex-frp/reflex/pull/436
|
||||
# Fix build with newest dependent-map version
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/reflex-frp/reflex/commit/dc3bf44d822d70594e3c474fe3869261776c3554.patch";
|
||||
sha256 ="0rbjfj9b8p6zkvd5j4pak5kpgard6cyfvzk750s4xwpc1v84iiqd";
|
||||
})
|
||||
# Upstream PR: https://github.com/reflex-frp/reflex/pull/437
|
||||
# Fix tests with newer dep versions
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/reflex-frp/reflex/commit/87c74a1b9d9098eae8a56148c59ed4963a5232c2.patch";
|
||||
sha256 ="0qhjjgd6n4fms1hpbblny78c95bfh74izhx9dvrdlnhz6q7xlm9q";
|
||||
})
|
||||
];
|
||||
# Allow building with recent versions of hlint.
|
||||
patch = doJailbreak super.patch;
|
||||
|
||||
# Tests disabled and broken override needed because of missing lib chrome-test-utils: https://github.com/reflex-frp/reflex-dom/issues/392
|
||||
# Tests disabled because of very old dep: https://github.com/reflex-frp/reflex-dom/issues/393
|
||||
|
@ -1351,7 +1316,7 @@ self: super: {
|
|||
# 2020-08-14: gi-pango from stackage is to old for the C libs it links against in nixpkgs.
|
||||
# That's why we need to bump a ton of dependency versions to unbreak them.
|
||||
gi-pango = assert super.gi-pango.version == "1.0.22"; self.gi-pango_1_0_23;
|
||||
haskell-gi-base = assert super.haskell-gi-base.version == "0.23.0"; addBuildDepends (self.haskell-gi-base_0_24_3) [ pkgs.gobject-introspection ];
|
||||
haskell-gi-base = assert super.haskell-gi-base.version == "0.23.0"; addBuildDepends (self.haskell-gi-base_0_24_4) [ pkgs.gobject-introspection ];
|
||||
haskell-gi = assert super.haskell-gi.version == "0.23.1"; self.haskell-gi_0_24_5;
|
||||
gi-cairo = assert super.gi-cairo.version == "1.0.23"; self.gi-cairo_1_0_24;
|
||||
gi-glib = assert super.gi-glib.version == "2.0.23"; self.gi-glib_2_0_24;
|
||||
|
@ -1381,13 +1346,6 @@ self: super: {
|
|||
sha256 = "1c5ck2ibag2gcyag6rjivmlwdlp5k0dmr8nhk7wlkzq2vh7zgw63";
|
||||
});
|
||||
|
||||
# Version bumps have not been merged by upstream yet.
|
||||
# https://github.com/obsidiansystems/dependent-sum-aeson-orphans/pull/5
|
||||
dependent-sum-aeson-orphans = appendPatch super.dependent-sum-aeson-orphans (pkgs.fetchpatch {
|
||||
url = "https://github.com/obsidiansystems/dependent-sum-aeson-orphans/commit/5a369e433ad7e3eef54c7c3725d34270f6aa48cc.patch";
|
||||
sha256 = "1lzrcicvdg77hd8j2fg37z19amp5yna5xmw1fc06zi0j95csll4r";
|
||||
});
|
||||
|
||||
# Tests are broken because of missing files in hackage tarball.
|
||||
# https://github.com/jgm/commonmark-hs/issues/55
|
||||
commonmark-extensions = dontCheck super.commonmark-extensions;
|
||||
|
@ -1467,7 +1425,7 @@ self: super: {
|
|||
skylighting-core = doDistribute super.skylighting-core_0_10_0_3;
|
||||
hslua = doDistribute self.hslua_1_1_2;
|
||||
jira-wiki-markup = doDistribute self.jira-wiki-markup_1_3_2;
|
||||
pandoc = doDistribute self.pandoc_2_11_0_4;
|
||||
pandoc = doDistribute self.pandoc_2_11_1;
|
||||
# jailbreaking pandoc-citeproc because it has not bumped upper bound on pandoc
|
||||
pandoc-citeproc = doJailbreak (doDistribute self.pandoc-citeproc_0_17_0_2);
|
||||
pandoc-types = doDistribute self.pandoc-types_1_22;
|
||||
|
@ -1475,7 +1433,6 @@ self: super: {
|
|||
|
||||
# The test suite attempts to read `/etc/resolv.conf`, which doesn't work in the sandbox.
|
||||
domain-auth = dontCheck super.domain-auth;
|
||||
# INSERT NEW OVERRIDES ABOVE THIS LINE
|
||||
|
||||
# stack-2.5.1 needs a more current version of pantry to compile
|
||||
pantry = self.pantry_0_5_1_3;
|
||||
|
@ -1483,7 +1440,9 @@ self: super: {
|
|||
# Too tight version bounds, see https://github.com/haskell-hvr/microaeson/pull/4
|
||||
microaeson = doJailbreak super.microaeson;
|
||||
|
||||
# haskell-language-server needs a more current version of pantry to compile
|
||||
autoapply = super.autoapply.override { th-desugar = self.th-desugar_1_11; };
|
||||
|
||||
# INSERT NEW OVERRIDES ABOVE THIS LINE
|
||||
} // (let
|
||||
inherit (self) hls-ghcide hls-brittany;
|
||||
hlsScopeOverride = self: super: {
|
||||
|
|
|
@ -2738,6 +2738,8 @@ unsupported-platforms:
|
|||
sdl2-mixer: [ x86_64-darwin ]
|
||||
sdl2-ttf: [ x86_64-darwin ]
|
||||
tokyotyrant-haskell: [ x86_64-darwin ]
|
||||
vulkan: [ i686-linux, armv7l-linux ]
|
||||
VulkanMemoryAllocator: [ i686-linux, armv7l-linux ]
|
||||
Win32-console: [ i686-linux, x86_64-linux, x86_64-darwin ]
|
||||
Win32-dhcp-server: [ i686-linux, x86_64-linux, x86_64-darwin ]
|
||||
Win32-errors: [ i686-linux, x86_64-linux, x86_64-darwin ]
|
||||
|
@ -2892,6 +2894,7 @@ broken-packages:
|
|||
- accentuateus
|
||||
- access-time
|
||||
- access-token-provider
|
||||
- achille
|
||||
- acid-state-dist
|
||||
- acid-state-tls
|
||||
- ACME
|
||||
|
@ -3121,6 +3124,8 @@ broken-packages:
|
|||
- armor
|
||||
- arpa
|
||||
- arpack
|
||||
- array-builder
|
||||
- array-chunks
|
||||
- array-forth
|
||||
- array-list
|
||||
- array-primops
|
||||
|
@ -3205,7 +3210,6 @@ broken-packages:
|
|||
- authenticate-ldap
|
||||
- authinfo-hs
|
||||
- authoring
|
||||
- autoapply
|
||||
- AutoForms
|
||||
- autom
|
||||
- automata
|
||||
|
@ -3456,6 +3460,7 @@ broken-packages:
|
|||
- bitcoin-hs
|
||||
- bitcoin-rpc
|
||||
- bitcoin-script
|
||||
- bitcoin-scripting
|
||||
- bitcoin-tx
|
||||
- bitcoind-regtest
|
||||
- bitcoind-rpc
|
||||
|
@ -3601,7 +3606,11 @@ broken-packages:
|
|||
- byline
|
||||
- bytable
|
||||
- bytearray-parsing
|
||||
- bytebuild
|
||||
- bytehash
|
||||
- bytelog
|
||||
- byteslice
|
||||
- bytesmith
|
||||
- bytestring-arbitrary
|
||||
- bytestring-builder-varword
|
||||
- bytestring-class
|
||||
|
@ -3995,6 +4004,7 @@ broken-packages:
|
|||
- compdata-dags
|
||||
- compdata-param
|
||||
- compdoc
|
||||
- compdoc-dhall-decoder
|
||||
- competition
|
||||
- compilation
|
||||
- complexity
|
||||
|
@ -4101,7 +4111,9 @@ broken-packages:
|
|||
- context-free-grammar
|
||||
- context-stack
|
||||
- ContextAlgebra
|
||||
- contiguous
|
||||
- contiguous-checked
|
||||
- contiguous-fft
|
||||
- continue
|
||||
- continuum
|
||||
- continuum-client
|
||||
|
@ -4535,6 +4547,7 @@ broken-packages:
|
|||
- discord-gateway
|
||||
- discord-haskell
|
||||
- discord-hs
|
||||
- discord-register
|
||||
- discord-rest
|
||||
- discord-types
|
||||
- discordian-calendar
|
||||
|
@ -4600,6 +4613,9 @@ broken-packages:
|
|||
- doi
|
||||
- DOM
|
||||
- dom-lt
|
||||
- domain
|
||||
- domain-core
|
||||
- domain-optics
|
||||
- domplate
|
||||
- dot-linker
|
||||
- dotfs
|
||||
|
@ -4799,6 +4815,7 @@ broken-packages:
|
|||
- eros
|
||||
- eros-client
|
||||
- eros-http
|
||||
- error-codes
|
||||
- error-context
|
||||
- error-continuations
|
||||
- error-list
|
||||
|
@ -4856,7 +4873,6 @@ broken-packages:
|
|||
- every-bit-counts
|
||||
- ewe
|
||||
- exact-cover
|
||||
- exact-real
|
||||
- exact-real-positional
|
||||
- except-exceptions
|
||||
- exception-monads-fd
|
||||
|
@ -5262,6 +5278,8 @@ broken-packages:
|
|||
- garepinoh
|
||||
- gargoyle
|
||||
- gargoyle-postgresql
|
||||
- gargoyle-postgresql-connect
|
||||
- gargoyle-postgresql-nix
|
||||
- gas
|
||||
- gbu
|
||||
- gc-monitoring-wai
|
||||
|
@ -5415,7 +5433,6 @@ broken-packages:
|
|||
- git-fmt
|
||||
- git-gpush
|
||||
- git-jump
|
||||
- git-mediate
|
||||
- git-monitor
|
||||
- git-object
|
||||
- git-remote-ipfs
|
||||
|
@ -5518,6 +5535,7 @@ broken-packages:
|
|||
- GoogleSB
|
||||
- GoogleTranslate
|
||||
- gopherbot
|
||||
- gopro-plus
|
||||
- gore-and-ash
|
||||
- gore-and-ash-actor
|
||||
- gore-and-ash-async
|
||||
|
@ -6158,6 +6176,7 @@ broken-packages:
|
|||
- hevolisa
|
||||
- hevolisa-dph
|
||||
- hex
|
||||
- hex-text
|
||||
- HExcel
|
||||
- hexchat
|
||||
- hexif
|
||||
|
@ -6928,6 +6947,7 @@ broken-packages:
|
|||
- iostring
|
||||
- iothread
|
||||
- iotransaction
|
||||
- ip
|
||||
- ip2location
|
||||
- ip2proxy
|
||||
- ipatch
|
||||
|
@ -7589,6 +7609,7 @@ broken-packages:
|
|||
- lxd-client
|
||||
- lye
|
||||
- Lykah
|
||||
- lz4-bytes
|
||||
- lz4-conduit
|
||||
- lz4-frame-conduit
|
||||
- lzma-enumerator
|
||||
|
@ -7611,6 +7632,7 @@ broken-packages:
|
|||
- maclight
|
||||
- macos-corelibs
|
||||
- macosx-make-standalone
|
||||
- macrm
|
||||
- madlang
|
||||
- mage
|
||||
- magic-tyfams
|
||||
|
@ -7826,6 +7848,7 @@ broken-packages:
|
|||
- mltool
|
||||
- mm2
|
||||
- mmsyn4
|
||||
- mmsyn7h
|
||||
- mmtf
|
||||
- mmtl
|
||||
- mmtl-base
|
||||
|
@ -7928,8 +7951,10 @@ broken-packages:
|
|||
- morfette
|
||||
- morfeusz
|
||||
- morley
|
||||
- morloc
|
||||
- morpheus-graphql-cli
|
||||
- morpheus-graphql-client
|
||||
- morpheus-graphql-subscriptions
|
||||
- morphisms-functors
|
||||
- morphisms-functors-inventory
|
||||
- morphisms-objects
|
||||
|
@ -8380,7 +8405,6 @@ broken-packages:
|
|||
- optparse-applicative-simple
|
||||
- optparse-enum
|
||||
- optparse-helper
|
||||
- orbits
|
||||
- orc
|
||||
- orchestrate
|
||||
- OrchestrateDB
|
||||
|
@ -8733,6 +8757,7 @@ broken-packages:
|
|||
- pointless-haskell
|
||||
- pointless-lenses
|
||||
- pointless-rewrite
|
||||
- poke
|
||||
- pokemon-go-protobuf-types
|
||||
- poker-eval
|
||||
- pokitdok
|
||||
|
@ -8751,6 +8776,7 @@ broken-packages:
|
|||
- polysemy-kvstore-jsonfile
|
||||
- polysemy-methodology
|
||||
- polysemy-optics
|
||||
- polysemy-path
|
||||
- polysemy-RandomFu
|
||||
- polysemy-resume
|
||||
- polysemy-test
|
||||
|
@ -8781,6 +8807,7 @@ broken-packages:
|
|||
- poseidon
|
||||
- poseidon-postgis
|
||||
- posix-acl
|
||||
- posix-api
|
||||
- posix-realtime
|
||||
- posix-waitpid
|
||||
- posplyu
|
||||
|
@ -8859,10 +8886,15 @@ broken-packages:
|
|||
- primal
|
||||
- primal-memory
|
||||
- primes-type
|
||||
- primitive-atomic
|
||||
- primitive-containers
|
||||
- primitive-extras
|
||||
- primitive-indexed
|
||||
- primitive-maybe
|
||||
- primitive-simd
|
||||
- primitive-sort
|
||||
- primitive-stablename
|
||||
- primitive-unlifted
|
||||
- PrimitiveArray-Pretty
|
||||
- primula-board
|
||||
- primula-bot
|
||||
|
@ -9188,6 +9220,7 @@ broken-packages:
|
|||
- reflex-dom-svg
|
||||
- reflex-dynamic-containers
|
||||
- reflex-fsnotify
|
||||
- reflex-gadt-api
|
||||
- reflex-ghci
|
||||
- reflex-gloss
|
||||
- reflex-gloss-scene
|
||||
|
@ -9416,6 +9449,7 @@ broken-packages:
|
|||
- ruin
|
||||
- ruler
|
||||
- ruler-core
|
||||
- run-st
|
||||
- rungekutta
|
||||
- runhs
|
||||
- runmany
|
||||
|
@ -9857,6 +9891,7 @@ broken-packages:
|
|||
- sme
|
||||
- smerdyakov
|
||||
- smiles
|
||||
- smith
|
||||
- smith-cli
|
||||
- smith-client
|
||||
- Smooth
|
||||
|
@ -10121,6 +10156,7 @@ broken-packages:
|
|||
- stm-chunked-queues
|
||||
- stm-containers
|
||||
- stm-firehose
|
||||
- stm-hamt
|
||||
- stm-promise
|
||||
- stm-stats
|
||||
- stm-supply
|
||||
|
@ -10331,6 +10367,7 @@ broken-packages:
|
|||
- tart
|
||||
- task
|
||||
- task-distribution
|
||||
- taskell
|
||||
- TaskMonad
|
||||
- tasty-auto
|
||||
- tasty-bdd
|
||||
|
@ -10458,6 +10495,7 @@ broken-packages:
|
|||
- th-instances
|
||||
- th-kinds
|
||||
- th-kinds-fork
|
||||
- th-lego
|
||||
- th-pprint
|
||||
- th-sccs
|
||||
- th-tc
|
||||
|
@ -10746,6 +10784,7 @@ broken-packages:
|
|||
- typescript-docs
|
||||
- typograffiti
|
||||
- tyro
|
||||
- tz
|
||||
- u2f
|
||||
- uber
|
||||
- uberlast
|
||||
|
@ -10988,7 +11027,6 @@ broken-packages:
|
|||
- vty-menu
|
||||
- vty-ui
|
||||
- vty-ui-extras
|
||||
- vulkan-utils
|
||||
- waargonaut
|
||||
- wacom-daemon
|
||||
- waddle
|
||||
|
@ -11290,6 +11328,7 @@ broken-packages:
|
|||
- yaml-rpc
|
||||
- yaml-rpc-scotty
|
||||
- yaml-rpc-snap
|
||||
- yaml-unscrambler
|
||||
- YamlReference
|
||||
- Yampa
|
||||
- yampa-canvas
|
||||
|
|
2246
pkgs/development/haskell-modules/hackage-packages.nix
generated
2246
pkgs/development/haskell-modules/hackage-packages.nix
generated
File diff suppressed because it is too large
Load diff
|
@ -258,6 +258,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
|||
# packages themselves. Using nix-shell on this derivation will
|
||||
# give you an environment suitable for developing the listed
|
||||
# packages with an incremental tool like cabal-install.
|
||||
#
|
||||
# In addition to the "packages" arg and "withHoogle" arg, anything that
|
||||
# can be passed into stdenv.mkDerivation can be included in the input attrset
|
||||
#
|
||||
|
@ -274,7 +275,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
|||
# (import ./.).shellFor {
|
||||
# packages = p: [p.frontend p.backend p.common];
|
||||
# withHoogle = true;
|
||||
# buildInputs = [ pkgs.python ];
|
||||
# buildInputs = [ pkgs.python pkgs.cabal-install ];
|
||||
# }
|
||||
#
|
||||
# -- cabal.project
|
||||
|
@ -285,38 +286,150 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
|||
#
|
||||
# bash$ nix-shell --run "cabal new-build all"
|
||||
# bash$ nix-shell --run "python"
|
||||
shellFor = { packages, withHoogle ? false, ... } @ args:
|
||||
shellFor =
|
||||
{ # Packages to create this development shell for. These are usually
|
||||
# your local packages.
|
||||
packages
|
||||
, # Whether or not to generate a Hoogle database for all the
|
||||
# dependencies.
|
||||
withHoogle ? false
|
||||
, # Whether or not to include benchmark dependencies of your local
|
||||
# packages. You should set this to true if you have benchmarks defined
|
||||
# in your local packages that you want to be able to run with cabal benchmark
|
||||
doBenchmark ? false
|
||||
, ...
|
||||
} @ args:
|
||||
let
|
||||
combinedPackageFor = packages:
|
||||
let
|
||||
selected = packages self;
|
||||
# A list of the packages we want to build a development shell for.
|
||||
# This is a list of Haskell package derivations.
|
||||
selected = packages self;
|
||||
|
||||
pname = if pkgs.lib.length selected == 1
|
||||
then (pkgs.lib.head selected).name
|
||||
else "packages";
|
||||
# This is a list of attribute sets, where each attribute set
|
||||
# corresponds to the build inputs of one of the packages input to shellFor.
|
||||
#
|
||||
# Each attribute has keys like buildDepends, executableHaskellDepends,
|
||||
# testPkgconfigDepends, etc. The values for the keys of the attribute
|
||||
# set are lists of dependencies.
|
||||
#
|
||||
# Example:
|
||||
# cabalDepsForSelected
|
||||
# => [
|
||||
# # This may be the attribute set corresponding to the `backend`
|
||||
# # package in the example above.
|
||||
# { buildDepends = [ gcc ... ];
|
||||
# libraryHaskellDepends = [ lens conduit ... ];
|
||||
# ...
|
||||
# }
|
||||
# # This may be the attribute set corresponding to the `common`
|
||||
# # package in the example above.
|
||||
# { testHaskellDepends = [ tasty hspec ... ];
|
||||
# libraryHaskellDepends = [ lens aeson ];
|
||||
# benchmarkHaskellDepends = [ criterion ... ];
|
||||
# ...
|
||||
# }
|
||||
# ...
|
||||
# ]
|
||||
cabalDepsForSelected = map (p: p.getCabalDeps) selected;
|
||||
|
||||
# If `packages = [ a b ]` and `a` depends on `b`, don't build `b`,
|
||||
# because cabal will end up ignoring that built version, assuming
|
||||
# new-style commands.
|
||||
combinedPackages = pkgs.lib.filter
|
||||
(input: pkgs.lib.all (p: input.outPath or null != p.outPath) selected);
|
||||
# A predicate that takes a derivation as input, and tests whether it is
|
||||
# the same as any of the `selected` packages.
|
||||
#
|
||||
# Returns true if the input derivation is not in the list of `selected`
|
||||
# packages.
|
||||
#
|
||||
# isNotSelected :: Derivation -> Bool
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# isNotSelected common [ frontend backend common ]
|
||||
# => false
|
||||
#
|
||||
# isNotSelected lens [ frontend backend common ]
|
||||
# => true
|
||||
isNotSelected = input: pkgs.lib.all (p: input.outPath or null != p.outPath) selected;
|
||||
|
||||
# Returns an attrset containing a combined list packages' inputs for each
|
||||
# stage of the build process
|
||||
packageInputs = pkgs.lib.zipAttrsWith
|
||||
(_: pkgs.lib.concatMap combinedPackages)
|
||||
(map (p: p.getCabalDeps) selected);
|
||||
# A function that takes a list of list of derivations, filters out all
|
||||
# the `selected` packages from each list, and concats the results.
|
||||
#
|
||||
# zipperCombinedPkgs :: [[Derivation]] -> [Derivation]
|
||||
#
|
||||
# Example:
|
||||
# zipperCombinedPkgs [ [ lens conduit ] [ aeson frontend ] ]
|
||||
# => [ lens conduit aeson ]
|
||||
#
|
||||
# Note: The reason this isn't just the function `pkgs.lib.concat` is
|
||||
# that we need to be careful to remove dependencies that are in the
|
||||
# `selected` packages.
|
||||
#
|
||||
# For instance, in the above example, if `common` is a dependency of
|
||||
# `backend`, then zipperCombinedPkgs needs to be careful to filter out
|
||||
# `common`, because cabal will end up ignoring that built version,
|
||||
# assuming new-style commands.
|
||||
zipperCombinedPkgs = vals:
|
||||
pkgs.lib.concatMap
|
||||
(drvList: pkgs.lib.filter isNotSelected drvList)
|
||||
vals;
|
||||
|
||||
genericBuilderArgs = {
|
||||
inherit pname;
|
||||
version = "0";
|
||||
license = null;
|
||||
} // packageInputs;
|
||||
# Zip `cabalDepsForSelected` into a single attribute list, combining
|
||||
# the derivations in all the individual attributes.
|
||||
#
|
||||
# Example:
|
||||
# packageInputs
|
||||
# => # Assuming the value of cabalDepsForSelected is the same as
|
||||
# # the example in cabalDepsForSelected:
|
||||
# { buildDepends = [ gcc ... ];
|
||||
# libraryHaskellDepends = [ lens conduit aeson ... ];
|
||||
# testHaskellDepends = [ tasty hspec ... ];
|
||||
# benchmarkHaskellDepends = [ criterion ... ];
|
||||
# ...
|
||||
# }
|
||||
#
|
||||
# See the Note in `zipperCombinedPkgs` for what gets filtered out from
|
||||
# each of these dependency lists.
|
||||
packageInputs =
|
||||
pkgs.lib.zipAttrsWith (_name: zipperCombinedPkgs) cabalDepsForSelected;
|
||||
|
||||
in self.mkDerivation genericBuilderArgs;
|
||||
# A attribute set to pass to `haskellPackages.mkDerivation`.
|
||||
#
|
||||
# The important thing to note here is that all the fields from
|
||||
# packageInputs are set correctly.
|
||||
genericBuilderArgs = {
|
||||
pname =
|
||||
if pkgs.lib.length selected == 1
|
||||
then (pkgs.lib.head selected).name
|
||||
else "packages";
|
||||
version = "0";
|
||||
license = null;
|
||||
}
|
||||
// packageInputs
|
||||
// pkgs.lib.optionalAttrs doBenchmark {
|
||||
# `doBenchmark` needs to explicitly be set here because haskellPackages.mkDerivation defaults it to `false`. If the user wants benchmark dependencies included in their development shell, it has to be explicitly enabled here.
|
||||
doBenchmark = true;
|
||||
};
|
||||
|
||||
mkDerivationArgs = builtins.removeAttrs args [ "packages" "withHoogle" ];
|
||||
in ((combinedPackageFor packages).envFunc { inherit withHoogle; }).overrideAttrs (old: mkDerivationArgs // {
|
||||
# This is a pseudo Haskell package derivation that contains all the
|
||||
# dependencies for the packages in `selected`.
|
||||
#
|
||||
# This is a derivation created with `haskellPackages.mkDerivation`.
|
||||
#
|
||||
# pkgWithCombinedDeps :: HaskellDerivation
|
||||
pkgWithCombinedDeps = self.mkDerivation genericBuilderArgs;
|
||||
|
||||
# The derivation returned from `envFunc` for `pkgWithCombinedDeps`.
|
||||
#
|
||||
# This is a derivation that can be run with `nix-shell`. It provides a
|
||||
# GHC with a package database with all the dependencies of our
|
||||
# `selected` packages.
|
||||
#
|
||||
# This is a derivation created with `stdenv.mkDerivation` (not
|
||||
# `haskellPackages.mkDerivation`).
|
||||
#
|
||||
# pkgWithCombinedDepsDevDrv :: Derivation
|
||||
pkgWithCombinedDepsDevDrv = pkgWithCombinedDeps.envFunc { inherit withHoogle; };
|
||||
|
||||
mkDerivationArgs = builtins.removeAttrs args [ "packages" "withHoogle" "doBenchmark" ];
|
||||
|
||||
in pkgWithCombinedDepsDevDrv.overrideAttrs (old: mkDerivationArgs // {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ mkDerivationArgs.nativeBuildInputs or [];
|
||||
buildInputs = old.buildInputs ++ mkDerivationArgs.buildInputs or [];
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue