1 { stdenv, lib, R, libcxx, xvfb_run, util-linux, Cocoa, Foundation, gettext, gfortran }:
3 { name, buildInputs ? [], requireX ? false, ... } @ attrs:
6 buildInputs = buildInputs ++ [R gettext] ++
7 lib.optionals requireX [util-linux xvfb_run] ++
8 lib.optionals stdenv.isDarwin [Cocoa Foundation gfortran];
11 lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1";
15 export R_LIBS_SITE="$R_LIBS_SITE''${R_LIBS_SITE:+:}$out/library"
24 installFlags = if attrs.doCheck or true then
29 rCommand = if requireX then
30 # Unfortunately, xvfb-run has a race condition even with -a option, so that
31 # we acquire a lock explicitly.
32 "flock ${xvfb_run} xvfb-run -a -e xvfb-error R"
39 $rCommand CMD INSTALL $installFlags --configure-args="$configureFlags" -l $out/library .
44 if test -e $out/nix-support/propagated-build-inputs; then
45 ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
50 # noop since R CMD INSTALL tests packages