Merge pull request #88894 from NixOS/haskell-updates

Update Haskell package set to LTS 15.13 (plus other fixes)
This commit is contained in:
Peter Simons 2020-05-29 22:31:41 +02:00 committed by GitHub
commit a7e42e64c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 3627 additions and 1743 deletions

View File

@ -1,6 +1,6 @@
{ fetchurl }:
fetchurl {
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/6515ef12bbcf8fbac87e12b4cb30b7eefa9ce9ce.tar.gz";
sha256 = "0plf0kk0wj1lbmks09afyqrl70z0miwxzfk3zh7y2qiw3g5l1v0x";
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/e8df5568f80e6230e29c2381e842db35fe11cd71.tar.gz";
sha256 = "1fz4iax88pmlqpb4zp3l6mb6bmkzzha0q6mm3xasabh5yl83dbhy";
}

View File

@ -710,18 +710,7 @@ self: super: {
});
# The standard libraries are compiled separately.
# The megaparsec-7 override is needed because https://github.com/idris-lang/Idris-dev/issues/4826 declares that
# idris1 has no plans to migrate to megaparsec-8.
# The idris-lang/Idris-dev#4808 patch is for GHC 8.8 compatibility, and can likely be removed with the next release.
idris = generateOptparseApplicativeCompletion "idris" (doJailbreak (dontCheck
(appendPatches
(super.idris.override { megaparsec = self.megaparsec_7_0_5; }) [
(pkgs.fetchpatch {
url = "https://github.com/idris-lang/Idris-dev/pull/4808.diff";
sha256 = "060ib1rczy34ip8xf3bv1pf28655f6s0bvvij19jhh5dpcr0pf71";
excludes = [ ".travis.yml" "Makefile" "appveyor.yml" ];
})
])));
idris = generateOptparseApplicativeCompletion "idris" (dontCheck super.idris);
# https://github.com/bos/math-functions/issues/25
math-functions = dontCheck super.math-functions;
@ -1018,6 +1007,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
VulkanMemoryAllocator = addExtraLibrary super.VulkanMemoryAllocator pkgs.vulkan-headers;
# # Builds only with the latest version of indexed-list-literals.
# vector-sized_1_0_3_0 = super.vector-sized_1_0_3_0.override {
# indexed-list-literals = self.indexed-list-literals_0_2_1_1;
@ -1311,9 +1303,6 @@ self: super: {
'';
});
# cabal-fmt requires Cabal3
cabal-fmt = super.cabal-fmt.override { Cabal = self.Cabal_3_2_0_0; };
# Several gtk2hs-provided packages at v0.13.8.0 fail to build on Darwin
# until we pick up https://github.com/gtk2hs/gtk2hs/pull/293 so apply that
# patch here. That single patch is for the gtk2hs super-repo, out of which
@ -1502,16 +1491,16 @@ self: super: {
});
# stackage right now is not new enough for hlint-3.0
ghc-lib-parser-ex_8_10_0_8 = super.ghc-lib-parser-ex_8_10_0_8.override {
ghc-lib-parser = self.ghc-lib-parser_8_10_1_20200412;
ghc-lib-parser-ex_8_10_0_11 = super.ghc-lib-parser-ex_8_10_0_11.override {
ghc-lib-parser = self.ghc-lib-parser_8_10_1_20200523;
};
hlint = super.hlint.override {
ghc-lib-parser = self.ghc-lib-parser_8_10_1_20200412;
ghc-lib-parser-ex = self.ghc-lib-parser-ex_8_10_0_8;
extra = self.extra_1_7_1;
ghc-lib-parser = self.ghc-lib-parser_8_10_1_20200523;
ghc-lib-parser-ex = self.ghc-lib-parser-ex_8_10_0_11;
extra = self.extra_1_7_2;
filepattern = self.filepattern.override {
extra = self.extra_1_7_1;
extra = self.extra_1_7_2;
};
};
@ -1519,4 +1508,8 @@ self: super: {
# upstream: https://github.com/obsidiansystems/which/pull/6
which = doJailbreak super.which;
# the test suite attempts to run the binaries built in this package
# through $PATH but they aren't in $PATH
dhall-lsp-server = dontCheck super.dhall-lsp-server;
} // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super

View File

@ -106,4 +106,7 @@ self: super: {
# The package needs the latest Cabal version.
cabal-install-parsers = super.cabal-install-parsers.overrideScope (self: super: { Cabal = self.Cabal_3_2_0_0; });
# cabal-fmt requires Cabal3
cabal-fmt = super.cabal-fmt.override { Cabal = self.Cabal_3_2_0_0; };
}

View File

@ -67,12 +67,14 @@ core-packages:
# comment saying "# LTS Haskell x.y". Any changes after that commend will be
# lost the next time `update-stackage.sh` runs.
default-package-overrides:
# Newer versions have test suite failures.
- git-annex < 8.20200522
# This was only intended for ghc-7.0.4, and has very old deps, one hidden behind a flag
- MissingH ==1.4.2.0
# gi-gdkx11-4.x requires gtk-4.x, which is still under development and
# not yet available in Nixpkgs
- gi-gdkx11 < 4
# LTS Haskell 15.12
# LTS Haskell 15.13
- abstract-deque ==0.3
- abstract-par ==0.3.3
- AC-Angle ==1.0
@ -345,7 +347,7 @@ default-package-overrides:
- btrfs ==0.2.0.0
- buffer-builder ==0.2.4.7
- buffer-pipe ==0.0
- bugsnag-hs ==0.1.0.0
- bugsnag-hs ==0.1.0.1
- butcher ==1.3.3.1
- bv ==0.5
- bv-little ==1.1.1
@ -576,7 +578,7 @@ default-package-overrides:
- data-tree-print ==0.1.0.2
- dataurl ==0.1.0.0
- DAV ==1.3.4
- dbus ==1.2.14
- dbus ==1.2.15.1
- debian-build ==0.10.2.0
- debug-trace-var ==0.2.0
- dec ==0.0.3
@ -725,10 +727,11 @@ default-package-overrides:
- fft ==0.1.8.6
- fgl ==5.7.0.2
- filecache ==0.4.1
- file-embed ==0.0.11.2
- file-embed ==0.0.12.0
- file-embed-lzma ==0
- filelock ==0.1.1.4
- filemanip ==0.3.6.3
- file-path-th ==0.1.0.0
- filepattern ==0.1.2
- fileplow ==0.1.0.0
- filtrable ==0.1.3.0
@ -929,7 +932,7 @@ default-package-overrides:
- haskoin-node ==0.9.21
- hasql ==1.4.2
- hasql-optparse-applicative ==0.3.0.5
- hasql-pool ==0.5.1
- hasql-pool ==0.5.2
- hasql-transaction ==1.0.0.1
- hasty-hamiltonian ==1.3.2
- HaXml ==1.25.5
@ -983,7 +986,7 @@ default-package-overrides:
- hourglass ==0.2.12
- hourglass-orphans ==0.1.0.0
- hp2pretty ==0.9
- hpack ==0.33.0
- hpack ==0.33.1
- hpc-codecov ==0.1.0.0
- hreader ==1.1.0
- hreader-lens ==0.1.3.0
@ -1043,7 +1046,7 @@ default-package-overrides:
- HTTP ==4000.3.14
- http-api-data ==0.4.1.1
- http-client ==0.6.4.1
- http-client-openssl ==0.3.0.0
- http-client-openssl ==0.3.1.0
- http-client-overrides ==0.1.1.0
- http-client-tls ==0.3.5.3
- http-common ==0.8.2.0
@ -1060,11 +1063,11 @@ default-package-overrides:
- human-readable-duration ==0.2.1.4
- HUnit ==1.6.0.0
- HUnit-approx ==1.1.1.1
- hunit-dejafu ==2.0.0.2
- hunit-dejafu ==2.0.0.3
- hvect ==0.4.0.0
- hvega ==0.5.0.0
- hw-balancedparens ==0.3.1.0
- hw-bits ==0.7.2.0
- hw-bits ==0.7.2.1
- hw-conduit ==0.2.1.0
- hw-conduit-merges ==0.2.1.0
- hw-diagnostics ==0.0.1.0
@ -1116,7 +1119,7 @@ default-package-overrides:
- Imlib ==0.1.2
- immortal ==0.3
- include-file ==0.1.0.4
- incremental-parser ==0.4.0.1
- incremental-parser ==0.4.0.2
- indents ==0.5.0.1
- indexed ==0.1.3
- indexed-list-literals ==0.2.1.3
@ -1170,7 +1173,7 @@ default-package-overrides:
- ix-shapable ==0.1.0
- jack ==0.7.1.4
- jira-wiki-markup ==1.0.0
- jose ==0.8.2.1
- jose ==0.8.3
- jose-jwt ==0.8.0
- js-dgtable ==0.5.2
- js-flot ==0.8.3
@ -1183,7 +1186,7 @@ default-package-overrides:
- JuicyPixels ==3.3.5
- JuicyPixels-extra ==0.4.1
- JuicyPixels-scale-dct ==0.1.2
- junit-xml ==0.1.0.0
- junit-xml ==0.1.0.1
- justified-containers ==0.3.0.0
- jwt ==0.10.0
- kan-extensions ==5.2
@ -1268,6 +1271,7 @@ default-package-overrides:
- log-base ==0.8.0.1
- log-domain ==0.13
- logfloat ==0.13.3.3
- logging ==3.0.5
- logging-effect ==1.3.9
- logging-facade ==0.3.0
- logging-facade-syslog ==1
@ -1307,7 +1311,7 @@ default-package-overrides:
- median-stream ==0.7.0.0
- megaparsec ==8.0.0
- megaparsec-tests ==8.0.0
- membrain ==0.0.0.1
- membrain ==0.0.0.2
- memory ==0.15.0
- MemoTrie ==0.6.10
- mercury-api ==0.1.0.2
@ -1341,6 +1345,7 @@ default-package-overrides:
- mintty ==0.1.2
- miso ==1.4.0.0
- missing-foreign ==0.1.1
- MissingH ==1.4.3.0
- mixed-types-num ==0.4.0.1
- mixpanel-client ==0.2.1
- mltool ==0.2.0.1
@ -1428,7 +1433,7 @@ default-package-overrides:
- netwire-input-glfw ==0.0.11
- network ==3.1.1.1
- network-bsd ==2.8.1.0
- network-byte-order ==0.1.4.0
- network-byte-order ==0.1.5
- network-conduit-tls ==1.3.2
- network-info ==0.2.0.10
- network-ip ==0.3.0.3
@ -1506,6 +1511,7 @@ default-package-overrides:
- packcheck ==0.4.2
- pager ==0.1.1.0
- pagination ==0.2.1
- pagure-cli ==0.2
- pandoc ==2.9.1.1
- pandoc-citeproc ==0.16.4.1
- pandoc-csv2table ==1.0.8
@ -1546,7 +1552,7 @@ default-package-overrides:
- percent-format ==0.0.1
- perfect-hash-generator ==0.2.0.6
- perfect-vector-shuffle ==0.1.1.1
- persist ==0.1.1.4
- persist ==0.1.1.5
- persistable-record ==0.6.0.4
- persistable-types-HDBC-pg ==0.0.3.5
- persistent ==2.10.5.2
@ -1787,7 +1793,7 @@ default-package-overrides:
- salve ==1.0.9
- sample-frame ==0.0.3
- sample-frame-np ==0.0.4.1
- sampling ==0.3.3
- sampling ==0.3.4
- say ==0.1.0.1
- sbp ==2.6.3
- scalpel ==0.6.2
@ -1930,6 +1936,8 @@ default-package-overrides:
- splitmix ==0.0.4
- spoon ==0.3.1
- spreadsheet ==0.1.3.8
- sqlcli ==0.2.2.0
- sqlcli-odbc ==0.2.0.1
- sql-words ==0.1.6.4
- srcloc ==0.5.1.2
- stache ==2.1.1
@ -2010,7 +2018,7 @@ default-package-overrides:
- tardis ==0.4.1.0
- tasty ==1.2.3
- tasty-ant-xml ==1.1.6
- tasty-dejafu ==2.0.0.3
- tasty-dejafu ==2.0.0.4
- tasty-discover ==4.2.1
- tasty-expected-failure ==0.11.1.2
- tasty-golden ==2.3.3.2
@ -2239,7 +2247,7 @@ default-package-overrides:
- vector-split ==1.0.0.2
- vector-th-unbox ==0.2.1.7
- verbosity ==0.3.0.0
- versions ==3.5.3
- versions ==3.5.4
- vformat ==0.14.1.0
- vformat-aeson ==0.1.0.1
- vformat-time ==0.1.0.0
@ -2260,7 +2268,7 @@ default-package-overrides:
- wai-session ==0.3.3
- wai-slack-middleware ==0.2.0
- wai-websockets ==3.0.1.2
- warp ==3.3.10
- warp ==3.3.11
- warp-tls ==3.2.11
- warp-tls-uid ==0.2.0.6
- wave ==0.2.0
@ -2406,8 +2414,6 @@ extra-packages:
- http-conduit ^>= 2.2 # pre-lts-11.x versions neeed by git-annex 6.20180227
- inline-c < 0.6 # required on GHC 8.0.x
- inline-c-cpp < 0.2 # required on GHC 8.0.x
- lens-family ==1.2.3 # required for tensorflow
- lens-family-core ==1.2.3 # required for tensorflow
- lens-labels == 0.1.* # required for proto-lens-descriptors
- megaparsec >= 7.0.4 && < 8 # required for idris: https://github.com/idris-lang/Idris-dev/issues/4826
- mtl < 2.2 # newer versions require transformers > 0.4.x, which we cannot provide in GHC 7.8.x
@ -2421,11 +2427,6 @@ extra-packages:
- persistent-sqlite < 2.7 # pre-lts-11.x versions neeed by git-annex 6.20180227
- prettyprinter == 1.6.1 # required by ghc 8.8.x, and dhall-1.29.0
- primitive == 0.5.1.* # required to build alex with GHC 6.12.3
- proto-lens == 0.5.* # required for tensorflow-proto
- proto-lens-protobuf-types == 0.5.* # required for tensorflow-proto
- proto-lens-protoc == 0.5.* # required for tensorflow-proto
- proto-lens-runtime == 0.5.* # required for tensorflow-proto
- proto-lens-setup == 0.4.0.2 # required for tensorflow-proto
- QuickCheck < 2 # required by test-framework-quickcheck and its users
- resolv == 0.1.1.2 # required to build cabal-install-3.0.0.0 with pre ghc-8.8.x
- resourcet ==1.1.* # pre-lts-11.x versions neeed by git-annex 6.20180227
@ -2502,6 +2503,15 @@ package-maintainers:
- icepeak
terlar:
- nix-diff
maralorn:
- ghcide
- cabal-fmt
- neuron
- shh
- brittany
- hlint
- releaser
- taskwarrior
unsupported-platforms:
alsa-mixer: [ x86_64-darwin ]
@ -2794,7 +2804,6 @@ broken-packages:
- amazon-emailer
- amazon-emailer-client-snap
- amazon-products
- amazonka-dynamodb
- amby
- AMI
- ampersand
@ -3388,7 +3397,6 @@ broken-packages:
- cabal-dependency-licenses
- cabal-dev
- cabal-dir
- cabal-fmt
- cabal-ghc-dynflags
- cabal-ghci
- cabal-graphdeps
@ -4181,7 +4189,6 @@ broken-packages:
- dgs
- dhall-check
- dhall-fly
- dhall-lsp-server
- dhall-nix
- dhall-text
- dhall-to-cabal
@ -5319,7 +5326,6 @@ broken-packages:
- gtksourceview3
- guarded-rewriting
- guess-combinator
- guid
- GuiHaskell
- GuiTV
- gulcii
@ -6785,8 +6791,10 @@ broken-packages:
- keera-hails-mvc-model-lightmodel
- keera-hails-mvc-model-protectedmodel
- keera-hails-mvc-solutions-gtk
- keera-hails-reactive-cbmvar
- keera-hails-reactive-fs
- keera-hails-reactive-gtk
- keera-hails-reactive-htmldom
- keera-hails-reactive-network
- keera-hails-reactive-polling
- keera-hails-reactive-wx
@ -7987,6 +7995,7 @@ broken-packages:
- optparse-applicative-simple
- optparse-enum
- optparse-helper
- orbits
- orc
- orchestrate
- OrchestrateDB
@ -8890,8 +8899,6 @@ broken-packages:
- rfc-psql
- rfc-redis
- rfc-servant
- rhine
- rhine-gloss
- rhythm-game-tutorial
- ribbit
- RichConditional
@ -9269,8 +9276,6 @@ broken-packages:
- shellish
- shellmate
- shellmate-extras
- shh
- shh-extras
- shimmer
- shine-examples
- shivers-cfg
@ -9855,7 +9860,6 @@ broken-packages:
- tapioca
- tar-bytestring
- target
- tart
- task
- task-distribution
- taskell
@ -9906,10 +9910,6 @@ broken-packages:
- tempus
- tensor
- tensor-safe
- tensorflow
- tensorflow-core-ops
- tensorflow-logging
- tensorflow-ops
- termbox
- termbox-banana
- termbox-bindings
@ -10492,8 +10492,6 @@ broken-packages:
- vty-menu
- vty-ui
- vty-ui-extras
- vulkan
- VulkanMemoryAllocator
- waargonaut
- wacom-daemon
- waddle

View File

@ -542,6 +542,9 @@ self: super: builtins.intersectAttrs super {
# Break infinite recursion cycle between tasty and clock.
clock = dontCheck super.clock;
# Break infinite recursion cycle between devtools and mprelude.
devtools = super.devtools.override { mprelude = dontCheck super.mprelude; };
# loc and loc-test depend on each other for testing. Break that infinite cycle:
loc-test = super.loc-test.override { loc = dontCheck self.loc; };
@ -718,6 +721,7 @@ self: super: builtins.intersectAttrs super {
# dhall's tests access the network.
dhall_1_29_0 = dontCheck super.dhall_1_29_0;
dhall_1_31_1 = dontCheck super.dhall_1_31_1;
dhall_1_32_0 = dontCheck super.dhall_1_32_0;
cut-the-crap =
let path = pkgs.stdenv.lib.makeBinPath [ pkgs.ffmpeg ];
@ -750,4 +754,26 @@ self: super: builtins.intersectAttrs super {
'';
});
postgresql-syntax = super.postgresql-syntax.override {
rerebase = self.rerebase_1_6_1;
};
rerebase_1_6_1 = super.rerebase_1_6_1.override {
rebase = self.rebase_1_6_1;
};
rebase_1_6_1 = super.rebase_1_6_1.override {
selective = super.selective_0_4_1;
};
# Fix compilation of Setup.hs by removing the module declaration.
# See: https://github.com/tippenein/guid/issues/1
guid = overrideCabal (super.guid) (drv: {
prePatch = "sed -i '1d' Setup.hs"; # 1st line is module declaration, remove it
doCheck = false;
});
# Tests disabled as recommended at https://github.com/luke-clifton/shh/issues/39
shh = dontCheck super.shh;
}

View File

@ -11,79 +11,28 @@ let
tensorflow-haskell = pkgs.fetchFromGitHub {
owner = "tensorflow";
repo = "haskell";
rev = "0f322b2e0611cbe7011c84ba8b6cb822e4725ebc";
sha256 = "15gn66i547q20sd50ixwm6yk1g00syfgxp8xa6xjd0i3kcsl3gs1";
rev = "568c9b6f03e5d66a25685a776386e2ff50b61aa9";
sha256 = "0v58zhqipa441hzdvp9pwgv6srir2fm7cp0bq2pb5jl1imwyd37h";
fetchSubmodules = true;
};
setTensorflowSourceRoot = dir: drv:
(overrideCabal drv (drv: { src = tensorflow-haskell; }))
.overrideAttrs (_oldAttrs: {sourceRoot = "source/${dir}";});
proto-lens = self.proto-lens_0_5_1_0;
proto-lens-protoc = self.proto-lens-protoc_0_5_0_0;
proto-lens-runtime = self.proto-lens-runtime_0_5_0_0;
proto-lens-protobuf-types = self.proto-lens-protobuf-types_0_5_0_0;
proto-lens-setup = self.proto-lens-setup_0_4_0_2;
lens-family = self.lens-family_1_2_3;
in
{
lens-family_1_2_3 = super.lens-family_1_2_3.override {
lens-family-core = self.lens-family-core_1_2_3;
};
proto-lens_0_5_1_0 = (appendPatch (doJailbreak super.proto-lens_0_5_1_0) ./patches/proto-lens-0.5.1.0.patch).override {
inherit lens-family;
};
proto-lens-runtime_0_5_0_0 = doJailbreak (super.proto-lens-runtime_0_5_0_0.override {
inherit lens-family proto-lens;
});
proto-lens-protoc_0_5_0_0 = doJailbreak (super.proto-lens-protoc_0_5_0_0.override {
inherit lens-family proto-lens;
haskell-src-exts = self.haskell-src-exts_1_19_1;
});
proto-lens-setup_0_4_0_2 = appendPatch (doJailbreak (super.proto-lens-setup_0_4_0_2.override {
inherit proto-lens-protoc;
})) ./patches/proto-lens-setup-0.4.0.2.patch;
proto-lens-protobuf-types_0_5_0_0 = doJailbreak (super.proto-lens-protobuf-types_0_5_0_0.override {
inherit lens-family proto-lens proto-lens-runtime proto-lens-setup;
});
haskell-src-exts_1_19_1 = appendPatches (doJailbreak super.haskell-src-exts_1_19_1) [
# Adapt to the SemigroupMonoid Proposal (enables building on GHC >= 8.4)
(pkgs.fetchpatch {
url = "https://github.com/haskell-suite/haskell-src-exts/commit/258e072fe9e37f94360b7488b58ea2832843bbb8.patch";
sha256 = "0ja6ai41v9plinlhjwja282m6ahn6mw4xi79np0jxqk83cg0z1ff";
})
# Adapt to MonadFail proposal (enables building on GHC >= 8.8)
(pkgs.fetchpatch {
url = "https://gist.githubusercontent.com/mikesperber/0f2addaf3fbe97ffb4a5234d8711ba41/raw/e09e20998283c7195e82d546ba9266d290eb000d/gistfile1.txt";
sha256 = "18clvli7vpqsqlf2f3qidn71738j9zdlpana6wha3x0dxwan5ly0";
}) ];
tensorflow-proto = (setTensorflowSourceRoot "tensorflow-proto" super.tensorflow-proto).override {
inherit proto-lens proto-lens-runtime proto-lens-setup proto-lens-protobuf-types;
};
tensorflow-proto = doJailbreak (setTensorflowSourceRoot "tensorflow-proto" super.tensorflow-proto);
tensorflow = (setTensorflowSourceRoot "tensorflow" super.tensorflow).override {
inherit lens-family proto-lens;
# the "regular" Python package does not seem to include the binary library
libtensorflow = pkgs.libtensorflow-bin;
};
tensorflow-core-ops = (setTensorflowSourceRoot "tensorflow-core-ops" super.tensorflow-core-ops).override {
inherit lens-family proto-lens;
};
tensorflow-core-ops = setTensorflowSourceRoot "tensorflow-core-ops" super.tensorflow-core-ops;
tensorflow-logging = (setTensorflowSourceRoot "tensorflow-logging" super.tensorflow-logging).override {
inherit lens-family proto-lens;
};
tensorflow-logging = setTensorflowSourceRoot "tensorflow-logging" super.tensorflow-logging;
tensorflow-mnist = (setTensorflowSourceRoot "tensorflow-mnist" super.tensorflow-mnist).override {
inherit lens-family proto-lens;
# https://github.com/tensorflow/haskell/issues/215
tensorflow-mnist-input-data = self.tensorflow-mnist-input-data;
};
@ -124,11 +73,7 @@ in
}
) {});
tensorflow-opgen = (setTensorflowSourceRoot "tensorflow-opgen" super.tensorflow-opgen).override {
inherit lens-family proto-lens;
};
tensorflow-opgen = setTensorflowSourceRoot "tensorflow-opgen" super.tensorflow-opgen;
tensorflow-ops = (setTensorflowSourceRoot "tensorflow-ops" super.tensorflow-ops).override {
inherit lens-family proto-lens;
};
tensorflow-ops = setTensorflowSourceRoot "tensorflow-ops" super.tensorflow-ops;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
diff --git a/src/Data/ProtoLens/Encoding/Parser/Internal.hs b/src/Data/ProtoLens/Encoding/Parser/Internal.hs
index 30eeaad..f2703e7 100644
--- a/src/Data/ProtoLens/Encoding/Parser/Internal.hs
+++ b/src/Data/ProtoLens/Encoding/Parser/Internal.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE CPP #-}
-- | Definition of the parsing monad, plus internal
-- unsafe functions.
module Data.ProtoLens.Encoding.Parser.Internal
@@ -36,8 +37,11 @@ instance Applicative Parser where
(<*>) = ap
instance Monad Parser where
- fail s = Parser $ \_ _ -> return $ ParseFailure s
return = pure
Parser f >>= g = Parser $ \end pos -> f end pos >>= \case
ParseSuccess pos' x -> unParser (g x) end pos'
ParseFailure s -> return $ ParseFailure s
+#if MIN_VERSION_base(4,13,0)
+instance MonadFail Parser where
+#endif
+ fail s = Parser $ \_ _ -> return $ ParseFailure s

View File

@ -1,154 +0,0 @@
diff --git a/src/Data/ProtoLens/Setup.hs b/src/Data/ProtoLens/Setup.hs
index e68f32b..f381199 100644
--- a/src/Data/ProtoLens/Setup.hs
+++ b/src/Data/ProtoLens/Setup.hs
@@ -41,9 +41,6 @@ import Distribution.PackageDescription
, exeName
, exposedModules
, extraSrcFiles
-#if !MIN_VERSION_Cabal(2,0,0)
- , hsSourceDirs
-#endif
#if MIN_VERSION_Cabal(2,4,0)
, specVersion
#endif
@@ -53,7 +50,7 @@ import Distribution.PackageDescription
, testBuildInfo
, testName
)
-import qualified Distribution.Simple.BuildPaths as BuildPaths
+import Distribution.Simple.BuildPaths (autogenComponentModulesDir)
import Distribution.Simple.InstallDirs (datadir)
import Distribution.Simple.LocalBuildInfo
( LocalBuildInfo(..)
@@ -61,9 +58,10 @@ import Distribution.Simple.LocalBuildInfo
, ComponentName(..)
, ComponentLocalBuildInfo
, componentPackageDeps
-#if MIN_VERSION_Cabal(2,0,0)
, allComponentsInBuildOrder
, componentNameMap
+#if MIN_VERSION_Cabal(3,0,0)
+ , LibraryName(..)
#endif
)
import qualified Distribution.Simple.PackageIndex as PackageIndex
@@ -205,16 +203,6 @@ generatingSpecificProtos root getProtos hooks = hooks
{ buildHook = \p l h f -> generate l >> buildHook hooks p l h f
, haddockHook = \p l h f -> generate l >> haddockHook hooks p l h f
, replHook = \p l h f args -> generate l >> replHook hooks p l h f args
-#if !MIN_VERSION_Cabal(2,0,0)
- -- Older versions of Cabal don't support the autogen-modules field.
- -- Work around it by manually generating the modules and putting them
- -- in a place where `cabal sdist` will pick them up.
- , sDistHook = \p maybe_l h f -> case maybe_l of
- Nothing -> error "Can't run protoc; run 'cabal configure' first."
- Just l -> do
- generate l
- sDistHook hooks (fudgePackageDesc l p) maybe_l h f
-#endif
, postCopy = \a flags pkg lbi -> do
let verb = fromFlag $ copyVerbosity flags
let destDir = datadir (absoluteInstallDirs pkg lbi
@@ -316,39 +304,6 @@ copyProtosToDataDir verb root destDir files = do
protoLensImportsPrefix :: FilePath
protoLensImportsPrefix = "proto-lens-imports"
-#if !MIN_VERSION_Cabal(2,0,0)
--- | Add the autogen directory to the hs-source-dirs of all the targets in the
--- .cabal file. Used to fool 'sdist' by pointing it to the generated source
--- files.
-fudgePackageDesc :: LocalBuildInfo -> PackageDescription -> PackageDescription
-fudgePackageDesc lbi p = p
- { library =
- (\lib -> lib { libBuildInfo = fudgeBuildInfo CLibName $ libBuildInfo lib })
- <$> library p
- , executables =
- (\exe -> exe { buildInfo = fudgeBuildInfo (CExeName $ exeName exe)
- $ buildInfo exe })
- <$> executables p
- , testSuites =
- (\test -> test { testBuildInfo = fudgeBuildInfo (CTestName $ testName test)
- $ testBuildInfo test })
- <$> testSuites p
- , benchmarks =
- (\bench -> bench { benchmarkBuildInfo =
- fudgeBuildInfo (CBenchName $ benchmarkName bench)
- $ benchmarkBuildInfo bench })
- <$> benchmarks p
- }
- where
- comps = allComponents lbi
- fudgeBuildInfo n bi
- | Just compLBI <- Map.lookup n comps
- = bi { hsSourceDirs = autogenComponentModulesDir lbi compLBI
- : hsSourceDirs bi }
- | otherwise = bi -- Could happen if a component isn't active; try
- -- anyway and see whether Cabal complains later on.
-#endif
-
-- | Returns whether the @root@ is a parent folder of @f@.
isSubdirectoryOf :: FilePath -> FilePath -> Bool
isSubdirectoryOf root f
@@ -423,15 +378,18 @@ collectActiveModules
collectActiveModules l = map (\(n, c) -> (c, f n)) $ Map.toList $ allComponents l
where
p = localPkgDescr l
- f CLibName = maybeToList (library p) >>=
+#if MIN_VERSION_Cabal(3,0,0)
+ f (CLibName LMainLibName)
+#else
+ f CLibName
+#endif
+ = maybeToList (library p) >>=
\lib -> exposedModules lib
++ otherModules (libBuildInfo lib)
f (CExeName n) = otherModules . buildInfo $ exes Map.! n
f (CTestName n) = otherModules . testBuildInfo $ tests Map.! n
f (CBenchName n) = otherModules . benchmarkBuildInfo $ benchs Map.! n
-#if MIN_VERSION_Cabal(2,0,0)
f _ = [] -- TODO: other lib kinds; for now just suppress the warning
-#endif
exes = Map.fromList [(exeName e, e) | e <- executables p]
tests = Map.fromList [(testName e, e) | e <- testSuites p]
benchs = Map.fromList [(benchmarkName e, e) | e <- benchmarks p]
@@ -441,22 +399,14 @@ collectActiveModules l = map (\(n, c) -> (c, f n)) $ Map.toList $ allComponents
-- | List all the packages that this one depends on.
collectDeps :: LocalBuildInfo -> [InstalledPackageInfo.InstalledPackageInfo]
-#if MIN_VERSION_Cabal(2,0,0)
collectDeps l = do
c <- allComponentsInBuildOrder l
(i,_) <- componentPackageDeps c
Just p <- [PackageIndex.lookupUnitId (installedPkgs l) i]
return p
-#else
-collectDeps l = do
- (_, c ,_) <- componentsConfigs l
- (_, i) <- componentPackageDeps c
- PackageIndex.lookupSourcePackageId (installedPkgs l) i
-#endif
-- | All the components that will be built by this Cabal command.
allComponents :: LocalBuildInfo -> Map.Map ComponentName ComponentLocalBuildInfo
-#if MIN_VERSION_Cabal(2,0,0)
allComponents l = fmap requireOne $ componentNameMap l
where
-- TODO: this doesn't support Backpack, which can have more than one
@@ -464,16 +414,3 @@ allComponents l = fmap requireOne $ componentNameMap l
requireOne [x] = x
requireOne xs = error $ "Data.ProtoLens.Setup.allComponents: expected one "
++ "component per name, got " ++ show xs
-
-#else
-allComponents l = Map.fromList [(c, b) | (c, b, _) <- componentsConfigs l]
-#endif
-
--- | Get the component-level "autogen" directory where we're putting the
--- generated .hs files. (For Cabal-1.0, use the shared 'BuildPaths.autogenModulesDir'.)
-autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> FilePath
-#if MIN_VERSION_Cabal(2,0,0)
-autogenComponentModulesDir = BuildPaths.autogenComponentModulesDir
-#else
-autogenComponentModulesDir lbi _ = BuildPaths.autogenModulesDir lbi
-#endif

View File

@ -113,7 +113,7 @@ symlinkJoin {
# Clean up the old links that may have been (transitively) included by
# symlinkJoin:
rm -f $dynamicLinksDir/*
for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'|sort -u); do
for d in $(grep -Poz "dynamic-library-dirs:\s*\K .+\n" $packageConfDir/*|awk '{print $2}'|sort -u); do
ln -s $d/*.dylib $dynamicLinksDir
done
for f in $packageConfDir/*.conf; do
@ -123,7 +123,7 @@ symlinkJoin {
# $dynamicLinksDir
cp $f $f-tmp
rm $f
sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f
sed "N;s,dynamic-library-dirs:\s*.*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f
rm $f-tmp
done
'') + ''