Skip to content

Commit

Permalink
fix: remove redundant call to dllwrap for Pass2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Feb 11, 2025
1 parent 734e453 commit a738700
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
3 changes: 0 additions & 3 deletions lib/tebako/packager/pass1_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ def patch_map

private

include Tebako::Packager::PatchBuildsystem

def gnumakefile_in_patch_p1 # rubocop:disable Metrics/MethodLength
objext = @ruby_ver.ruby32? ? "$(OBJEXT)" : "@OBJEXT@"
{
Expand All @@ -208,7 +206,6 @@ def gnumakefile_in_patch_p1 # rubocop:disable Metrics/MethodLength
"$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.#{objext} $(WINMAINOBJ) # tebako patched",

"$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@" =>

"$(WINMAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ # tebako patched",

"--output-exp=$(RUBY_EXP) \\" => "# tebako patched --output-exp=$(RUBY_EXP) \\",
Expand Down
16 changes: 16 additions & 0 deletions lib/tebako/packager/patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@
# Tebako - an executable packager
module Tebako
module Packager
# Substitutions for cygwin/Gnumakefile.in shared across Pass1 and Pass2
GNUMAKEFILE_IN_DLLTOOL_SUBST = <<~SUBST
$(Q) dlltool --output-lib=$(LIBRUBY) --output-def=tebako.def --export-all $(LIBRUBY_A) --output-exp=$(RUBY_EXP) # tebako patched
SUBST

# This MSYS specific thing ensure compilation of winmain.c
# Did try to understand why it did not work out of the box
GNUMAKEFILE_IN_WINMAIN_SUBST = <<~SUBST
RUBYDEF = $(DLL_BASE_NAME).def
# Start of tebako patch
WINMAINOBJ = win32/winmain.$(OBJEXT)
$(WINMAINOBJ): win32/winmain.c
# End of tebako patch
SUBST

# Ruby patching definitions (common base)
class Patch
def patch_map
Expand Down
27 changes: 12 additions & 15 deletions lib/tebako/packager/patch_buildsystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,6 @@ def template_makefile_in_patch_two(ruby_ver)
end
end

GNUMAKEFILE_IN_DLLTOOL_SUBST = <<~SUBST
$(Q) dlltool --output-lib=$(LIBRUBY) --output-def=tebako.def --export-all $(LIBRUBY_A) --output-exp=$(RUBY_EXP) # tebako patched
SUBST

# This MSYS specific thing ensure compilation of winmain.c
# Did try to understand why it did not work out of the box
GNUMAKEFILE_IN_WINMAIN_SUBST = <<~SUBST
RUBYDEF = $(DLL_BASE_NAME).def
# Start of tebako patch
WINMAINOBJ = win32/winmain.$(OBJEXT)
$(WINMAINOBJ): win32/winmain.c
# End of tebako patch
SUBST

def get_config_status_pattern(ostype)
case ostype
when /linux-/
Expand Down Expand Up @@ -143,6 +128,18 @@ def get_gnumakefile_in_patch_p2(ruby_ver) # rubocop:disable Metrics/MethodLength
objext = ruby_ver.ruby32? ? "$(OBJEXT)" : "@OBJEXT@"

{
"$(Q) $(DLLWRAP) \\" => GNUMAKEFILE_IN_DLLTOOL_SUBST,

Check warning on line 131 in lib/tebako/packager/patch_buildsystem.rb

View check run for this annotation

Codecov / codecov/patch

lib/tebako/packager/patch_buildsystem.rb#L131

Added line #L131 was not covered by tests

"--output-exp=$(RUBY_EXP) \\" => "# tebako patched --output-exp=$(RUBY_EXP) \\",

"--export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)" =>
"# tebako patched --export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)",

"@rm -f $(PROGRAM)" => "# tebako patched @rm -f $(PROGRAM)",

" $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)" =>
"# tebako patched $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)",

"$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.#{objext}" =>
"$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.#{objext} $(WINMAINOBJ) # tebako patched",

Expand Down

0 comments on commit a738700

Please sign in to comment.