core/pkgs/by-name/py/python/hooks/conda-install-hook.sh

28 lines
722 B
Bash
Raw Normal View History

2024-05-02 00:46:19 +00:00
# Setup hook to use in case a conda binary package is installed
echo "Sourcing conda install hook"
condaInstallPhase(){
echo "Executing condaInstallPhase"
runHook preInstall
# There are two different formats of conda packages.
# It either contains only a site-packages directory
# or multiple top level directories.
siteDir=@pythonSitePackages@
if [ -e ./site-packages ]; then
mkdir -p $out/$siteDir
cp -r ./site-packages/* $out/$siteDir
else
cp -r . $out
rm $out/env-vars
fi
runHook postInstall
echo "Finished executing condaInstallPhase"
}
if [ -z "${installPhase-}" ]; then
echo "Using condaInstallPhase"
installPhase=condaInstallPhase
fi