Merge pull request #122706 from sternenseemann/hnix-fix

This commit is contained in:
maralorn 2021-05-13 13:22:26 +02:00 committed by GitHub
commit dac6cc83d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 42 deletions

View File

@ -170,18 +170,39 @@ self: super: {
# base bound
digit = doJailbreak super.digit;
# 2020-06-05: HACK: does not pass own build suite - `dontCheck`
hnix = generateOptparseApplicativeCompletion "hnix"
(overrideCabal super.hnix (drv: {
# 2020-06-05: HACK: does not pass own build suite - `dontCheck`
doCheck = false;
prePatch = ''
# fix encoding problems when patching
${pkgs.dos2unix}/bin/dos2unix hnix.cabal
'' + (drv.prePatch or "");
# 2021-05-12: Revert a few dependency cleanups which depend on release
# that are not in stackage yet:
# * Depend on semialign-indexed for Data.Semialign.Indexed
# (remove when semialign >= 1.2 in stackage)
# * Readd dependencies to text and unordered-containers.
# (remove when relude >= 1.0.0.0 is in stackage, see
# https://github.com/haskell-nix/hnix/issues/933)
libraryHaskellDepends = [
self.semialign-indexed
] ++ drv.libraryHaskellDepends;
patches = [
# support ref-tf in hnix 0.12.0.1, can be removed after
# https://github.com/haskell-nix/hnix/pull/918
./patches/hnix-ref-tf-0.5-support.patch
# depend on semialign-indexed again
(pkgs.fetchpatch {
url = "https://github.com/haskell-nix/hnix/commit/16fc342a4f2974f855968472252cd9274609f177.patch";
sha256 = "0gm4gy3jpn4dqnrhnqlsavfpw9c1j1xa8002v54knnlw6vpk9niy";
revert = true;
})
# depend on text again
(pkgs.fetchpatch {
url = "https://github.com/haskell-nix/hnix/commit/73057618576e86bb87dfd42f62b855d24bbdf469.patch";
sha256 = "03cyk96d5ad362i1pnz9bs8ifr84kpv8phnr628gys4j6a0bqwzc";
revert = true;
})
# depend on unordered-containers again
(pkgs.fetchpatch {
url = "https://github.com/haskell-nix/hnix/commit/70643481883ed448b51221a030a76026fb5eb731.patch";
sha256 = "0pqmijfkysjixg3gb4kmrqdif7s2saz8qi6k337jf15i0npzln8d";
revert = true;
})
] ++ (drv.patches or []);
}));

View File

@ -1,34 +0,0 @@
diff '--color=auto' '--color=never' -r --unified hnix-0.12.0.1/hnix.cabal hnix-patched/hnix.cabal
--- hnix-0.12.0.1/hnix.cabal 2001-09-09 03:46:40.000000000 +0200
+++ hnix-patched/hnix.cabal 2021-05-05 12:07:38.388267353 +0200
@@ -430,7 +430,7 @@
, parser-combinators >= 1.0.1 && < 1.3
, prettyprinter >= 1.7.0 && < 1.8
, process >= 1.6.3 && < 1.7
- , ref-tf >= 0.4.0 && < 0.5
+ , ref-tf >= 0.5
, regex-tdfa >= 1.2.3 && < 1.4
, scientific >= 0.3.6 && < 0.4
, semialign >= 1 && < 1.2
diff '--color=auto' '--color=never' -r --unified hnix-0.12.0.1/src/Nix/Fresh.hs hnix-patched/src/Nix/Fresh.hs
--- hnix-0.12.0.1/src/Nix/Fresh.hs 2001-09-09 03:46:40.000000000 +0200
+++ hnix-patched/src/Nix/Fresh.hs 2021-05-05 12:07:45.841267497 +0200
@@ -65,18 +65,3 @@
runFreshIdT :: Functor m => Var m i -> FreshIdT i m a -> m a
runFreshIdT i m = runReaderT (unFreshIdT m) i
-
--- Orphan instance needed by Infer.hs and Lint.hs
-
--- Since there's no forking, it's automatically atomic.
-instance MonadAtomicRef (ST s) where
- atomicModifyRef r f = do
- v <- readRef r
- let (a, b) = f v
- writeRef r a
- return b
- atomicModifyRef' r f = do
- v <- readRef r
- let (a, b) = f v
- writeRef r $! a
- return b