Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit 6d7bdc8

Browse files
committed
Update to work with Cabal >= 2.0.0
* hptool/src/OS/Win.hs * For Cabal >= 2.0.0, update where/how we get the package id
1 parent 330be7b commit 6d7bdc8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hptool/src/OS/Win.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import Development.Shake.FilePath
1515
import qualified Distribution.InstalledPackageInfo as C
1616
#endif
1717
import qualified Distribution.Package as C
18+
#if MIN_VERSION_Cabal(2,0,0)
19+
import qualified Distribution.Text as C ( display )
20+
#endif
1821

1922
import Dirs
2023
import LocalCommand
@@ -26,7 +29,10 @@ import Paths
2629
import Types
2730
import Utils
2831

29-
#if MIN_VERSION_Cabal(1,24,0)
32+
#if MIN_VERSION_Cabal(2,0,0)
33+
getPkgId :: C.HasUnitId pkg => pkg -> String
34+
getPkgId pkg = C.display $ C.installedUnitId pkg
35+
#elif MIN_VERSION_Cabal(1,24,0)
3036
getPkgId :: C.HasUnitId pkg => pkg -> String
3137
getPkgId pkg = case C.installedUnitId pkg of
3238
C.SimpleUnitId (C.ComponentId s) -> s

0 commit comments

Comments
 (0)