idrisPackages.build-idris-package: Install binaries

This commit is contained in:
Silvan Mosberger 2019-04-28 16:54:32 +02:00
parent 24f15a7f9e
commit adfd54a8f2
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7

View File

@ -53,8 +53,20 @@ stdenv.mkDerivation ({
installPhase = ''
runHook preInstall
idris --install ${ipkgName}.ipkg --ibcsubdir $out/libs
IDRIS_DOC_PATH=$out/doc idris --installdoc ${ipkgName}.ipkg || true
# If the ipkg file defines an executable, install that
executable=$(grep -Po '^executable = \K.*' ${ipkgName}.ipkg || true)
# $executable intentionally not quoted because it must be quoted correctly
# in the ipkg file already
if [ ! -z "$executable" ] && [ -f $executable ]; then
mkdir -p $out/bin
mv $executable $out/bin/$executable
fi
runHook postInstall
'';