Skip to content

Commit d13d659

Browse files
Apply patches per source version
There is no reason to limit patch application to "head" only.
1 parent e10aeaf commit d13d659

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/ruby_wasm/packager.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def support_dynamic_linking?
6262

6363
# Retrieves the root directory of the Ruby project.
6464
# The root directory contains the following stuff:
65-
# * patches/*.patch
65+
# * patches/{source}/*.patch
6666
# * build_manifest.json
6767
# * rubies
6868
# * build
@@ -84,13 +84,11 @@ def root
8484

8585
# Retrieves the alias definitions for the Ruby sources.
8686
def self.build_source_aliases(root)
87-
patches = Dir[File.join(root, "patches", "*.patch")]
8887
sources = {
8988
"head" => {
9089
type: "github",
9190
repo: "ruby/ruby",
92-
rev: "master",
93-
patches: patches.map { |p| File.expand_path(p) }
91+
rev: "master"
9492
},
9593
"3.3" => {
9694
type: "tarball",
@@ -101,7 +99,12 @@ def self.build_source_aliases(root)
10199
url: "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.3.tar.gz"
102100
}
103101
}
104-
sources.each { |name, source| source[:name] = name }
102+
sources.each do |name, source|
103+
source[:name] = name
104+
patches = Dir[File.join(root, "patches", name, "*.patch")]
105+
.map { |p| File.expand_path(p) }
106+
source[:patches] = patches
107+
end
105108

106109
build_manifest = File.join(root, "build_manifest.json")
107110
if File.exist?(build_manifest)

0 commit comments

Comments
 (0)