Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{ version, versionSource }:
let
pkg = pkgs.callPackage packageFn {
inherit version versionSource;
inherit version versionSource versionComparison;
};
in
applyOverrides {
Expand Down Expand Up @@ -219,6 +219,29 @@
'';
};
})
// (lib.optionalAttrs (with versionComparison rubyVersion; greaterOrEqualTo "3.4") {
docSupport = {
nativeBuildInputs = [
(ruby.override { docSupport = true; })
];
command = ''
HOME=$TMPDIR ri Array > $out
'';
};
})
// (lib.optionalAttrs (with versionComparison rubyVersion; lessThan "3.4") {
docSupport-noParallel = {
nativeBuildInputs = [
(ruby.override {
docSupport = true;
parallelBuild = false;
})
];
command = ''
HOME=$TMPDIR ri Array > $out
'';
};
})
// (lib.optionalAttrs (with versionComparison rubyVersion; greaterOrEqualTo "2.2") {
bundlerEnv =
let
Expand Down
18 changes: 15 additions & 3 deletions ruby/package-fn.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
version,
versionSource,
versionSource
, versionComparison
,
libDir ? "${(import ./parse-version.nix version).majMin}.0",
rubygems ? null,
stdenv,
Expand All @@ -25,7 +27,9 @@
buildEnv,
bundler,
bundix,
removeReferencesTo,
removeReferencesTo
, parallelBuild ? true
,
useRailsExpress ? true,
zlibSupport ? true,
opensslSupport ? true,
Expand Down Expand Up @@ -89,7 +93,7 @@ let
]);
propagatedBuildInputs = (op jemallocSupport jemalloc);

enableParallelBuilding = true;
enableParallelBuilding = parallelBuild;

postPatch = ''
${opString (rubygems != null) ''
Expand All @@ -109,6 +113,11 @@ let

preConfigure = ''
sed -i configure -e 's/;; #(/\n;;/g'
${opString docSupport ''
# rdoc creates XDG_DATA_DIR (defaulting to $HOME/.local/share) even if
# it's not going to be used.
export HOME=$TMPDIR
''}
'';

configureFlags =
Expand Down Expand Up @@ -200,4 +209,7 @@ let
};
};
in
# There's a known race condition when building with docs enabled before Ruby 3.4.0
# Building documents requires parallelBuild to be false in those versions
assert docSupport -> (with versionComparison version; greaterOrEqualTo "3.4.0" || !parallelBuild);
self
1 change: 1 addition & 0 deletions rubygems/package-fn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
stdenv,
fetchurl,
fetchpatch,
...
}:
stdenv.mkDerivation {
pname = "rubygems";
Expand Down