Merge pull request #72058 from nh2/r-static-library

R: Add enableShared/enableStatic arguments
This commit is contained in:
Peter Simons 2019-10-30 13:31:52 +01:00 committed by GitHub
commit 3bc76218a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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