dev-haskell/mtl-compat: infer flags to pick proper mtl
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 20 Sep 2015 13:57:22 +0000 (14:57 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 20 Sep 2015 18:50:17 +0000 (19:50 +0100)
Package-Manager: portage-2.2.20

dev-haskell/mtl-compat/mtl-compat-0.2.1.3.ebuild

index c674552dde1327d086a8e6c83b9b63020897f392..86551f3e7a38ea59b9dac75e95480c040d46b5cf 100644 (file)
@@ -25,3 +25,17 @@ RDEPEND=">=dev-haskell/mtl-2.1:=[profile?] <dev-haskell/mtl-2.3:=[profile?]
 DEPEND="${RDEPEND}
        >=dev-haskell/cabal-1.8
 "
+
+src_configure() {
+       local mtl_arg=()
+
+       has_version '>=dev-haskell/mtl-2.0.1' && \
+               has_version '<dev-haskell/mtl-2.2' && \
+               mtl_arg+=(--flag=two-point-one)
+       has_version '>=dev-haskell/mtl-2.2.0.1' && \
+               has_version '<dev-haskell/mtl-2.2.1' && \
+               mtl_arg+=(--flag=two-point-two)
+
+       haskell-cabal_src_configure \
+               ${mtl_arg}
+}