Skip to content

Commit 69d4ade

Browse files
committedJan 21, 2018
idris: Move library setup to the setup hook.
This was broken in preHook because addEnvHooks isn't defined yet.
1 parent 58ff18b commit 69d4ade

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed
 

Diff for: ‎pkgs/development/idris-modules/build-idris-package.nix

+4-23
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,21 @@
33
# args: Additional arguments to pass to mkDerivation. Generally should include at least
44
# name and src.
55
{ stdenv, idris, gmp }: args: stdenv.mkDerivation ({
6-
preHook = ''
7-
# Library import path
8-
export IDRIS_LIBRARY_PATH=$PWD/idris-libs
9-
mkdir -p $IDRIS_LIBRARY_PATH
10-
11-
# Library install path
12-
export IBCSUBDIR=$out/lib/${idris.name}
13-
mkdir -p $IBCSUBDIR
14-
15-
addIdrisLibs () {
16-
if [ -d $1/lib/${idris.name} ]; then
17-
ln -sv $1/lib/${idris.name}/* $IDRIS_LIBRARY_PATH
18-
fi
19-
}
20-
21-
# All run-time deps
22-
addEnvHooks 0 addIdrisLibs
23-
'';
24-
256
buildPhase = ''
26-
${idris}/bin/idris --build *.ipkg
7+
idris --build *.ipkg
278
'';
289

2910
doCheck = true;
3011

3112
checkPhase = ''
3213
if grep -q test *.ipkg; then
33-
${idris}/bin/idris --testpkg *.ipkg
14+
idris --testpkg *.ipkg
3415
fi
3516
'';
3617

3718
installPhase = ''
38-
${idris}/bin/idris --install *.ipkg --ibcsubdir $IBCSUBDIR
19+
idris --install *.ipkg --ibcsubdir $IBCSUBDIR
3920
'';
4021

41-
buildInputs = [ gmp ];
22+
buildInputs = [ gmp idris ];
4223
} // args)

Diff for: ‎pkgs/development/idris-modules/idris-wrapper.nix

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ symlinkJoin {
99
wrapProgram $out/bin/idris \
1010
--suffix PATH : ${ stdenv.lib.makeBinPath path } \
1111
--suffix LIBRARY_PATH : ${stdenv.lib.makeLibraryPath lib}
12+
13+
mkdir -p $out/nix-support
14+
substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook
1215
'';
1316
}
1417

Diff for: ‎pkgs/development/idris-modules/setup-hook.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Library import path
2+
export IDRIS_LIBRARY_PATH=$PWD/idris-libs
3+
mkdir -p $IDRIS_LIBRARY_PATH
4+
5+
# Library install path
6+
export IBCSUBDIR=$out/lib/@name@
7+
mkdir -p $IBCSUBDIR
8+
9+
addIdrisLibs () {
10+
if [ -d $1/lib/@name@ ]; then
11+
ln -sv $1/lib/@name@/* $IDRIS_LIBRARY_PATH
12+
fi
13+
}
14+
15+
# All run-time deps
16+
addEnvHooks 1 addIdrisLibs

2 commit comments

Comments
 (2)

shlevy commented on Jan 21, 2018

@shlevy
MemberAuthor

@Ericson2314 Is it intentional that addEnvHooks is defined after preHook is run?

Ericson2314 commented on Jan 21, 2018

@Ericson2314
Member

No it is not. Meant to make a mass rebuild about this but didn't yet.

Please sign in to comment.