From e2229f6a6aea316f34d56134b215a488bc90df01 Mon Sep 17 00:00:00 2001 From: Yoann Guillot Date: Fri, 14 Nov 2014 12:38:24 +0100 Subject: [PATCH 1/6] ruby: remove DL_RUBY cmake option --- plugins/ruby/CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt index 73e8433d3..592600c18 100644 --- a/plugins/ruby/CMakeLists.txt +++ b/plugins/ruby/CMakeLists.txt @@ -1,19 +1,10 @@ -OPTION(DL_RUBY "download libruby from the internet" OFF) IF (NOT APPLE) IF (UNIX) - IF (DL_RUBY) - FILE(DOWNLOAD http://cloud.github.com/downloads/jjyg/dfhack/libruby187.tar.gz ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.tar.gz - EXPECTED_MD5 eb2adea59911f68e6066966c1352f291) - ENDIF(DL_RUBY) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/libruby1.8.so.1.8.7 ${CMAKE_CURRENT_BINARY_DIR}/libruby.so) SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.so) ELSE (UNIX) - IF (DL_RUBY) - FILE(DOWNLOAD http://cloud.github.com/downloads/jjyg/dfhack/msvcrtruby187.tar.gz ${CMAKE_CURRENT_SOURCE_DIR}/msvcrtruby187.tar.gz - EXPECTED_MD5 9f4a1659ac3a5308f32d3a1937bbeeae) - ENDIF(DL_RUBY) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/msvcrtruby187.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/msvcrt-ruby18.dll ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll) From 696380e749c185320260c66b2afbfeaee132d44a Mon Sep 17 00:00:00 2001 From: Yoann Guillot Date: Fri, 14 Nov 2014 12:47:42 +0100 Subject: [PATCH 2/6] ruby: distinguish ruby-autogen.rb name based on architecture --- plugins/ruby/CMakeLists.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt index 592600c18..eaa08b10b 100644 --- a/plugins/ruby/CMakeLists.txt +++ b/plugins/ruby/CMakeLists.txt @@ -12,15 +12,21 @@ IF (NOT APPLE) ENDIF(UNIX) ENDIF(NOT APPLE) +IF (APPLE OR UNIX) + SET(RUBYAUTOGEN ruby-autogen-gcc.rb) +ELSE (APPLE OR UNIX) + SET(RUBYAUTOGEN ruby-autogen-win.rb) +ENDIF (APPLE OR UNIX) + ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.rb - COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/codegen.pl ${dfhack_SOURCE_DIR}/library/include/df/codegen.out.xml ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.rb + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN} + COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/codegen.pl ${dfhack_SOURCE_DIR}/library/include/df/codegen.out.xml ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN} # cmake quirk: depending on codegen.out.xml or generate_headers only is not enough, needs both # test by manually patching any library/xml/moo.xml, run make ruby-autogen-rb -j2, and check build/plugins/ruby/ruby-autogen.rb for patched xml data DEPENDS generate_headers ${dfhack_SOURCE_DIR}/library/include/df/codegen.out.xml ${CMAKE_CURRENT_SOURCE_DIR}/codegen.pl - COMMENT ruby-autogen.rb + COMMENT ${RUBYAUTOGEN} ) -ADD_CUSTOM_TARGET(ruby-autogen-rb DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.rb) +ADD_CUSTOM_TARGET(ruby-autogen-rb DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN}) INCLUDE_DIRECTORIES("${dfhack_SOURCE_DIR}/depends/tthread") @@ -33,4 +39,4 @@ INSTALL(DIRECTORY . DESTINATION hack/ruby FILES_MATCHING PATTERN "*.rb") -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.rb DESTINATION hack/ruby) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN} DESTINATION hack/ruby) From 8042c5d3426c073b700044b55ae6e3a3a44a48eb Mon Sep 17 00:00:00 2001 From: Yoann Guillot Date: Fri, 14 Nov 2014 12:49:08 +0100 Subject: [PATCH 3/6] ruby: load arch-specific ruby-autogen --- plugins/ruby/ruby.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ruby/ruby.rb b/plugins/ruby/ruby.rb index af957c76b..21e1a29ff 100644 --- a/plugins/ruby/ruby.rb +++ b/plugins/ruby/ruby.rb @@ -241,7 +241,7 @@ end # load autogenned file require './hack/ruby/ruby-autogen-defs' -require './hack/ruby/ruby-autogen' +require(RUBY_PLATFORM =~ /mswin/i ? './hack/ruby/ruby-autogen-win' : './hack/ruby/ruby-autogen-gcc') # load all modules -Dir['./hack/ruby/*.rb'].each { |m| require m.chomp('.rb') } +Dir['./hack/ruby/*.rb'].each { |m| require m.chomp('.rb') if m !~ /ruby-autogen/ } From c85d4994cf98e5138dc366761fd28632ed308b8e Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Fri, 14 Nov 2014 17:35:06 -0700 Subject: [PATCH 4/6] Preventing blank history files --- library/include/Console.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/include/Console.h b/library/include/Console.h index 2f2f68cfa..ce3c90884 100644 --- a/library/include/Console.h +++ b/library/include/Console.h @@ -64,6 +64,8 @@ namespace DFHack } bool save (const char * filename) { + if (!history.size()) + return true; std::ofstream outfile (filename); //fprintf(stderr,"Save: Initialized stream\n"); if(outfile.bad()) From 26ab2165b37c5c8d710ae539611ab97010923ace Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Fri, 14 Nov 2014 18:58:57 -0700 Subject: [PATCH 5/6] Updating NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index dada05bda..0fc6bc0af 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ DFHack Future + Internals: + - No longer writes empty .history files DFHack 0.40.15-r1 Fixes: From 2cc59b44ec7b4d49631ec70ec10a92cc0d0b3103 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Sat, 15 Nov 2014 00:06:59 -0800 Subject: [PATCH 6/6] Update Contributors.rst --- Contributors.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Contributors.rst b/Contributors.rst index 6d7ad850a..37de797c9 100644 --- a/Contributors.rst +++ b/Contributors.rst @@ -62,6 +62,7 @@ The following is a list of people who have contributed to **DFHack**. - Antalia - Angus Mezick - PeridexisErrant +- Putnam And those are the cool people who made **stonesense**.