diff --git a/.gitmodules b/.gitmodules index 4cec489b..51c75bca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "vendor/PDCurses"] - path = vendor/PDCurses - url = https://github.com/shugo/PDCurses.git +[submodule "vendor/PDCursesMod"] + path = vendor/PDCursesMod + url = https://github.com/Bill-Gray/PDCursesMod.git diff --git a/README.md b/README.md index 9a0fdc00..41f4153f 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To curses is released under the Ruby and 2-clause BSD licenses. See COPYING for details. -It includes a forked version of PDCurses, which is in the public domain: +It includes PDCursesMod, which is in the public domain: - https://github.com/Bill-Gray/PDCurses + https://github.com/Bill-Gray/PDCursesMod The version for Win32 console mode in the wincon subdirectory is used. diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 4256a5bc..e7d2bb08 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -55,7 +55,7 @@ def exec_command(cmd) if $use_bundled_pdcurses $pdcurses_wide_default = true $curses_version_default = "function" - pdcurses_dir = File.expand_path("../../vendor/PDCurses", __dir__) + pdcurses_dir = File.expand_path("../../vendor/PDCursesMod", __dir__) $idefault = $ldefault = pdcurses_dir wincon_dir = File.expand_path("wincon", pdcurses_dir) old_dir = Dir.pwd @@ -68,7 +68,7 @@ def exec_command(cmd) $pdcurses_dll_default = true else w64 = $x64 ? "_w64=1" : "" - exec_command "make -f Makefile.mng clean libs #{w64} WIDE=Y DLL=N CC=\"gcc -std=gnu17\"" + exec_command "make -f Makefile clean libs #{w64} WIDE=Y DLL=N CC=\"gcc -std=gnu17\"" FileUtils.cp("pdcurses.a", File.expand_path("libpdcurses.a", pdcurses_dir)) end ensure @@ -76,6 +76,9 @@ def exec_command(cmd) end FileUtils.cp(File.expand_path("curses.h", pdcurses_dir), File.expand_path("pdcurses.h", pdcurses_dir)) + # PDCursesMod calls PlaySound() in PDC_beep(), so the static library + # needs winmm at link time + have_library("winmm") if $mingw $library_candidates = [ ["pdcurses.h", ["pdcurses"]] ] diff --git a/lib/curses.rb b/lib/curses.rb index 424729a3..d47b7580 100644 --- a/lib/curses.rb +++ b/lib/curses.rb @@ -1,4 +1,4 @@ -pdcurses_dll = File.expand_path("../vendor/PDCurses/pdcurses.dll", __dir__) +pdcurses_dll = File.expand_path("../vendor/PDCursesMod/pdcurses.dll", __dir__) if File.exist?(pdcurses_dll) path = ENV["PATH"] dir = File.dirname(pdcurses_dll) diff --git a/vendor/PDCurses b/vendor/PDCurses deleted file mode 160000 index c163cdb9..00000000 --- a/vendor/PDCurses +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c163cdb9dbddbcfa3d2b71dc1c3d6815463726f4 diff --git a/vendor/PDCursesMod b/vendor/PDCursesMod new file mode 160000 index 00000000..d226010b --- /dev/null +++ b/vendor/PDCursesMod @@ -0,0 +1 @@ +Subproject commit d226010b92245610bacdab205a99ae2915b99a91