Commit cc63fbf9 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Add current pkg info to generated `cabal_macros.h` file

Add the version string macro for the package currently being built
to the generated `dist/build/autogen/cabal_macros.h` file. Perviously
this file only contained the version strings of all the dependent
packages, but not the version string of the package itself.
parent 9198e618
...@@ -29,7 +29,7 @@ import Distribution.Package ...@@ -29,7 +29,7 @@ import Distribution.Package
import Distribution.Version import Distribution.Version
( Version(versionBranch) ) ( Version(versionBranch) )
import Distribution.PackageDescription import Distribution.PackageDescription
( PackageDescription ) ( PackageDescription ( package ) )
import Distribution.Simple.LocalBuildInfo import Distribution.Simple.LocalBuildInfo
( LocalBuildInfo(withPrograms), externalPackageDeps ( LocalBuildInfo(withPrograms), externalPackageDeps
, localComponentId, localCompatPackageKey ) , localComponentId, localCompatPackageKey )
...@@ -47,9 +47,10 @@ import Distribution.Text ...@@ -47,9 +47,10 @@ import Distribution.Text
-- | The contents of the @cabal_macros.h@ for the given configured package. -- | The contents of the @cabal_macros.h@ for the given configured package.
-- --
generate :: PackageDescription -> LocalBuildInfo -> String generate :: PackageDescription -> LocalBuildInfo -> String
generate _pkg_descr lbi = generate pkg_descr lbi =
"/* DO NOT EDIT: This file is automatically generated by Cabal */\n\n" ++ "/* DO NOT EDIT: This file is automatically generated by Cabal */\n\n" ++
generatePackageVersionMacros (map snd (externalPackageDeps lbi)) ++ generatePackageVersionMacros
(package pkg_descr : map snd (externalPackageDeps lbi)) ++
generateToolVersionMacros (configuredPrograms . withPrograms $ lbi) ++ generateToolVersionMacros (configuredPrograms . withPrograms $ lbi) ++
generateComponentIdMacro lbi generateComponentIdMacro lbi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment