Skip to content
Closed
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
20 changes: 19 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
versionedPackageFnWithOverrides = { version, versionSource }:
let pkg =
pkgs.callPackage packageFn {
inherit version versionSource;
inherit version versionSource versionComparison;
};
in
applyOverrides {
Expand Down Expand Up @@ -191,6 +191,24 @@
ruby -e 'require "foobar"; say' > $out
'';
};
}) // (lib.optionalAttrs (with versionComparison rubyVersion; greaterOrEqualTo "3.4") {
"${rubyName}-docSupport" = {
nativeBuildInputs = [
(ruby.override { docSupport = true; })
];
command = ''
HOME=$TMPDIR ri Array > $out
'';
};
}) // (lib.optionalAttrs (with versionComparison rubyVersion; lessThan "3.4") {
"${rubyName}-docSupport-noParallel" = {
nativeBuildInputs = [
(ruby.override { docSupport = true; parallelBuild = false; })
];
command = ''
HOME=$TMPDIR ri Array > $out
'';
};
})
) rubyPackages;

Expand Down
12 changes: 11 additions & 1 deletion ruby/package-fn.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ version
, versionSource
, versionComparison
, libDir ? "${(import ./parse-version.nix version).majMin}.0"
, rubygems ? null
, stdenv
Expand All @@ -25,6 +26,7 @@
, bundler
, bundix
, removeReferencesTo
, parallelBuild ? true
, useRailsExpress ? true
, zlibSupport ? true
, opensslSupport ? true
Expand Down Expand Up @@ -87,7 +89,7 @@ let
propagatedBuildInputs =
(op jemallocSupport jemalloc);

enableParallelBuilding = true;
enableParallelBuilding = parallelBuild;

postPatch = ''
${opString (rubygems != null) ''
Expand All @@ -107,6 +109,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 @@ -195,4 +202,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 @@ -3,6 +3,7 @@
, stdenv
, fetchurl
, fetchpatch
, ...
}:
stdenv.mkDerivation {
pname = "rubygems";
Expand Down
Loading