mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
idris: Move library setup to the setup hook.
This was broken in preHook because addEnvHooks isn't defined yet.
This commit is contained in:
parent
58ff18b6b5
commit
69d4adee1f
@ -3,40 +3,21 @@
|
||||
# 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}/bin/idris --build *.ipkg
|
||||
idris --build *.ipkg
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkPhase = ''
|
||||
if grep -q test *.ipkg; then
|
||||
${idris}/bin/idris --testpkg *.ipkg
|
||||
idris --testpkg *.ipkg
|
||||
fi
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
${idris}/bin/idris --install *.ipkg --ibcsubdir $IBCSUBDIR
|
||||
idris --install *.ipkg --ibcsubdir $IBCSUBDIR
|
||||
'';
|
||||
|
||||
buildInputs = [ gmp ];
|
||||
buildInputs = [ gmp idris ];
|
||||
} // args)
|
||||
|
@ -9,6 +9,9 @@ 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
|
||||
'';
|
||||
}
|
||||
|
||||
|
16
pkgs/development/idris-modules/setup-hook.sh
Normal file
16
pkgs/development/idris-modules/setup-hook.sh
Normal file
@ -0,0 +1,16 @@
|
||||
# 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
|
Loading…
Reference in New Issue
Block a user