registerPackage
  :: Verbosity
  -> InstalledPackageInfo
  -> PackageDescription
  -> LocalBuildInfo
  -> Bool
  -> PackageDBStack
  -> IO ()
registerPackage verbosity installedPkgInfo pkg lbi inplace _packageDbs = do
  --TODO: prefer to have it based on the packageDbs, but how do we know
  -- the package subdir based on the name? the user can set crazy libsubdir
  let installDirs = absoluteInstallDirs pkg lbi NoCopyDest
      pkgdir  | inplace   = buildDir lbi
              | otherwise = libdir installDirs
  createDirectoryIfMissingVerbose verbosity True pkgdir
  writeUTF8File (pkgdir </> "package.conf")
                (showInstalledPackageInfo installedPkgInfo)
registerPackage
  :: Verbosity
  -> InstalledPackageInfo
  -> PackageDescription
  -> LocalBuildInfo
  -> Bool
  -> PackageDBStack
  -> IO ()
registerPackage verbosity installedPkgInfo pkg lbi inplace _packageDbs = do
  --TODO: prefer to have it based on the packageDbs, but how do we know
  -- the package subdir based on the name? the user can set crazy libsubdir
  let installDirs = absoluteInstallDirs pkg lbi NoCopyDest
      pkgdir  | inplace   = buildDir lbi
              | otherwise = libdir installDirs
  createDirectoryIfMissingVerbose verbosity True pkgdir
  writeUTF8File (pkgdir </> "package.conf")
                (showInstalledPackageInfo installedPkgInfo)
registerPackage verbosity installedPkgInfo pkg lbi inplace _packageDbs = do
  --TODO: prefer to have it based on the packageDbs, but how do we know
  -- the package subdir based on the name? the user can set crazy libsubdir
  let installDirs = absoluteInstallDirs pkg lbi NoCopyDest
      pkgdir  | inplace   = buildDir lbi
              | otherwise = libdir installDirs
  createDirectoryIfMissingVerbose verbosity True pkgdir
  writeUTF8File (pkgdir </> "package.conf")
                (showInstalledPackageInfo installedPkgInfo)