File tree 1 file changed +27
-2
lines changed
1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 8
8
# When doing development you may want to shut this off to obtain the
9
9
# output file that you need to check in.
10
10
, doOutputDiff ? true
11
+ # Attempts to render every page individually to make sure the dependencies
12
+ # are set correctly.
13
+ , doPageChecks ? true
11
14
} :
12
15
13
16
let
204
207
stdenv . mkDerivation {
205
208
name = "codex32${ shortId } " ;
206
209
207
- buildInputs = if doPdfGeneration then [ ghostscript ] else [ ] ;
210
+ buildInputs = [ ghostscript ] ;
208
211
209
212
phases = [ "buildPhase" ] ;
210
213
buildPhase = ''
211
214
set -e
212
215
216
+ ghostscriptTest() {
217
+ echo "Ghostscript testing $1"
218
+ local output;
219
+ if ! output="$(gs -dNOPAUSE -dNODISPLAY "$1" < /dev/null 2>&1)"; then
220
+ echo "Failed to run ghostscript on $1"
221
+ echo "$output"
222
+ exit 1
223
+ fi
224
+ }
225
+ '' + lib . optionalString doPageChecks toString (
226
+ map
227
+ ( page :
228
+ let
229
+ pageFile = renderBooklet
230
+ {
231
+ name = "test-single-page.ps" ;
232
+ pages = [ page ] ;
233
+ } ;
234
+ in "ghostscriptTest ${ pageFile } \n " )
235
+ fullBooklet . pages ) + ''
236
+ FULL_BW="${ renderBooklet fullBooklet } "
237
+ ghostscriptTest "$FULL_BW"
213
238
mkdir "$out"
214
239
cd "$out"
215
- cp ${ renderBooklet fullBooklet } SSS32.ps
240
+ cp "$FULL_BW" SSS32.ps
216
241
217
242
${ lib . optionalString doOutputDiff "diff -C 5 ${ src } /SSS32.ps SSS32.ps" }
218
243
sed -i 's/(revision \(.*\))/(revision \1${ shortId } )/' ./SSS32.ps
You can’t perform that action at this time.
0 commit comments