From f2189de2797e391124ead51eada6d57b2929c88f Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sat, 9 Feb 2019 19:46:44 +0100 Subject: Shortcut helper compilation when Cabal version is already available This is mostly an optimization for Nix which already sets up the environment correctly, so we should reward its users :) --- src/CabalHelper/Compiletime/Cabal.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/CabalHelper/Compiletime/Cabal.hs') diff --git a/src/CabalHelper/Compiletime/Cabal.hs b/src/CabalHelper/Compiletime/Cabal.hs index a61b6f6..6477b85 100644 --- a/src/CabalHelper/Compiletime/Cabal.hs +++ b/src/CabalHelper/Compiletime/Cabal.hs @@ -20,7 +20,7 @@ Description : Cabal library source unpacking License : GPL-3 -} -{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE DeriveFunctor, CPP #-} module CabalHelper.Compiletime.Cabal where @@ -36,7 +36,7 @@ import System.FilePath import CabalHelper.Compiletime.Types import CabalHelper.Compiletime.Process -import CabalHelper.Shared.Common (trim, replace) +import CabalHelper.Shared.Common (trim, replace, parseVer) type UnpackedCabalVersion = CabalVersion' (CommitId, CabalSourceDir) type ResolvedCabalVersion = CabalVersion' CommitId @@ -215,3 +215,6 @@ findCabalFile pkgdir = do if takeFileName p == takeExtension p then "" -- just ".cabal" is not a valid cabal file else takeExtension p + +bultinCabalVersion :: Version +bultinCabalVersion = parseVer VERSION_Cabal -- cgit v1.2.3