From c4658ac0a4ebb8a5a5f5fd4305479d9f3ee7f714 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Fri, 9 Feb 2018 13:34:19 +0900 Subject: [PATCH] rPackages.pbdZMQ: fix package loading on Darwin --- pkgs/development/r-modules/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 4510308d3e56..ee1fb24b3098 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -285,7 +285,7 @@ let pbdMPI = [ pkgs.openmpi ]; pbdNCDF4 = [ pkgs.netcdf ]; pbdPROF = [ pkgs.openmpi ]; - pbdZMQ = [ pkgs.which ]; + pbdZMQ = lib.optionals stdenv.isDarwin [ pkgs.which ]; pdftools = [ pkgs.poppler.dev ]; PKI = [ pkgs.openssl.dev ]; png = [ pkgs.libpng.dev ]; @@ -393,6 +393,7 @@ let nat = [ pkgs.which ]; nat_nblast = [ pkgs.which ]; nat_templatebrains = [ pkgs.which ]; + pbdZMQ = lib.optionals stdenv.isDarwin [ pkgs.binutils.bintools ]; RMark = [ pkgs.which ]; RPushbullet = [ pkgs.which ]; qtpaint = [ pkgs.cmake ]; @@ -776,6 +777,14 @@ let PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas"; }); + pbdZMQ = old.pbdZMQ.overrideDerivation (attrs: { + postPatch = lib.optionalString stdenv.isDarwin '' + for file in R/*.{r,r.in}; do + sed -i 's#system("which \(\w\+\)"[^)]*)#"${pkgs.binutils.bintools}/bin/\1"#g' $file + done + ''; + }); + qtbase = old.qtbase.overrideDerivation (attrs: { patches = [ ./patches/qtbase.patch ]; });