haskellPackages.git-annex: patch for http-types >= 0.12.5

This commit is contained in:
sterni 2026-06-23 11:24:47 +02:00
commit 5f8a3af9eb
2 changed files with 57 additions and 0 deletions

View file

@ -687,6 +687,8 @@ with haskellLib;
# TODO(@sternenseemann): submit upstreamable patch resolving this
# (this should be possible by also taking PREFIX into account).
./patches/git-annex-no-usr-prefix.patch
# Fix build with http-types >= 0.12.5, will be part of next release
./patches/git-annex-http-types-0.12.5.patch
];
postPatch = ''

View file

@ -0,0 +1,55 @@
From cc9d0a2e9fd90d0a6f5d228aa17ebf26424ce1f9 Mon Sep 17 00:00:00 2001
From: Joey Hess <joeyh@joeyh.name>
Date: Sat, 6 Jun 2026 11:09:11 -0400
Subject: [PATCH] Fix build with http-types-0.12.5
Depend on http-types >= 0.9, which added 3 headers to
Network.HTTP.Types.Headers. In 0.12.5, those are exported
from Network.HTTP.Types, which conflicted with the
definitions in Utility.Url.
---
diff --git a/Utility/Url.hs b/Utility/Url.hs
index 40fa4832a1..3acbf31e3c 100644
--- a/Utility/Url.hs
+++ b/Utility/Url.hs
@@ -56,6 +56,7 @@ import qualified Utility.FileIO as F
import Network.URI
import Network.HTTP.Types
+import Network.HTTP.Types.Header (hAcceptEncoding, hContentDisposition, hContentRange)
import qualified System.FilePath.Posix as UrlPath
import qualified Data.CaseInsensitive as CI
import qualified Data.ByteString as B
@@ -670,15 +671,6 @@ parseRequestRelaxed u = case uriAuthority u of
u { uriAuthority = Just $ ua { uriPort = "" } }
_ -> parseRequest (show u)
-hAcceptEncoding :: CI.CI B.ByteString
-hAcceptEncoding = "Accept-Encoding"
-
-hContentDisposition :: CI.CI B.ByteString
-hContentDisposition = "Content-Disposition"
-
-hContentRange :: CI.CI B.ByteString
-hContentRange = "Content-Range"
-
resumeFromHeader :: FileSize -> Header
resumeFromHeader sz = (hRange, renderByteRanges [ByteRangeFrom sz])
diff --git a/git-annex.cabal b/git-annex.cabal
index a3557cbfef..bae89052e7 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -233,7 +233,7 @@ Executable git-annex
resourcet,
http-client (>= 0.5.3),
http-client-tls (>= 0.3.2),
- http-types (>= 0.7),
+ http-types (>= 0.9),
http-conduit (>= 2.3.0),
http-client-restricted (>= 0.0.2),
conduit,
--
2.54.0