Compare commits

...

29 Commits

Author SHA1 Message Date
Justin Bedo
7fa5f84179 R: use replace-fail for substitutions 2026-08-22 09:00:14 +10:00
Justin Bedo
91d8de0e1b rPackages: clean up installFlags and NIX_CFLAGS_COMPILE 2026-08-20 16:11:56 +10:00
Justin Bedő
befba536a5 R: prepend instead of overriding TCLLIBPATH (#553675) 2026-08-20 04:15:40 +00:00
Justin Bedő
84b2cfe60e rPackages.{mongolite,openssl,websocket}: link openssl via pkg-config (#553654) 2026-08-20 04:15:18 +00:00
TomaSajt
8ade1f069e rPackages: properly handle passed buildInputs 2026-08-19 10:48:42 +02:00
Justin Bedo
3921cb2f52 rPackages.ModelMetrics: fix missing openmp dependency 2026-08-19 15:12:39 +10:00
Justin Bedo
c4f343e091 rPackages.data_table: fix missing openmp dependency 2026-08-19 15:12:39 +10:00
Justin Bedo
f12c2fc819 rPackages: include libintl on darwin 2026-08-19 15:12:38 +10:00
TomaSajt
180812aa8b rPackages.rpanel: add tclPackages.bwidget to search path on load 2026-08-17 19:01:23 +02:00
TomaSajt
99e50baea2 R: prepend instead of overriding TCLLIBPATH 2026-08-17 18:31:22 +02:00
TomaSajt
5e7cdb6263 rPackages.{mongolite,openssl,websocket}: link openssl via pkg-config 2026-08-17 15:06:36 +02:00
TomaSajt
375523bb1a rPackages.immunotation: clean up patches 2026-08-17 16:22:49 +10:00
TomaSajt
3300252793 rPackages.Rserve: use symlink instead of copying to $out 2026-08-17 16:22:49 +10:00
TomaSajt
9e4efccb2b rPackages.httpuv: use system libuv 2026-08-17 16:22:49 +10:00
Justin Bedő
e15bd38348 rPackages: strip binaries in common locations (#552718) 2026-08-17 06:11:04 +00:00
Justin Bedő
d0d54e1ad4 rPackages.buildRPackage: remove unneeded deps (#552702) 2026-08-17 06:10:14 +00:00
TomaSajt
16eadf108d rPackages: add more empty list default logic 2026-08-15 12:09:05 +02:00
TomaSajt
1966470456 rPackages.buildRPackage: remove unneeded deps 2026-08-15 11:53:59 +02:00
Justin Bedő
18a6b995b9 rPackages.buildRPackage: fix structuredAttrs support (#552725) 2026-08-15 03:07:36 +00:00
TomaSajt
f2a6351124 rPackages.buildRPackage: fix structuredAttrs support 2026-08-15 01:15:51 +02:00
TomaSajt
cef26c7c61 rPackages: strip binaries in common locations 2026-08-14 19:30:41 +02:00
TomaSajt
fd8ab89e5d rPackages.iscream: remove unused filtering logic 2026-08-14 10:58:09 +02:00
Justin Bedő
c76bc9e733 rPackages: don't put R deps into nativeBuildInputs (#552398) 2026-08-14 00:07:55 +00:00
Justin Bedő
3f975f295a rPackages.iscream: fix build with more robust filtering (#552391) 2026-08-14 00:04:32 +00:00
TomaSajt
3ecb4f82d3 rPackages: don't put R deps into nativeBuildInputs 2026-08-13 21:54:24 +02:00
TomaSajt
dd497f7abd rPackages.iscream: fix build with more robust filtering 2026-08-13 21:44:11 +02:00
TomaSajt
21bc93c967 rPackages.buildRPackage: enable __structuredAttrs 2026-08-12 16:31:08 +02:00
TomaSajt
e34a43b2fa rPackages.buildRPackage: enable strictDeps 2026-08-12 16:30:19 +02:00
TomaSajt
3f79d0dd24 rPackages.buildRPackage: refactor 2026-08-12 16:28:47 +02:00
5 changed files with 187 additions and 136 deletions

View File

@@ -117,11 +117,11 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/NixOS/nixpkgs/issues/146131
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure \
--replace "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
--replace "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
--replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
--replace-fail "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
--replace-fail "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
--replace-fail "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
substituteInPlace tests/Examples/Makefile.in \
--replace "test-Examples: test-Examples-Base" "test-Examples:" # do not test the examples
--replace-fail "test-Examples: test-Examples-Base" "test-Examples:" # do not test the examples
'';
dontDisableStatic = static;
@@ -163,8 +163,8 @@ stdenv.mkDerivation (finalAttrs: {
''
+ ''
)
echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib"
echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo"
echo >>etc/Renviron.in 'TCLLIBPATH="${tk}/lib ''${TCLLIBPATH}"'
echo >>etc/Renviron.in 'TZDIR=${tzdata}/share/zoneinfo'
'';
installTargets = [

View File

@@ -25,7 +25,6 @@ let
buildRPackage = pkgs.callPackage ./generic-builder.nix {
inherit R;
inherit (pkgs) gettext gfortran;
};
# Generates package templates given per-repository settings
@@ -64,7 +63,6 @@ let
};
inherit doCheck requireX;
propagatedBuildInputs = depends;
nativeBuildInputs = depends;
meta.homepage = mkHomepage (args // { inherit name; });
meta.platforms = platforms;
meta.hydraPlatforms = hydraPlatforms;
@@ -142,7 +140,7 @@ let
#
# {
# foo = old.foo.overrideAttrs (attrs: {
# nativeBuildInputs = attrs.nativeBuildInputs ++ [ pkgs.bar ];
# nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.bar ];
# });
# }
overrideNativeBuildInputs =
@@ -150,7 +148,7 @@ let
lib.mapAttrs (
name: value:
(builtins.getAttr name old).overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ value;
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ value;
})
) overrides;
@@ -165,7 +163,7 @@ let
#
# {
# foo = old.foo.overrideAttrs (attrs: {
# buildInputs = attrs.buildInputs ++ [ pkgs.bar ];
# buildInputs = (attrs.buildInputs or [ ]) ++ [ pkgs.bar ];
# });
# }
overrideBuildInputs =
@@ -173,7 +171,7 @@ let
lib.mapAttrs (
name: value:
(builtins.getAttr name old).overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ value;
buildInputs = (attrs.buildInputs or [ ]) ++ value;
})
) overrides;
@@ -211,7 +209,6 @@ let
#
# {
# foo = old.foo.overrideAttrs (attrs: {
# nativeBuildInputs = attrs.nativeBuildInputs ++ [ self.bar ];
# propagatedBuildInputs = attrs.propagatedBuildInputs ++ [ self.bar ];
# });
# }
@@ -220,7 +217,6 @@ let
lib.mapAttrs (
name: value:
(builtins.getAttr name old).overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ value;
propagatedBuildInputs = (attrs.propagatedBuildInputs or [ ]) ++ value;
})
) overrides;
@@ -434,7 +430,6 @@ let
JMcmprsk = [ pkgs.gsl ]; # for gsl-config
KSgeneral = with pkgs; [ pkg-config ];
LCMCR = [ pkgs.gsl ]; # for gsl-config
ModelMetrics = lib.optional stdenv.hostPlatform.isDarwin pkgs.llvmPackages.openmp;
PEPBVS = [ pkgs.gsl ]; # for gsl-config
PICS = [ pkgs.gsl ];
QF = [ pkgs.gsl ]; # for gsl-config
@@ -616,13 +611,7 @@ let
pkgs.which
pkgs.cmake
];
data_table = (
# added extra parentheses so that `keep-sorted` doesn't get tripped up
[
pkgs.pkg-config
]
++ lib.optional stdenv.hostPlatform.isDarwin pkgs.llvmPackages.openmp
);
data_table = [ pkgs.pkg-config ];
datefixR = with pkgs; [
cargo
rustc
@@ -721,6 +710,7 @@ let
pkgs.which
pkgs.cmake
];
httpuv = [ pkgs.pkg-config ];
hypergeo2 = [ pkgs.pkg-config ];
iBMQ = [ pkgs.gsl ]; # for gsl-config
image_textlinedetector = [ pkgs.pkg-config ];
@@ -766,6 +756,7 @@ let
mixlink = [ pkgs.gsl ]; # for gsl-config
mixture = [ pkgs.gsl ]; # for gsl-config
mmpca = [ pkgs.gsl ]; # for gsl-config via RcppGSL
mongolite = [ pkgs.pkg-config ];
monoreg = [ pkgs.gsl ]; # for gsl-config
multibridge = [ pkgs.pkg-config ];
mvabund = [ pkgs.gsl ]; # for gsl-config via RcppGSL
@@ -786,6 +777,7 @@ let
];
odbc = [ pkgs.pkg-config ];
opencv = [ pkgs.pkg-config ];
openssl = [ pkgs.pkg-config ];
orbweaver = with pkgs; [
cargo
rustc
@@ -857,7 +849,6 @@ let
cargo
rustc
];
rpanel = [ pkgs.tclPackages.bwidget ];
rrd = [ pkgs.pkg-config ];
rsamplr = with pkgs; [
cargo
@@ -985,6 +976,7 @@ let
rustc
];
webp = [ pkgs.pkg-config ];
websocket = [ pkgs.pkg-config ];
xactonomial = with pkgs; [
cargo
rustc
@@ -1082,6 +1074,7 @@ let
ncurses
zlib
];
ModelMetrics = lib.optional stdenv.hostPlatform.isDarwin pkgs.llvmPackages.openmp;
NanoMethViz = [ pkgs.zlib ];
OpenCL = with pkgs; [
opencl-clhpp
@@ -1300,7 +1293,13 @@ let
curl
];
curl = [ pkgs.curl ];
data_table = [ pkgs.zlib ];
data_table = (
# added extra parentheses so that `keep-sorted` doesn't get tripped up
[
pkgs.zlib
]
++ lib.optional stdenv.hostPlatform.isDarwin pkgs.llvmPackages.openmp
);
deepSNV = with pkgs; [
xz
bzip2
@@ -1378,7 +1377,10 @@ let
hadron = [ pkgs.gsl ];
haven = [ pkgs.zlib ];
hipread = [ pkgs.zlib ];
httpuv = [ pkgs.zlib ];
httpuv = with pkgs; [
libuv
zlib
];
hypergeo2 = with pkgs; [
gmp
mpfr
@@ -1477,6 +1479,11 @@ let
zlib
];
mixcat = [ pkgs.gsl ];
mongolite = with pkgs; [
cyrus_sasl
openssl
zlib
];
multibridge = [ pkgs.mpfr ];
mutscan = [ pkgs.zlib ];
mvabund = [ pkgs.gsl ];
@@ -1494,6 +1501,7 @@ let
npRmpi = [ pkgs.mpi ];
odbc = [ pkgs.unixodbc ];
oligo = [ pkgs.zlib ];
openssl = [ pkgs.openssl ];
otelsdk = with pkgs; [
curl
protobuf
@@ -1770,6 +1778,7 @@ let
];
vdiffr = [ pkgs.libpng ];
webp = [ pkgs.libwebp ];
websocket = [ pkgs.openssl ];
writexl = with pkgs; [ zlib ];
xdvir = [ pkgs.freetype ];
xml2 = [ pkgs.libxml2 ];
@@ -2010,7 +2019,7 @@ let
ACME = old.ACME.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
# Avoid incompatible pointer type error
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -Wno-incompatible-pointer-types";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-incompatible-pointer-types";
};
});
@@ -2025,7 +2034,7 @@ let
BiocParallel = old.BiocParallel.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
NIX_CFLAGS_COMPILE =
attrs.env.NIX_CFLAGS_COMPILE
attrs.env.NIX_CFLAGS_COMPILE or ""
+ lib.optionalString stdenv.hostPlatform.isDarwin " -Wno-error=missing-template-arg-list-after-template-kw";
};
});
@@ -2063,7 +2072,7 @@ let
FlexReg = old.FlexReg.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
# needed to avoid "log limit exceeded" on Hydra
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -Wno-ignored-attributes";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-ignored-attributes";
};
# consumes a lot of resources in parallel
@@ -2092,7 +2101,7 @@ let
ModelMetrics = old.ModelMetrics.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
NIX_CFLAGS_COMPILE =
attrs.env.NIX_CFLAGS_COMPILE + lib.optionalString stdenv.hostPlatform.isDarwin " -fopenmp";
attrs.env.NIX_CFLAGS_COMPILE or "" + lib.optionalString stdenv.hostPlatform.isDarwin " -fopenmp";
};
});
@@ -2107,7 +2116,7 @@ let
OpenMx = old.OpenMx.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
# needed to avoid "log limit exceeded" on Hydra
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -Wno-ignored-attributes";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-ignored-attributes";
};
});
@@ -2193,15 +2202,15 @@ let
Rhdf5lib =
let
hdf5 = pkgs.hdf5.overrideAttrs (attrs: {
cmakeFlags = attrs.cmakeFlags ++ [ "-DHDF5_ENABLE_ROS3_VFD:BOOL=TRUE" ];
buildInputs = attrs.buildInputs ++ [ pkgs.curl ];
postInstall = attrs.postInstall or "" + ''
cmakeFlags = (attrs.cmakeFlags or [ ]) ++ [ "-DHDF5_ENABLE_ROS3_VFD:BOOL=TRUE" ];
buildInputs = (attrs.buildInputs or [ ]) ++ [ pkgs.curl ];
postInstall = (attrs.postInstall or "") + ''
cp src/libhdf5.settings $dev/lib
'';
});
in
old.Rhdf5lib.overrideAttrs (attrs: {
propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
propagatedBuildInputs = (attrs.propagatedBuildInputs or [ ]) ++ [
hdf5
pkgs.libaec
];
@@ -2222,16 +2231,26 @@ let
Rrdrand = old.Rrdrand.override { platforms = lib.platforms.x86_64 ++ lib.platforms.x86; };
Rserve = old.Rserve.overrideAttrs (attrs: {
patches = [ ./patches/Rserve.patch ];
configureFlags = [
"--with-server"
"--with-client"
];
patches = [
# Don't try to copy the Rserve binaries into $R_HOME/bin
./patches/Rserve.patch
];
# Instead, we symlink them into $out/bin
postInstall = ''
mkdir -p "$out/bin/"
ln -s "$out"/library/Rserve/libs/Rserve{,.dbg} "$out/bin/"
'';
});
SAIGEgds = old.SAIGEgds.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -fpermissive";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -fpermissive";
};
});
@@ -2372,7 +2391,7 @@ let
src = pkgs.arrow-cpp.src;
name = "r-arrow-${pkgs.arrow-cpp.version}";
prePatch = "cd r";
buildInputs = attrs.buildInputs ++ [
buildInputs = (attrs.buildInputs or [ ]) ++ [
pkgs.arrow-cpp
];
});
@@ -2391,7 +2410,7 @@ let
data_table = old.data_table.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -fopenmp";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -fopenmp";
};
});
@@ -2443,7 +2462,7 @@ let
});
geojsonio = old.geojsonio.overrideAttrs (attrs: {
buildInputs = [ cacert ] ++ attrs.buildInputs;
buildInputs = (attrs.buildInputs or [ ]) ++ [ cacert ];
});
geomorph = old.geomorph.overrideAttrs (attrs: {
@@ -2456,7 +2475,7 @@ let
env = (attrs.env or { }) // {
# Avoid incompatible pointer type error
NIX_CFLAGS_COMPILE =
attrs.env.NIX_CFLAGS_COMPILE
attrs.env.NIX_CFLAGS_COMPILE or ""
+ " -Wno-implicit-function-declaration -Wno-incompatible-pointer-types";
};
});
@@ -2485,8 +2504,8 @@ let
});
hdf5r = old.hdf5r.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ new.Rhdf5lib.hdf5 ];
buildInputs = attrs.buildInputs ++ [ new.Rhdf5lib.hdf5 ];
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ new.Rhdf5lib.hdf5 ];
buildInputs = (attrs.buildInputs or [ ]) ++ [ new.Rhdf5lib.hdf5 ];
});
immunotation =
@@ -2514,25 +2533,26 @@ let
};
in
old.immunotation.overrideAttrs (attrs: {
patches = [ ./patches/immunotation.patch ];
postPatch = ''
substituteInPlace "R/external_resources_input.R" --replace-fail \
"nix-NetMHCpan-4.1-allele-list" ${MHC41alleleList}
substituteInPlace "R/external_resources_input.R" --replace-fail \
"nix-NETMHCIIpan-4.0-alleles-name-list" ${MHCII40alleleList}
substituteInPlace "R/AFND_interface.R" --replace-fail \
"nix-valid-geographics" ${validGeographics}
'';
patches = [
(pkgs.replaceVars ./patches/immunotation.patch {
"mhc41_allele_list" = MHC41alleleList;
"mhcii40_alleles_name_list" = MHCII40alleleList;
"valid_geographics" = validGeographics;
})
];
});
iscream = old.iscream.overrideAttrs (attrs: {
# https://huishenlab.github.io/iscream/articles/htslib.html
# Rhtslib (in LinkingTo) is not needed if we provide a proper htslib
propagatedBuildInputs =
builtins.filter (el: el != pkgs.rPackages.Rhtslib) attrs.propagatedBuildInputs
++ [ pkgs.htslib ];
propagatedBuildInputs = builtins.filter (el: el.pname != "Rhtslib") attrs.propagatedBuildInputs;
buildInputs = (attrs.buildInputs or [ ]) ++ [ pkgs.htslib ];
postPatch = ''
substituteInPlace "DESCRIPTION" \
--replace-fail ", Rhtslib" ""
'';
});
littler = old.littler.overrideAttrs (attrs: {
@@ -2561,14 +2581,7 @@ let
metahdep = old.metahdep.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
# Avoid incompatible pointer type error
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -Wno-int-conversion";
};
});
mongolite = old.mongolite.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
PKGCONFIG_CFLAGS = "-I${lib.getDev pkgs.openssl}/include -I${lib.getDev pkgs.cyrus_sasl}/include -I${lib.getDev pkgs.zlib}/include";
PKGCONFIG_LIBS = "-Wl,-rpath,${lib.getLib pkgs.openssl}/lib -L${lib.getLib pkgs.openssl}/lib -L${pkgs.cyrus_sasl.out}/lib -L${pkgs.zlib.out}/lib -lssl -lcrypto -lsasl2 -lz";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-int-conversion";
};
});
@@ -2595,7 +2608,7 @@ let
networkscaleup = old.networkscaleup.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
# needed to avoid "log limit exceeded" on Hydra
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -Wno-ignored-attributes";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-ignored-attributes";
};
# consumes a lot of resources in parallel
@@ -2613,14 +2626,15 @@ let
});
in
old.opencv.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ opencvGtk ];
buildInputs = (attrs.buildInputs or [ ]) ++ [ opencvGtk ];
});
openssl = old.openssl.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
PKGCONFIG_CFLAGS = "-I${lib.getDev pkgs.openssl}/include";
PKGCONFIG_LIBS = "-Wl,-rpath,${lib.getLib pkgs.openssl}/lib -L${lib.getLib pkgs.openssl}/lib -lssl -lcrypto";
};
# RPATH will be incorrect if the configure script replaces -lssl with -l:libssl.so.{n}
postPatch = ''
substituteInPlace configure \
--replace-fail 'PKG_LIBS="''${PKG_LIBS_VERSIONED}"' ':'
'';
});
pak = old.pak.overrideAttrs (attrs: {
@@ -2752,7 +2766,8 @@ let
rhdf5 = old.rhdf5.overrideAttrs (attrs: {
patches = [ ./patches/rhdf5.patch ];
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
env.NIX_CFLAGS_COMPILE =
attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-error=implicit-function-declaration";
});
rhdf5filters = old.rhdf5filters.overrideAttrs (attrs: {
@@ -2779,24 +2794,25 @@ let
});
rpanel = old.rpanel.overrideAttrs (attrs: {
preConfigure = ''
export TCLLIBPATH="${pkgs.tclPackages.bwidget}/lib/bwidget${pkgs.tclPackages.bwidget.version}"
postPatch = ''
cat >> R/zzz.R <<EOF
.onLoad <- function(...) {
tcltk::tcl("lappend", "auto_path", "${pkgs.tclPackages.bwidget}/lib/bwidget${pkgs.tclPackages.bwidget.version}")
}
EOF
'';
env = (attrs.env or { }) // {
TCLLIBPATH = "${pkgs.tclPackages.bwidget}/lib/bwidget${pkgs.tclPackages.bwidget.version}";
};
});
rstan = old.rstan.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION";
};
});
rstanarm = old.rstanarm.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
# needed to avoid "log limit exceeded" on Hydra
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -Wno-ignored-attributes";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -Wno-ignored-attributes";
};
});
@@ -2914,15 +2930,16 @@ let
});
websocket = old.websocket.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
PKGCONFIG_CFLAGS = "-I${lib.getDev pkgs.openssl}/include";
PKGCONFIG_LIBS = "-Wl,-rpath,${lib.getLib pkgs.openssl}/lib -L${lib.getLib pkgs.openssl}/lib -lssl -lcrypto";
};
# RPATH will be incorrect if the configure script replaces -lssl with -l:libssl.so.{n}
postPatch = ''
substituteInPlace configure \
--replace-fail 'PKG_LIBS="''${PKG_LIBS_VERSIONED}"' ':'
'';
});
xslt = old.xslt.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + " -fpermissive";
NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE or "" + " -fpermissive";
};
});
# keep-sorted end

View File

@@ -4,38 +4,48 @@
R,
xvfb-run,
util-linux,
gettext,
gfortran,
libiconv,
libintl,
}:
{
buildInputs ? [ ],
requireX ? false,
...
}@attrs:
attrs:
stdenv.mkDerivation (
finalAttrs:
{
buildInputs =
buildInputs
__structuredAttrs = true;
strictDeps = true;
name = "r-${attrs.name or "${attrs.pname}-${attrs.version}"}";
requireX = false;
nativeBuildInputs =
(attrs.nativeBuildInputs or [ ])
++ [
R
gettext
]
++ lib.optionals requireX [
++ lib.optionals finalAttrs.requireX [
util-linux
xvfb-run
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
gfortran
libiconv
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1";
buildInputs =
(attrs.buildInputs or [ ])
++ lib.optionals stdenv.hostPlatform.isDarwin [
libintl
];
enableParallelBuilding = true;
env =
(attrs.env or { })
// (lib.optionalAttrs (stdenv.hostPlatform.isDarwin) {
NIX_CFLAGS_COMPILE = "${
attrs.env.NIX_CFLAGS_COMPILE or ""
} -I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1";
});
configurePhase = ''
runHook preConfigure
@@ -54,35 +64,65 @@ stdenv.mkDerivation (
runHook postBuild
'';
installFlags = if attrs.doCheck or true then [ ] else [ "--no-test-load" ];
doCheck = true;
checkPhase = ''
# noop since R CMD INSTALL tests packages
'';
rCommand =
if requireX then
if finalAttrs.requireX then
# Unfortunately, xvfb-run has a race condition even with -a option, so that
# we acquire a lock explicitly.
"flock ${xvfb-run} xvfb-run -a -e xvfb-error R"
else
"R";
installFlags = (attrs.installFlags or [ ]) ++ (lib.optional (!finalAttrs.doCheck) "--no-test-load");
installPhase = ''
runHook preInstall
mkdir -p $out/library
$rCommand CMD INSTALL --built-timestamp='1970-01-01 00:00:00 UTC' $installFlags --configure-args="$configureFlags" -l $out/library .
mkdir -p "$out/library"
# logic inside R CMD INSTALL essentially just expands `./configure $configureArgs` and runs it in a system shell
# so we need to escape configureFlags if we want to support things like spaces in arguments
local configureArgs=""
if ((''${#configureFlags[@]})); then
printf -v configureArgs '%q ' "''${configureFlags[@]}"
fi
$rCommand CMD INSTALL \
--library="$out/library" \
--built-timestamp='1970-01-01 00:00:00 UTC' \
--configure-args="$configureArgs" \
"''${installFlags[@]}" \
.
runHook postInstall
'';
stripDebugList = [
"library/${attrs.pname}/libs"
# Note: this is non-standard, but some packages do place binaries here via custom install logic (e.g. via install.libs.R)
"library/${attrs.pname}/bin"
];
postFixup = ''
if test -e $out/nix-support/propagated-build-inputs; then
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
fi
'';
checkPhase = ''
# noop since R CMD INSTALL tests packages
'';
}
// attrs
// {
name = "r-${attrs.name or "${attrs.pname}-${attrs.version}"}";
''
+ (attrs.postFixup or "");
}
// (lib.removeAttrs attrs [
# list of attrs that have custom logic for combining the default and the passed values
# if not listed, the passed value will override the default value
"name"
"nativeBuildInputs"
"buildInputs"
"env"
"installFlags"
"postFixup"
])
)

View File

@@ -1,15 +1,13 @@
diff -ru -x '*~' Rserve_orig/src/Makevars.in Rserve/src/Makevars.in
--- Rserve_orig/src/Makevars.in 2013-08-22 06:09:33.000000000 +0900
+++ Rserve/src/Makevars.in 2014-11-09 21:36:31.184590320 +0900
@@ -12,8 +12,9 @@
$(CC) -DSTANDALONE_RSERVE -DRSERV_DEBUG -DNODAEMON -I. -Iinclude $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(PKG_CPPFLAGS) $(PKG_CFLAGS) -o Rserve.dbg $(SERVER_SRC) $(ALL_LIBS) $(PKG_LIBS)
diff --git a/src/Makevars.in b/src/Makevars.in
index e20c4eb..1013e21 100644
--- a/src/Makevars.in
+++ b/src/Makevars.in
@@ -14,8 +14,6 @@ server: $(SERVER_SRC) $(SERVER_H)
$(CC) -DSTANDALONE_RSERVE -DRSERV_DEBUG -DNODAEMON -I. -Iinclude $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(PKG_CPPFLAGS) $(EMBED_CPPFLAGS) $(PKG_CFLAGS) -o Rserve.dbg $(SERVER_SRC) $(LDFLAGS) $(ALL_LIBS) $(PKG_LIBS)
# merging to bin/Rserve works only if installed from sources, won't work for binary
- -./mergefat Rserve "$(R_HOME)/bin/Rserve"
- -./mergefat Rserve.dbg "$(R_HOME)/bin/Rserve.dbg"
+ mkdir $(out)/bin
+ -./mergefat Rserve "$(out)/bin/Rserve"
+ -./mergefat Rserve.dbg "$(out)/bin/Rserve.dbg"
client: config.h
cp config.h client/cxx/

View File

@@ -2,38 +2,34 @@ diff --git a/R/AFND_interface.R b/R/AFND_interface.R
index b62e8e0..0f22d85 100644
--- a/R/AFND_interface.R
+++ b/R/AFND_interface.R
@@ -244,9 +244,9 @@ check_population <- function(hla_population) {
@@ -244,8 +244,8 @@ check_population <- function(hla_population) {
#' @return list of valid countries, regions and ethnic origin
#' @keywords internal
get_valid_geographics <- function() {
- url <- "http://www.allelefrequencies.net/hla6006a.asp?"
- html_input <- getURL(url, read_method = "html")
-
+ # http://www.allelefrequencies.net/hla6006a.asp?
+ html_input <- xml2::read_html("nix-valid-geographics")
+
+ html_input <- xml2::read_html("@valid_geographics@")
rvest_tables <- rvest::html_table(html_input, fill = TRUE)
# country
diff --git a/R/external_resources_input.R b/R/external_resources_input.R
index c4b1dc1..8fc5881 100644
--- a/R/external_resources_input.R
+++ b/R/external_resources_input.R
@@ -74,16 +74,17 @@ getURL <- function(URL, N.TRIES=2L,
@@ -74,16 +74,16 @@ getURL <- function(URL, N.TRIES=2L,
# MHC I
# netmhcI_input_template is an internal variable containing list of valid
# NetMHCpan input alleles
-netmhcI_input_template <- getURL(
- URL="https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list",
- read_method = "delim", delim = "\t",
- col_names = c("netmhc_input", "hla_chain_name", "HLA_gene"))
+netmhcI_input_template <- readr::read_delim(
+ # https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list
+ "nix-NetMHCpan-4.1-allele-list",
+ delim = "\t",
+ skip = 0,
+ col_names = c("netmhc_input", "hla_chain_name", "HLA_gene")
+ )
+ # https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list
+ "@mhc41_allele_list@",
+ delim = "\t",
+ skip = 0,
col_names = c("netmhc_input", "hla_chain_name", "HLA_gene"))
# MHC II
-lines <- getURL(
@@ -41,7 +37,7 @@ index c4b1dc1..8fc5881 100644
- "NetMHCIIpan-4.0/alleles_name.list"),
- read_method = "lines")
+# https://services.healthtech.dtu.dk/services/NetMHCIIpan-4.0/alleles_name.list
+lines <- readr::read_lines("nix-NETMHCIIpan-4.0-alleles-name-list")
+lines <- readr::read_lines("@mhcii40_alleles_name_list@")
lines_rep <- stringr::str_replace_all(lines, "\t+|\\s\\s+", "\t")
netmhcII_input_template <- suppressWarnings(
suppressMessages(read.delim(textConnection(lines_rep), sep = "\t")))