echo "Checking that ghc binary exists in deb at ${debUsed.exePathForLibraryCheck}"
if ! test -e ${debUsed.exePathForLibraryCheck}; then
echo >&2 "GHC binary ${debUsed.exePathForLibraryCheck} could not be found in the deb unpack directory for arch ${stdenv.hostPlatform.system}, please check that ghcDebs correctly reflect the deb dependencies!"; exit 1;
fi
''
(lib.concatMapStringsSep"\n"(
{fileToCheckFor,nixPackage}:
lib.optionalString(fileToCheckFor!=null)''
echo "Checking deb for ${fileToCheckFor} to ensure that is still used"
if ! readelf -d ${debUsed.exePathForLibraryCheck} | grep "${fileToCheckFor}"; then
echo >&2 "File ${fileToCheckFor} could not be found in ${debUsed.exePathForLibraryCheck} for arch ${stdenv.hostPlatform.system}, please check that ghcDebs correctly reflect the deb dependencies!"; exit 1;
fi
echo "Checking that the nix package ${nixPackage} contains ${fileToCheckFor}"
if ! test -e "${lib.getLibnixPackage}/lib/${fileToCheckFor}"; then
echo >&2 "Nix package ${nixPackage} did not contain ${fileToCheckFor} for arch ${stdenv.hostPlatform.system}, please check that ghcDebs correctly reflect the deb dependencies!"; exit 1;
fi
''
)debUsed.archSpecificLibraries)
]
)
# Linking to non-compiler libraries requires GHC to know about our non-FHS paths for those libraries