@@ -4,6 +4,9 @@
44, curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch
55, withRecommendedPackages ? true
66, enableStrictBarrier ? false
7+# R as of writing does not support outputting both .so and .a files; it outputs:
8+# --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
9+, static ? false
710, javaSupport ? (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64)
811}:
912
@@ -33,6 +36,8 @@ stdenv.mkDerivation rec {
3336 substituteInPlace configure --replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
3437 '';
3538
39+ dontDisableStatic = static;
40+
3641 preConfigure = ''
3742 configureFlagsArray=(
3843 --disable-lto
@@ -47,7 +52,7 @@ stdenv.mkDerivation rec {
4752 --with-libtiff
4853 --with-ICU
4954 ${stdenv.lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
50− --enable-R-shlib
55+ ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
5156 AR=$(type -p ar)
5257 AWK=$(type -p gawk)
5358 CC=$(type -p cc)