ruby: clean up dead code for removed versions

This commit is contained in:
Emily
2025-10-12 15:55:36 +01:00
parent bdd97e316b
commit ee2c39a0f5
2 changed files with 2 additions and 34 deletions

View File

@@ -57,7 +57,6 @@ let
}:
let
ver = version;
atLeast31 = lib.versionAtLeast ver.majMin "3.1";
atLeast32 = lib.versionAtLeast ver.majMin "3.2";
# https://github.com/ruby/ruby/blob/v3_2_2/yjit.h#L21
yjitSupported =
@@ -189,18 +188,10 @@ let
enableParallelInstalling = false;
patches =
op (lib.versionOlder ver.majMin "3.1") ./do-not-regenerate-revision.h.patch
++ op useBaseRuby (
op useBaseRuby (
if atLeast32 then ./do-not-update-gems-baseruby-3.2.patch else ./do-not-update-gems-baseruby.patch
)
++ ops (ver.majMin == "3.0") [
# Ruby 3.0 adds `-fdeclspec` to $CC instead of $CFLAGS. Fixed in later versions.
(fetchpatch {
url = "https://github.com/ruby/ruby/commit/0acc05caf7518cd0d63ab02bfa036455add02346.patch";
hash = "sha256-43hI9L6bXfeujgmgKFVmiWhg7OXvshPCCtQ4TxqK1zk=";
})
]
++ ops atLeast31 [
++ [
# When using a baseruby, ruby always sets "libdir" to the build
# directory, which nix rejects due to a reference in to /build/ in
# the final product. Removing this reference doesn't seem to break

View File

@@ -1,23 +0,0 @@
Do not regenerate revision.h
Ruby's makefile compares the shipped version with the git revision to regenerate
revision.h [1], but since we don't include git in buildInputs, this comparison
fails and it can't find $(REVISION_H).
[1] https://github.com/ruby/ruby/commit/97a5af62a318fcd93a4e5e4428d576c0280ddbae
diff -Naur ruby.old/defs/gmake.mk ruby.new/defs/gmake.mk
--- ruby.old/defs/gmake.mk
+++ ruby.new/defs/gmake.mk
@@ -325,11 +325,9 @@
REVISION_IN_HEADER := $(shell sed -n 's/^\#define RUBY_FULL_REVISION "\(.*\)"/\1/p' $(srcdir)/revision.h 2>/dev/null)
REVISION_LATEST := $(shell $(CHDIR) $(srcdir) && git log -1 --format=%H 2>/dev/null)
-ifneq ($(REVISION_IN_HEADER),$(REVISION_LATEST))
# GNU make treat the target as unmodified when its dependents get
# updated but it is not updated, while others may not.
$(srcdir)/revision.h: $(REVISION_H)
-endif
# Query on the generated rdoc
#