Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Revision history for jailbreak-cabal

## 1.4.1

* Support building with `Cabal >= 3.14`. Adjustment for API changes that should not
change behavior. See [#25](https://github.com/NixOS/jailbreak-cabal/pull/25).

## 1.4

* jailbreak-cabal will now also relax version constraints on `build-tool-depends`.
Expand Down
18 changes: 17 additions & 1 deletion Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,28 @@ import Distribution.PackageDescription.Parsec
import Distribution.PackageDescription.PrettyPrint
import Distribution.Types.ExeDependency
import Distribution.Types.LegacyExeDependency
#if MIN_VERSION_Cabal_syntax(3,14,0)
import Distribution.Utils.Path
#endif
import Distribution.Verbosity
import Distribution.Version
import System.Environment

main :: IO ()
main = getArgs >>= mapM_ (\cabalFile -> readGenericPackageDescription silent cabalFile >>= writeGenericPackageDescription cabalFile . stripVersionRestrictions)
main = getArgs >>= mapM_ jailbreakFile

jailbreakFile :: FilePath -> IO ()
jailbreakFile cabalFile =
readGenericPackageDescription silent
#if MIN_VERSION_Cabal(3,14,0)
-- Do not give a CWD directory, so the working dir of the process is used (like before).
-- Note: Passing a CWD directory is inadvisable since writeGenericPackageDescription
-- does not support it, so we'd get differing behavior.
Nothing (makeSymbolicPath cabalFile)
#else
cabalFile
#endif
>>= writeGenericPackageDescription cabalFile . stripVersionRestrictions

-- We don't relax version restrictions inside conditional statements.
-- See https://github.com/peti/jailbreak-cabal/commit/99eac40deb481b185fd93fd307625369ff5e1ec0
Expand Down
2 changes: 1 addition & 1 deletion jailbreak-cabal.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: jailbreak-cabal
version: 1.4
version: 1.4.1
synopsis: Strip version restrictions from Cabal files
description: Strip version restrictions from build dependencies in Cabal files.
category: Distribution
Expand Down