From 555d90c43202d5a3021893013bfc8e2ffff58c97 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Thu, 16 Feb 2023 13:38:54 +0100 Subject: [PATCH] Support Cabal 3. hsSourceDirs is now a list of SymbolicPath instead of FilePath. --- tensorflow-core-ops/Setup.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tensorflow-core-ops/Setup.hs b/tensorflow-core-ops/Setup.hs index 0b34b2b..51aea90 100644 --- a/tensorflow-core-ops/Setup.hs +++ b/tensorflow-core-ops/Setup.hs @@ -28,6 +28,9 @@ import Distribution.Simple , simpleUserHooks , UserHooks(..) ) +#if MIN_VERSION_Cabal(3,1,0) +import Distribution.Utils.Path (unsafeMakeSymbolicPath) +#endif import Data.List (intercalate) import Data.ProtoLens (decodeMessage) import System.Directory (createDirectoryIfMissing) @@ -81,7 +84,11 @@ fudgePackageDesc lbi p = p } where fudgeBuildInfo bi = +#if MIN_VERSION_Cabal(3,1,0) + bi { hsSourceDirs = unsafeMakeSymbolicPath (autogenModulesDir lbi) : hsSourceDirs bi } +#else bi { hsSourceDirs = autogenModulesDir lbi : hsSourceDirs bi } +#endif blackList = [ -- Requires the "func" type: