diff options
author | sternenseemann <sternenseemann@systemli.org> | 2021-10-25 23:27:39 +0200 |
---|---|---|
committer | sternenseemann <sternenseemann@systemli.org> | 2021-10-25 23:27:39 +0200 |
commit | f6ff8f9b5f6262afda1b5f51189c2b6c3b1f1a78 (patch) | |
tree | d69f9bd0ec45e317100d972e0786423da54e8e63 | |
parent | 33e23817482a4b4c61c5f29a58d1294db48fc54f (diff) |
chore: adjust for attoparsec >= 0.14
`parseOnly` now takes a lazy ByteString. This will need a new release for stackage.
-rw-r--r-- | ChangeLog.md | 4 | ||||
-rw-r--r-- | default.nix | 13 | ||||
-rw-r--r-- | gopher-proxy.cabal | 4 | ||||
-rw-r--r-- | gopher-proxy.nix | 10 | ||||
-rw-r--r-- | src/Main.hs | 2 |
5 files changed, 24 insertions, 9 deletions
diff --git a/ChangeLog.md b/ChangeLog.md index 26f8ba0..543e852 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Revision history for gopher-proxy +## 0.1.1.3 -- 2021-10-25 + +* Support (and require) `attoparsec >= 0.14` + ## 0.1.1.1 -- 2017-01-06 * Add missing documentation for `--title` diff --git a/default.nix b/default.nix index 9d84eb9..6a9de9b 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,11 @@ -let pkgs = import <nixpkgs> {}; -in pkgs.haskellPackages.callPackage ./gopher-proxy.nix { } +{ pkgs ? import <nixpkgs> {} }: + +let + hpkgs = pkgs.haskellPackages.override { + overrides = self: super: { + attoparsec = self.attoparsec_0_14_1; + }; + }; +in + +hpkgs.callPackage ./gopher-proxy.nix { } diff --git a/gopher-proxy.cabal b/gopher-proxy.cabal index 9351377..3886128 100644 --- a/gopher-proxy.cabal +++ b/gopher-proxy.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: gopher-proxy -version: 0.1.1.2 +version: 0.1.1.3 synopsis: proxy gopher over http description: @gopher-proxy@ allows to proxy gopher over HTTP, which is mainly useful for HTTP-ifying a specific gopher space. @@ -54,7 +54,7 @@ executable gopher-proxy , bytestring , text , network - , attoparsec + , attoparsec >= 0.14 , errors , mime-types , optparse-applicative diff --git a/gopher-proxy.nix b/gopher-proxy.nix index d943fc4..487bf15 100644 --- a/gopher-proxy.nix +++ b/gopher-proxy.nix @@ -1,17 +1,19 @@ { mkDerivation, attoparsec, base, bytestring, directory, errors -, http-types, lucid, mime-types, network, optparse-applicative -, stdenv, text, wai, warp +, http-types, lib, lucid, mime-types, network, optparse-applicative +, text, wai, warp }: mkDerivation { pname = "gopher-proxy"; - version = "0.1.0.0"; + version = "0.1.1.2"; src = ./.; isLibrary = false; isExecutable = true; + enableSeparateDataOutput = true; executableHaskellDepends = [ attoparsec base bytestring directory errors http-types lucid mime-types network optparse-applicative text wai warp ]; + homepage = "https://github.com/sternenseemann/gopher-proxy"; description = "proxy gopher over http"; - license = stdenv.lib.licenses.gpl3; + license = lib.licenses.gpl3Only; } diff --git a/src/Main.hs b/src/Main.hs index b8bd807..ec67bf1 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -117,7 +117,7 @@ makeGopherRequest cfg req = do hdl <- socketToHandle sock ReadWriteMode hSetBuffering hdl NoBuffering B.hPutStr hdl (req <> "\r\n") - resp <- BS.hGetContents hdl + resp <- B.hGetContents hdl pure $ case parseOnly (gopherResponseParser Nothing) resp of Left _ -> Nothing Right r -> case r of |