2015-11-27 18:17:17 +00:00
|
|
|
# Build an idris package
|
|
|
|
#
|
|
|
|
# args: Additional arguments to pass to mkDerivation. Generally should include at least
|
|
|
|
# name and src.
|
|
|
|
{ stdenv, idris, gmp }: args: stdenv.mkDerivation ({
|
2015-11-27 14:35:59 +00:00
|
|
|
preHook = ''
|
|
|
|
mkdir idris-libs
|
|
|
|
export IDRIS_LIBRARY_PATH=$PWD/idris-libs
|
|
|
|
|
|
|
|
addIdrisLibs () {
|
|
|
|
if [ -d $1/lib/${idris.name} ]; then
|
|
|
|
ln -sv $1/lib/${idris.name}/* $IDRIS_LIBRARY_PATH
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
envHooks+=(addIdrisLibs)
|
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
export TARGET=$out/lib/${idris.name}
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
${idris}/bin/idris --build *.ipkg
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
if grep -q test *.ipkg; then
|
|
|
|
${idris}/bin/idris --testpkg *.ipkg
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
${idris}/bin/idris --install *.ipkg
|
|
|
|
'';
|
2015-11-27 16:03:04 +00:00
|
|
|
|
|
|
|
buildInputs = [ gmp ];
|
2015-11-27 18:17:17 +00:00
|
|
|
} // args)
|