Merge remote-tracking branches 'jjyg/develop', 'putnam/patch-4' and 'eswald/blank-histories' into develop

Conflicts:
	NEWS
develop
expwnent 2014-11-15 15:07:20 -05:00
commit 3021fa47db
5 changed files with 17 additions and 16 deletions

@ -62,6 +62,7 @@ The following is a list of people who have contributed to **DFHack**.
- Antalia <tamarakorr@gmail.com> - Antalia <tamarakorr@gmail.com>
- Angus Mezick <amezick@gmail.com> - Angus Mezick <amezick@gmail.com>
- PeridexisErrant <PeridexisErrant@gmail.com> - PeridexisErrant <PeridexisErrant@gmail.com>
- Putnam
And those are the cool people who made **stonesense**. And those are the cool people who made **stonesense**.

@ -22,6 +22,7 @@ DFHack Future
now you can remove syndromes by SYN_CLASS now you can remove syndromes by SYN_CLASS
scripts/modtools/add-syndrome.lua scripts/modtools/add-syndrome.lua
now you can remove syndromes by SYN_CLASS now you can remove syndromes by SYN_CLASS
No longer writes empty .history files
DFHack 0.40.15-r1 DFHack 0.40.15-r1
Fixes: Fixes:

@ -64,6 +64,8 @@ namespace DFHack
} }
bool save (const char * filename) bool save (const char * filename)
{ {
if (!history.size())
return true;
std::ofstream outfile (filename); std::ofstream outfile (filename);
//fprintf(stderr,"Save: Initialized stream\n"); //fprintf(stderr,"Save: Initialized stream\n");
if(outfile.bad()) if(outfile.bad())

@ -1,19 +1,10 @@
OPTION(DL_RUBY "download libruby from the internet" OFF)
IF (NOT APPLE) IF (NOT APPLE)
IF (UNIX) 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 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/libruby1.8.so.1.8.7 ${CMAKE_CURRENT_BINARY_DIR}/libruby.so) 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) SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.so)
ELSE (UNIX) 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 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/msvcrtruby187.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/msvcrt-ruby18.dll ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll) FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/msvcrt-ruby18.dll ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll)
@ -21,15 +12,21 @@ IF (NOT APPLE)
ENDIF(UNIX) ENDIF(UNIX)
ENDIF(NOT APPLE) 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( ADD_CUSTOM_COMMAND(
OUTPUT ${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}/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}/${RUBYAUTOGEN}
# cmake quirk: depending on codegen.out.xml or generate_headers only is not enough, needs both # 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 # 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 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") INCLUDE_DIRECTORIES("${dfhack_SOURCE_DIR}/depends/tthread")
@ -42,4 +39,4 @@ INSTALL(DIRECTORY .
DESTINATION hack/ruby DESTINATION hack/ruby
FILES_MATCHING PATTERN "*.rb") 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)

@ -241,7 +241,7 @@ end
# load autogenned file # load autogenned file
require './hack/ruby/ruby-autogen-defs' 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 # 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/ }