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

View File

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

View File

@@ -4,38 +4,48 @@
R, R,
xvfb-run, xvfb-run,
util-linux, util-linux,
gettext, libintl,
gfortran,
libiconv,
}: }:
{ attrs:
buildInputs ? [ ],
requireX ? false,
...
}@attrs:
stdenv.mkDerivation ( stdenv.mkDerivation (
finalAttrs:
{ {
buildInputs = __structuredAttrs = true;
buildInputs strictDeps = true;
name = "r-${attrs.name or "${attrs.pname}-${attrs.version}"}";
requireX = false;
nativeBuildInputs =
(attrs.nativeBuildInputs or [ ])
++ [ ++ [
R R
gettext
] ]
++ lib.optionals requireX [ ++ lib.optionals finalAttrs.requireX [
util-linux util-linux
xvfb-run 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; 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 = '' configurePhase = ''
runHook preConfigure runHook preConfigure
@@ -54,35 +64,65 @@ stdenv.mkDerivation (
runHook postBuild runHook postBuild
''; '';
installFlags = if attrs.doCheck or true then [ ] else [ "--no-test-load" ]; doCheck = true;
checkPhase = ''
# noop since R CMD INSTALL tests packages
'';
rCommand = rCommand =
if requireX then if finalAttrs.requireX then
# Unfortunately, xvfb-run has a race condition even with -a option, so that # Unfortunately, xvfb-run has a race condition even with -a option, so that
# we acquire a lock explicitly. # we acquire a lock explicitly.
"flock ${xvfb-run} xvfb-run -a -e xvfb-error R" "flock ${xvfb-run} xvfb-run -a -e xvfb-error R"
else else
"R"; "R";
installFlags = (attrs.installFlags or [ ]) ++ (lib.optional (!finalAttrs.doCheck) "--no-test-load");
installPhase = '' installPhase = ''
runHook preInstall 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 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 = '' postFixup = ''
if test -e $out/nix-support/propagated-build-inputs; then 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 fi
''; ''
+ (attrs.postFixup or "");
checkPhase = ''
# noop since R CMD INSTALL tests packages
'';
}
// attrs
// {
name = "r-${attrs.name or "${attrs.pname}-${attrs.version}"}";
} }
// (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 diff --git a/src/Makevars.in b/src/Makevars.in
--- Rserve_orig/src/Makevars.in 2013-08-22 06:09:33.000000000 +0900 index e20c4eb..1013e21 100644
+++ Rserve/src/Makevars.in 2014-11-09 21:36:31.184590320 +0900 --- a/src/Makevars.in
@@ -12,8 +12,9 @@ +++ b/src/Makevars.in
$(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) @@ -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 # merging to bin/Rserve works only if installed from sources, won't work for binary
- -./mergefat Rserve "$(R_HOME)/bin/Rserve" - -./mergefat Rserve "$(R_HOME)/bin/Rserve"
- -./mergefat Rserve.dbg "$(R_HOME)/bin/Rserve.dbg" - -./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 client: config.h
cp config.h client/cxx/ 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 index b62e8e0..0f22d85 100644
--- a/R/AFND_interface.R --- a/R/AFND_interface.R
+++ b/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 #' @return list of valid countries, regions and ethnic origin
#' @keywords internal #' @keywords internal
get_valid_geographics <- function() { get_valid_geographics <- function() {
- url <- "http://www.allelefrequencies.net/hla6006a.asp?" - url <- "http://www.allelefrequencies.net/hla6006a.asp?"
- html_input <- getURL(url, read_method = "html") - html_input <- getURL(url, read_method = "html")
-
+ # http://www.allelefrequencies.net/hla6006a.asp? + # 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) rvest_tables <- rvest::html_table(html_input, fill = TRUE)
# country
diff --git a/R/external_resources_input.R b/R/external_resources_input.R diff --git a/R/external_resources_input.R b/R/external_resources_input.R
index c4b1dc1..8fc5881 100644 index c4b1dc1..8fc5881 100644
--- a/R/external_resources_input.R --- a/R/external_resources_input.R
+++ b/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 # MHC I
# netmhcI_input_template is an internal variable containing list of valid # netmhcI_input_template is an internal variable containing list of valid
# NetMHCpan input alleles # NetMHCpan input alleles
-netmhcI_input_template <- getURL( -netmhcI_input_template <- getURL(
- URL="https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list", - URL="https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list",
- read_method = "delim", delim = "\t", - read_method = "delim", delim = "\t",
- col_names = c("netmhc_input", "hla_chain_name", "HLA_gene"))
+netmhcI_input_template <- readr::read_delim( +netmhcI_input_template <- readr::read_delim(
+ # https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list + # https://services.healthtech.dtu.dk/services/NetMHCpan-4.1/allele.list
+ "nix-NetMHCpan-4.1-allele-list", + "@mhc41_allele_list@",
+ delim = "\t", + delim = "\t",
+ skip = 0, + skip = 0,
+ col_names = c("netmhc_input", "hla_chain_name", "HLA_gene") col_names = c("netmhc_input", "hla_chain_name", "HLA_gene"))
+ )
# MHC II # MHC II
-lines <- getURL( -lines <- getURL(
@@ -41,7 +37,7 @@ index c4b1dc1..8fc5881 100644
- "NetMHCIIpan-4.0/alleles_name.list"), - "NetMHCIIpan-4.0/alleles_name.list"),
- read_method = "lines") - read_method = "lines")
+# https://services.healthtech.dtu.dk/services/NetMHCIIpan-4.0/alleles_name.list +# 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") lines_rep <- stringr::str_replace_all(lines, "\t+|\\s\\s+", "\t")
netmhcII_input_template <- suppressWarnings( netmhcII_input_template <- suppressWarnings(
suppressMessages(read.delim(textConnection(lines_rep), sep = "\t"))) suppressMessages(read.delim(textConnection(lines_rep), sep = "\t")))