Skip to content

Commit

Permalink
Apply patches per source version
Browse files Browse the repository at this point in the history
There is no reason to limit patch application to "head" only.
  • Loading branch information
kateinoigakukun committed Jan 29, 2024
1 parent e10aeaf commit d13d659
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/ruby_wasm/packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def support_dynamic_linking?

# Retrieves the root directory of the Ruby project.
# The root directory contains the following stuff:
# * patches/*.patch
# * patches/{source}/*.patch
# * build_manifest.json
# * rubies
# * build
Expand All @@ -84,13 +84,11 @@ def root

# Retrieves the alias definitions for the Ruby sources.
def self.build_source_aliases(root)
patches = Dir[File.join(root, "patches", "*.patch")]
sources = {
"head" => {
type: "github",
repo: "ruby/ruby",
rev: "master",
patches: patches.map { |p| File.expand_path(p) }
rev: "master"
},
"3.3" => {
type: "tarball",
Expand All @@ -101,7 +99,12 @@ def self.build_source_aliases(root)
url: "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.3.tar.gz"
}
}
sources.each { |name, source| source[:name] = name }
sources.each do |name, source|
source[:name] = name
patches = Dir[File.join(root, "patches", name, "*.patch")]
.map { |p| File.expand_path(p) }
source[:patches] = patches
end

build_manifest = File.join(root, "build_manifest.json")
if File.exist?(build_manifest)
Expand Down

0 comments on commit d13d659

Please sign in to comment.