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
import Distribution.Version
( Version(versionBranch) )
import Distribution.PackageDescription
( PackageDescription )
( PackageDescription ( package ) )
import Distribution.Simple.LocalBuildInfo
( LocalBuildInfo(withPrograms), externalPackageDeps
, localComponentId, localCompatPackageKey )
......@@ -47,9 +47,10 @@ import Distribution.Text
-- | The contents of the @cabal_macros.h@ for the given configured package.
--
generate :: PackageDescription -> LocalBuildInfo -> String
generate _pkg_descr lbi =
generate pkg_descr lbi =
"/* 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) ++
generateComponentIdMacro lbi
......
Markdown is supported
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