File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change 12
12
13
13
let
14
14
binName = "gcd-vcs-simulator" ;
15
+ vcsWrapper = out : ''
16
+ # We need to carefully handle string escape here, so don't use makeWrapper
17
+ tee $out/bin/${ binName } <<EOF
18
+ #!${ bash } /bin/bash
19
+ export LD_LIBRARY_PATH="$out/lib/${ binName } .daidir:\$LD_LIBRARY_PATH"
20
+ _argv="\$@"
21
+ ${ vcs-fhs-env } /bin/vcs-fhs-env -c "$out/lib/${ binName } \$_argv"
22
+ EOF
23
+ chmod +x $out/bin/${ binName }
24
+ '' ;
15
25
in
16
26
stdenv . mkDerivation ( finalAttr : {
17
27
name = "vcs" ;
@@ -58,9 +68,15 @@ stdenv.mkDerivation (finalAttr: {
58
68
inherit rtl ;
59
69
60
70
tests . simple-sim = runCommand "${ binName } -test" { __noChroot = true ; } ''
71
+ mkdir -p $out/bin
72
+ cp -r ${ finalAttr . finalPackage } /lib $out/lib
73
+
74
+ ${ vcsWrapper "$out" }
75
+
61
76
# Combine stderr and stdout and redirect them to tee
62
77
# So that we can have log saving to output and also printing to stdout
63
- ${ finalAttr . finalPackage } /bin/${ binName } &> >(tee $out)
78
+ ls -l $out/lib
79
+ $out/bin/${ binName } &> >(tee $out/result.log)
64
80
'' ;
65
81
} ;
66
82
@@ -76,14 +92,7 @@ stdenv.mkDerivation (finalAttr: {
76
92
cp ${ binName } $out/lib
77
93
cp -r ${ binName } .daidir $out/lib
78
94
79
- # We need to carefully handle string escape here, so don't use makeWrapper
80
- tee $out/bin/${ binName } <<EOF
81
- #!${ bash } /bin/bash
82
- export LD_LIBRARY_PATH="$out/lib/${ binName } .daidir:\$LD_LIBRARY_PATH"
83
- _argv="\$@"
84
- ${ vcs-fhs-env } /bin/vcs-fhs-env -c "$out/lib/${ binName } \$_argv"
85
- EOF
86
- chmod +x $out/bin/${ binName }
95
+ ${ vcsWrapper "$out" }
87
96
88
97
runHook postInstall
89
98
'' ;
You can’t perform that action at this time.
0 commit comments