Skip to content

Commit c747849

Browse files
patrickdocMikolaj
authored andcommitted
Add support for Cabal-syntax
1 parent 678c7b6 commit c747849

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

example-client/example-client.cabal

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ flag use-network-uri
1717
description: Are we using network-uri?
1818
manual: False
1919

20+
flag Cabal-syntax
21+
description: Are we using Cabal-syntax?
22+
manual: False
23+
default: False
24+
2025
executable example-client
2126
main-is: Main.hs
2227
other-modules: Prelude ExampleClient.Options
2328

2429
build-depends: base >= 4.5 && < 4.15,
2530
bytestring >= 0.9,
26-
Cabal >= 1.12,
2731
directory >= 1.1,
2832
filepath >= 1.2,
2933
optparse-applicative >= 0.11,
@@ -48,3 +52,9 @@ executable example-client
4852
network >= 2.6 && < 3.2
4953
else
5054
build-depends: network >= 2.5 && < 2.6
55+
56+
if flag(Cabal-syntax)
57+
build-depends: Cabal-syntax >= 3.7 && < 3.9
58+
else
59+
build-depends: Cabal >= 1.12 && < 3.7,
60+
Cabal-syntax < 3.7

hackage-repo-tool/hackage-repo-tool.cabal

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ flag use-old-time
3939
description: Are we using @old-time@?
4040
manual: False
4141

42+
flag Cabal-syntax
43+
description: Are we using Cabal-syntax?
44+
manual: False
45+
default: False
46+
4247
executable hackage-repo-tool
4348
hs-source-dirs: src
4449
main-is: Main.hs
@@ -53,9 +58,6 @@ executable hackage-repo-tool
5358
-- the respective GHC release
5459
build-depends: base >= 4.5 && < 4.15,
5560
bytestring >= 0.9 && < 0.12,
56-
Cabal >= 1.14 && < 1.26
57-
|| >= 2.0 && < 2.6
58-
|| >= 3.0 && < 3.4,
5961
directory >= 1.1 && < 1.4,
6062
filepath >= 1.3 && < 1.5,
6163
time >= 1.4 && < 1.10
@@ -84,6 +86,14 @@ executable hackage-repo-tool
8486
else
8587
build-depends: network >= 2.5 && < 2.6
8688

89+
if flag(Cabal-syntax)
90+
build-depends: Cabal-syntax >= 3.7 && < 3.9
91+
else
92+
build-depends: Cabal >= 1.14 && < 1.26
93+
|| >= 2.0 && < 2.6
94+
|| >= 3.0 && < 3.7,
95+
Cabal-syntax < 3.7
96+
8797

8898
default-language: Haskell2010
8999
default-extensions: DeriveDataTypeable

hackage-security/hackage-security.cabal

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ flag use-network-uri
4848
description: Are we using @network-uri@?
4949
manual: False
5050

51+
flag Cabal-syntax
52+
description: Are we using Cabal-syntax?
53+
manual: False
54+
default: False
55+
5156
flag old-directory
5257
description: Use @directory@ < 1.2 and @old-time@
5358
manual: False
@@ -114,9 +119,6 @@ library
114119
base16-bytestring >= 0.1.1 && < 1.1,
115120
base64-bytestring >= 1.0 && < 1.3,
116121
bytestring >= 0.9 && < 0.12,
117-
Cabal >= 1.14 && < 1.26
118-
|| >= 2.0 && < 2.6
119-
|| >= 3.0 && < 3.8,
120122
containers >= 0.4 && < 0.7,
121123
ed25519 >= 0.0 && < 0.1,
122124
filepath >= 1.2 && < 1.5,
@@ -149,6 +151,14 @@ library
149151
else
150152
build-depends: base >= 4.10
151153

154+
if flag(Cabal-syntax)
155+
build-depends: Cabal-syntax >= 3.7 && < 3.9
156+
else
157+
build-depends: Cabal >= 1.14 && < 1.26
158+
|| >= 2.0 && < 2.6
159+
|| >= 3.0 && < 3.7,
160+
Cabal-syntax < 3.7
161+
152162
hs-source-dirs: src
153163
default-language: Haskell2010
154164
default-extensions: DefaultSignatures
@@ -258,6 +268,9 @@ test-suite TestSuite
258268
time,
259269
zlib
260270

271+
if flag(Cabal-syntax)
272+
build-depends: Cabal-syntax
273+
261274
-- dependencies exclusive to test-suite
262275
build-depends: tasty >= 1.2 && < 1.5,
263276
tasty-hunit == 0.10.*,

0 commit comments

Comments
 (0)