3
0
Fork 0
forked from mirrors/nixpkgs

Revert "idris: Move library setup to the setup hook."

This reverts commit 69d4adee1f.
This commit is contained in:
Matthew Pickering 2018-02-03 10:12:43 +00:00
parent d74a7506f0
commit 8d55538f97
3 changed files with 23 additions and 23 deletions

View file

@ -3,21 +3,40 @@
# args: Additional arguments to pass to mkDerivation. Generally should include at least
# name and src.
{ stdenv, idris, gmp }: args: stdenv.mkDerivation ({
preHook = ''
# Library import path
export IDRIS_LIBRARY_PATH=$PWD/idris-libs
mkdir -p $IDRIS_LIBRARY_PATH
# Library install path
export IBCSUBDIR=$out/lib/${idris.name}
mkdir -p $IBCSUBDIR
addIdrisLibs () {
if [ -d $1/lib/${idris.name} ]; then
ln -sv $1/lib/${idris.name}/* $IDRIS_LIBRARY_PATH
fi
}
# All run-time deps
addEnvHooks 0 addIdrisLibs
'';
buildPhase = ''
idris --build *.ipkg
${idris}/bin/idris --build *.ipkg
'';
doCheck = true;
checkPhase = ''
if grep -q test *.ipkg; then
idris --testpkg *.ipkg
${idris}/bin/idris --testpkg *.ipkg
fi
'';
installPhase = ''
idris --install *.ipkg --ibcsubdir $IBCSUBDIR
${idris}/bin/idris --install *.ipkg --ibcsubdir $IBCSUBDIR
'';
buildInputs = [ gmp idris ];
buildInputs = [ gmp ];
} // args)

View file

@ -10,8 +10,5 @@ symlinkJoin {
wrapProgram $out/bin/idris \
--suffix PATH : ${ stdenv.lib.makeBinPath path } \
--suffix LIBRARY_PATH : ${stdenv.lib.makeLibraryPath lib}
mkdir -p $out/nix-support
substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook
'';
}

View file

@ -1,16 +0,0 @@
# Library import path
export IDRIS_LIBRARY_PATH=$PWD/idris-libs
mkdir -p $IDRIS_LIBRARY_PATH
# Library install path
export IBCSUBDIR=$out/lib/@name@
mkdir -p $IBCSUBDIR
addIdrisLibs () {
if [ -d $1/lib/@name@ ]; then
ln -sv $1/lib/@name@/* $IDRIS_LIBRARY_PATH
fi
}
# All run-time deps
addEnvHooks 1 addIdrisLibs