[Hackage] #209: Implement "package()" configurations predicate

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: Linux | ----------------------------+----------------------------------------------- We often have to write things like: {{{ flag splitBase description: Choose the new smaller, split-up base package. library if flag(splitBase) build-depends: base >= 3, containers else build-depends: base < 3 }}} Which is verbose and annoying. It would be nicer to say: {{{ library build-depends: base if package(base >= 3) build-depends: containers }}} This is syntactic sugar only. It translates into the existing constructs so no new behaviour is being introduced. It would translate into: {{{ flag _1 library build-depends: base if flag(_1) build-depends: base >= 3 build-depends: containers else build-depends: base < 3 }}} It is described in more detail in this thread: http://www.haskell.org/pipermail/cabal-devel/2007-October/001189.html http://www.haskell.org/pipermail/cabal-devel/2007-November/001336.html -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * difficulty: normal => hard (< 1 day) * platform: Linux => * milestone: => Cabal-1.4 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: nominolo Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * owner: => nominolo -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: nominolo Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross@soi.city.ac.uk): Another variant would be to support anonymous flags directly, allowing a syntax like: {{{ library if _ build-depends: base >= 3, containers else build-depends: base < 3 }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: nominolo Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Replying to [comment:3 ross@soi.city.ac.uk]:
Another variant would be to support anonymous flags directly
True though I suspect it looks a bit weird to the uninitiated. We know to read the conditional syntax as an implication constraint which can be applied in either direction but I suspect many people read it in a directed functional way. I have a feeling that the anonymous flag would really throw people :-) Perhaps we should ask opinions on the libraries list. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: nominolo Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.6 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * milestone: Cabal-1.4 => Cabal-1.6 Comment: Punting. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: nominolo Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.8 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * milestone: Cabal-1.6 => Cabal-1.8 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:6 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#209: Implement "package()" configurations predicate ----------------------------+----------------------------------------------- Reporter: duncan | Owner: nominolo Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.8 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Of course if we want it for `build-depends` then we may also want it for other dependencies like `pkgconfig-depends` or `build-tools`. So we should bear that in mind in designing a syntax. For example darcs might like to use: {{{ pkgconfig-depends: libcurl if pkgconfig-depends(libcurl >= 7.19.1) -- curl 7.19.1 has bug-free pipelining cpp-options: -DCURL_PIPELINING_DEFAULT }}} as syntactic sugar for: {{{ flag curl-pipelining description: Use libcurl's HTTP pipelining. ... pkgconfig-depends: libcurl if flag(curl-pipelining) -- curl 7.19.1 has bug-free pipelining pkgconfig-depends: libcurl >= 7.19.1 cpp-options: -DCURL_PIPELINING_DEFAULT else pkgconfig-depends: libcurl < 7.19.1 }}} Note of course the above doesn't work well yet anyway, it needs #342 to be implemented. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/209#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage