├── LICENSE ├── README ├── lib └── vanhelsing.rb ├── CHANGELOG ├── ext ├── build_logger.rb ├── extconf.rb ├── logger.c └── build_ruby.rb ├── assets ├── ruby-1.8.6-p110.tar.bz2 ├── parse.y.patch ├── darwin-10.5 │ ├── dot-darwin.diff │ ├── etc-irbrc.diff │ ├── use-setreugid.diff │ ├── ignore-gsetcontext.diff │ ├── words-bigendian-from-arch.diff │ ├── md5_sha1_commoncrypto.diff │ └── use-dyld.diff └── gc.c.patch ├── Rakefile ├── Manifest ├── LICENSE_eric_hodel └── LICENSE_bleak_house /LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/vanhelsing.rb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | v0.1.0. First release -------------------------------------------------------------------------------- /ext/build_logger.rb: -------------------------------------------------------------------------------- 1 | require 'mkmf' 2 | dir_config('logger') 3 | create_makefile('logger') -------------------------------------------------------------------------------- /assets/ruby-1.8.6-p110.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/vanhelsing/master/assets/ruby-1.8.6-p110.tar.bz2 -------------------------------------------------------------------------------- /ext/extconf.rb: -------------------------------------------------------------------------------- 1 | case RUBY_PLATFORM 2 | when "universal-darwin9.0" 3 | puts "Detected Darwin 9.0" 4 | 5 | system('ruby build_ruby.rb &> /dev/null') 6 | exec("ruby-vanhelsing build_logger.rb") 7 | else 8 | abort "VanHelsing is currently only supported on Mac OS 10.5 and above" 9 | end -------------------------------------------------------------------------------- /ext/logger.c: -------------------------------------------------------------------------------- 1 | #include "ruby.h" 2 | 3 | static VALUE mVanHelsing; 4 | static VALUE cLogger; 5 | 6 | void Init_logger(); 7 | 8 | 9 | void 10 | Init_logger() 11 | { 12 | mVanHelsing = rb_define_module("VanHelsing"); 13 | cLogger = rb_define_class_under(mVanHelsing, "Logger", rb_cObject); 14 | } -------------------------------------------------------------------------------- /assets/parse.y.patch: -------------------------------------------------------------------------------- 1 | *** parse.old 2007-09-25 00:21:43.000000000 -0400 2 | --- parse.y 2007-09-25 00:23:02.000000000 -0400 3 | *************** 4 | *** 6166,6171 **** 5 | --- 6166,6176 ---- 6 | * :wait2, :$>] 7 | */ 8 | 9 | + struct st_table * 10 | + rb_parse_sym_tbl() { 11 | + return sym_tbl; 12 | + } 13 | + 14 | VALUE 15 | rb_sym_all_symbols() 16 | { 17 | -------------------------------------------------------------------------------- /assets/darwin-10.5/dot-darwin.diff: -------------------------------------------------------------------------------- 1 | --- lib/rdoc/options.rb.orig 2007-10-23 17:36:41.000000000 +0200 2 | +++ lib/rdoc/options.rb 2007-10-23 17:37:12.000000000 +0200 3 | @@ -544,7 +544,7 @@ 4 | # so we'll bypass the test under Windows 5 | 6 | def check_diagram 7 | - return if RUBY_PLATFORM =~ /win/ 8 | + return if RUBY_PLATFORM =~ /mswin32|cygwin|mingw|bccwin/ 9 | 10 | ok = false 11 | ver = nil 12 | -------------------------------------------------------------------------------- /assets/darwin-10.5/etc-irbrc.diff: -------------------------------------------------------------------------------- 1 | --- lib/irb/init.rb.orig 2007-10-23 17:43:49.000000000 +0200 2 | +++ lib/irb/init.rb 2007-10-23 17:43:03.000000000 +0200 3 | @@ -243,6 +243,9 @@ 4 | yield proc{|rc| home+"/irb#{rc.sub(/\A_?/, '.')}"} 5 | yield proc{|rc| home+"/_irb#{rc}"} 6 | yield proc{|rc| home+"/$irb#{rc}"} 7 | + unless RUBY_PLATFORM =~ /mswin32|cygwin|mingw|bccwin/ 8 | + yield proc{|rc| "/etc/irb#{rc}"} 9 | + end 10 | end 11 | 12 | # loading modules 13 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'echoe' 2 | 3 | Echoe.new('vanhelsing') do |p| 4 | p.author = "Tom Preston-Werner" 5 | p.summary = "Super streamlined memory profiler with real time graphs for Ruby programs" 6 | p.url = "http://vanhelsing.rubyforge.com" 7 | end 8 | 9 | task :go do 10 | sh("sudo rm /usr/bin/ruby-vanhelsing") rescue nil 11 | sh("sudo rm -fr /tmp/vanhelsing") rescue nil 12 | sh("rake manifest") 13 | sh("rake clean") 14 | sh("rake package") 15 | Dir.chdir("pkg") do 16 | sh("sudo gem uninstall vanhelsing") rescue nil 17 | sh("sudo gem install *.gem") 18 | end 19 | end -------------------------------------------------------------------------------- /Manifest: -------------------------------------------------------------------------------- 1 | assets/darwin-10.5/dot-darwin.diff 2 | assets/darwin-10.5/etc-irbrc.diff 3 | assets/darwin-10.5/ignore-gsetcontext.diff 4 | assets/darwin-10.5/md5_sha1_commoncrypto.diff 5 | assets/darwin-10.5/use-dyld.diff 6 | assets/darwin-10.5/use-setreugid.diff 7 | assets/darwin-10.5/words-bigendian-from-arch.diff 8 | assets/gc.c.patch 9 | assets/parse.y.patch 10 | assets/ruby-1.8.6-p110.tar.bz2 11 | CHANGELOG 12 | ext/build_logger.rb 13 | ext/build_ruby.rb 14 | ext/extconf.rb 15 | ext/logger.c 16 | lib/vanhelsing.rb 17 | LICENSE 18 | LICENSE_bleak_house 19 | LICENSE_eric_hodel 20 | Manifest 21 | README 22 | -------------------------------------------------------------------------------- /assets/gc.c.patch: -------------------------------------------------------------------------------- 1 | *** gc.old 2007-09-25 00:27:27.000000000 -0400 2 | --- gc.c 2007-09-25 00:27:28.000000000 -0400 3 | *************** 4 | *** 309,314 **** 5 | --- 309,330 ---- 6 | static int heaps_length = 0; 7 | static int heaps_used = 0; 8 | 9 | + struct heaps_slot * 10 | + rb_gc_heap_slots() 11 | + { 12 | + return heaps; 13 | + } 14 | + 15 | + int 16 | + rb_gc_heaps_used() { 17 | + return heaps_used; 18 | + } 19 | + 20 | + int 21 | + rb_gc_heaps_length() { 22 | + return heaps_length; 23 | + } 24 | + 25 | #define HEAP_MIN_SLOTS 10000 26 | static int heap_slots = HEAP_MIN_SLOTS; 27 | 28 | -------------------------------------------------------------------------------- /assets/darwin-10.5/use-setreugid.diff: -------------------------------------------------------------------------------- 1 | --- process.c.orig 2007-10-23 18:50:29.000000000 +0200 2 | +++ process.c 2007-10-23 19:08:01.000000000 +0200 3 | @@ -96,9 +96,16 @@ 4 | #undef HAVE_SETRGID 5 | #endif 6 | 7 | -#if defined(__MacOS_X__) || defined(__bsdi__) 8 | -#define BROKEN_SETREUID 1 9 | -#define BROKEN_SETREGID 1 10 | +#if defined(__APPLE__) 11 | +# include 12 | +/* setreuid/setregid were broken in Mac OS X <= 10.4, but were fixed since. */ 13 | +# if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040 14 | +# define BROKEN_SETREUID 1 15 | +# define BROKEN_SETREGID 1 16 | +# endif 17 | +#elif defined(__bsdi__) 18 | +# define BROKEN_SETREUID 1 19 | +# define BROKEN_SETREGID 1 20 | #endif 21 | 22 | #if defined(HAVE_44BSD_SETUID) || defined(__MacOS_X__) 23 | -------------------------------------------------------------------------------- /assets/darwin-10.5/ignore-gsetcontext.diff: -------------------------------------------------------------------------------- 1 | --- node.h.orig 2007-10-23 17:09:10.000000000 +0200 2 | +++ node.h 2007-10-23 17:08:19.000000000 +0200 3 | @@ -374,9 +374,17 @@ 4 | void rb_add_event_hook _((rb_event_hook_func_t,rb_event_t)); 5 | int rb_remove_event_hook _((rb_event_hook_func_t)); 6 | 7 | -#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT) 8 | -#include 9 | -#define USE_CONTEXT 10 | +#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT) 11 | +# if defined(__APPLE__) 12 | +# include 13 | +# if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040 14 | +# include 15 | +# define USE_CONTEXT 16 | +# endif 17 | +# else 18 | +# include 19 | +# define USE_CONTEXT 20 | +# endif 21 | #endif 22 | #include 23 | #include "st.h" 24 | -------------------------------------------------------------------------------- /assets/darwin-10.5/words-bigendian-from-arch.diff: -------------------------------------------------------------------------------- 1 | --- defines.h.orig 2007-10-23 19:48:41.000000000 +0200 2 | +++ defines.h 2007-10-23 19:49:23.000000000 +0200 3 | @@ -102,6 +102,16 @@ 4 | #endif 5 | #endif 6 | 7 | +#if defined(__NeXT__) || defined(__APPLE__) 8 | +/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may 9 | + result in a different endian. Instead trust __BIG_ENDIAN__ and 10 | + __LITTLE_ENDIAN__ which are set correctly by -arch. */ 11 | +#undef WORDS_BIGENDIAN 12 | +#ifdef __BIG_ENDIAN__ 13 | +#define WORDS_BIGENDIAN 14 | +#endif 15 | +#endif 16 | + 17 | #ifdef __NeXT__ 18 | /* NextStep, OpenStep, Rhapsody */ 19 | #ifndef S_IRUSR 20 | @@ -155,13 +165,6 @@ 21 | #ifndef S_ISREG 22 | #define S_ISREG(mode) (((mode) & (0170000)) == (0100000)) 23 | #endif 24 | -/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may 25 | - result in a different endian. Instead trust __BIG_ENDIAN__ and 26 | - __LITTLE_ENDIAN__ which are set correctly by -arch. */ 27 | -#undef WORDS_BIGENDIAN 28 | -#ifdef __BIG_ENDIAN__ 29 | -#define WORDS_BIGENDIAN 30 | -#endif 31 | #ifndef __APPLE__ 32 | /* NextStep, OpenStep (but not Rhapsody) */ 33 | #ifndef GETPGRP_VOID 34 | -------------------------------------------------------------------------------- /LICENSE_eric_hodel: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2006, Eric Hodel. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 3. Neither the names of the authors nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS?? AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /assets/darwin-10.5/md5_sha1_commoncrypto.diff: -------------------------------------------------------------------------------- 1 | --- ext/digest/md5/extconf.rb.orig 2007-10-23 18:31:40.000000000 +0200 2 | +++ ext/digest/md5/extconf.rb 2007-10-23 18:26:33.000000000 +0200 3 | @@ -11,6 +11,7 @@ 4 | dir_config("openssl") 5 | 6 | if !with_config("bundled-md5") && 7 | + !have_header("CommonCrypto/CommonDigest.h") && 8 | have_library("crypto") && have_header("openssl/md5.h") 9 | $objs << "md5ossl.#{$OBJEXT}" 10 | 11 | --- ext/digest/md5/md5.h.orig 2007-10-23 18:31:52.000000000 +0200 12 | +++ ext/digest/md5/md5.h 2007-10-23 18:28:19.000000000 +0200 13 | @@ -48,6 +48,10 @@ 14 | 15 | #include "defs.h" 16 | 17 | +#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H) 18 | +# include 19 | +#endif 20 | + 21 | /* 22 | * This code has some adaptations for the Ghostscript environment, but it 23 | * will compile and run correctly in any environment with 8-bit chars and 24 | --- ext/digest/sha1/extconf.rb.orig 2007-10-23 18:42:07.000000000 +0200 25 | +++ ext/digest/sha1/extconf.rb 2007-10-23 18:43:01.000000000 +0200 26 | @@ -11,6 +11,7 @@ 27 | dir_config("openssl") 28 | 29 | if !with_config("bundled-sha1") && 30 | + !have_header("CommonCrypto/CommonDigest.h") && 31 | have_library("crypto") && have_header("openssl/sha.h") 32 | $objs << "sha1ossl.#{$OBJEXT}" 33 | else 34 | --- ext/digest/sha1/sha1.h.orig 2007-10-23 18:42:14.000000000 +0200 35 | +++ ext/digest/sha1/sha1.h 2007-10-23 18:43:23.000000000 +0200 36 | @@ -13,6 +13,10 @@ 37 | 38 | #include "defs.h" 39 | 40 | +#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H) 41 | +# include 42 | +#endif 43 | + 44 | typedef struct { 45 | uint32_t state[5]; 46 | uint32_t count[2]; 47 | -------------------------------------------------------------------------------- /assets/darwin-10.5/use-dyld.diff: -------------------------------------------------------------------------------- 1 | --- dln.c.orig 2007-10-23 19:59:39.000000000 +0200 2 | +++ dln.c 2007-10-23 20:06:45.000000000 +0200 3 | @@ -87,13 +87,21 @@ 4 | 5 | #ifndef NO_DLN_LOAD 6 | 7 | -#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) && !defined(_UNICOSMP) 8 | +#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(_UNICOSMP) 9 | /* dynamic load with dlopen() */ 10 | # define USE_DLN_DLOPEN 11 | #endif 12 | 13 | +#if defined(USE_DLN_DLOPEN) && defined(__APPLE__) 14 | +/* Mac OS X system lesser than 10.4 should use the NSSymbol APIs instead of dlopen/dlsym. */ 15 | +# include 16 | +# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040 17 | +# undef USE_DLN_DLOPEN 18 | +# endif 19 | +#endif 20 | + 21 | #ifndef FUNCNAME_PATTERN 22 | -# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__) 23 | +# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || (defined(__APPLE__) && !defined(USE_DLN_DLOPEN)) 24 | # define FUNCNAME_PATTERN "_Init_%s" 25 | # else 26 | # define FUNCNAME_PATTERN "Init_%s" 27 | @@ -1403,7 +1411,7 @@ 28 | } 29 | #endif /* _AIX */ 30 | 31 | -#if defined(NeXT) || defined(__APPLE__) 32 | +#if defined(NeXT) || (defined(__APPLE__) && !defined(USE_DLN_DLOPEN)) 33 | #define DLN_DEFINED 34 | /*---------------------------------------------------- 35 | By SHIROYAMA Takayuki Psi@fortune.nest.or.jp 36 | -------------------------------------------------------------------------------- /ext/build_ruby.rb: -------------------------------------------------------------------------------- 1 | # Extension abuse in order to build our patched binary as part of the gem install process. 2 | 3 | if RUBY_PLATFORM =~ /win32|windows/ 4 | raise "Windows is not supported." 5 | end 6 | 7 | unless RUBY_VERSION == '1.8.6' 8 | raise "Wrong Ruby version, you're at '#{RUBY_VERSION}', need 1.8.6" 9 | end 10 | 11 | source_dir = File.expand_path(File.dirname(__FILE__)) + "/../assets" 12 | tmp = "/tmp/" 13 | 14 | require 'fileutils' 15 | require 'rbconfig' 16 | 17 | def which(basename) 18 | # system('which') is not compatible across Linux and BSD 19 | ENV['PATH'].split(File::PATH_SEPARATOR).detect do |directory| 20 | path = File.join(directory, basename.to_s) 21 | path if File.exist? path 22 | end 23 | end 24 | 25 | if which('ruby-vanhelsing') 26 | puts "Existing 'ruby-vanhelsing' binary. Nothing to do" 27 | else 28 | puts "Building 'ruby-vanhelsing' binary." 29 | 30 | Dir.chdir(tmp) do 31 | puts 'mark1.5' 32 | build_dir = "vanhelsing" 33 | binary_dir = File.dirname(`which ruby`) 34 | FileUtils.rm_rf(build_dir) rescue nil 35 | Dir.mkdir(build_dir) 36 | 37 | begin 38 | Dir.chdir(build_dir) do 39 | # Copy Ruby source 40 | bz2 = "ruby-1.8.6-p110.tar.bz2" 41 | FileUtils.copy "#{source_dir}/#{bz2}", bz2 42 | 43 | # Extract 44 | system("tar xjf #{bz2} > tar.log 2>&1") 45 | File.delete bz2 46 | 47 | Dir.chdir("ruby-1.8.6-p110") do 48 | 49 | # Patch, configure, and build 50 | system("patch -p0 < \'#{source_dir}/gc.c.patch\' > ../gc.c.patch.log 2>&1") 51 | system("patch -p0 < \'#{source_dir}/parse.y.patch\' > ../parse.y.patch.log 2>&1") 52 | system("patch -p0 < \'#{source_dir}/darwin-10.5/dot-darwin.diff\' > ../dot-darwin.diff.log 2>&1") 53 | system("patch -p0 < \'#{source_dir}/darwin-10.5/etc-irbrc.diff\' > ../etc-irbrc.diff.log 2>&1") 54 | system("patch -p0 < \'#{source_dir}/darwin-10.5/ignore-gsetcontext.diff\' > ../ignore-gsetcontext.diff.log 2>&1") 55 | system("patch -p0 < \'#{source_dir}/darwin-10.5/md5_sha1_commoncrypto.diff\' ../md5_sha1_commoncrypto.diff.log 2>&1") 56 | system("patch -p0 < \'#{source_dir}/darwin-10.5/use-dyld.diff\' > ../use-dyld.diff.log 2>&1") 57 | system("patch -p0 < \'#{source_dir}/darwin-10.5/use-setreugid.diff\' > ../use-setreugid.diff.log 2>&1") 58 | system("patch -p0 < \'#{source_dir}/darwin-10.5/words-bigendian-from-arch.diff\' > ../words-bigendian-from-arch.diff.log 2>&1") 59 | system("./configure --enable-pthread --enable-shared --prefix=#{binary_dir[0..-5]} > ../configure.log 2>&1") 60 | 61 | # Patch the makefile for arch/sitedir 62 | makefile = File.read('Makefile') 63 | %w{arch sitearch sitedir}.each do | key | 64 | makefile.gsub!(/#{key} = .*/, "#{key} = #{Config::CONFIG[key]}") 65 | end 66 | File.open('Makefile', 'w'){|f| f.puts(makefile)} 67 | 68 | # Patch the config.h for constants 69 | constants = { 70 | 'RUBY_LIB' => 'rubylibdir', #define RUBY_LIB "/usr/lib/ruby/1.8" 71 | 'RUBY_SITE_LIB' => 'sitedir', #define RUBY_SITE_LIB "/usr/lib/ruby/site_ruby" 72 | 'RUBY_SITE_LIB2' => 'sitelibdir', #define RUBY_SITE_LIB2 "/usr/lib/ruby/site_ruby/1.8" 73 | 'RUBY_PLATFORM' => 'arch', #define RUBY_PLATFORM "i686-linux" 74 | 'RUBY_ARCHLIB' => 'topdir', #define RUBY_ARCHLIB "/usr/lib/ruby/1.8/i686-linux" 75 | 'RUBY_SITE_ARCHLIB' => 'sitearchdir' #define RUBY_SITE_ARCHLIB "/usr/lib/ruby/site_ruby/1.8/i686-linux" 76 | } 77 | config_h = File.read('config.h') 78 | constants.each do | const, key | 79 | config_h.gsub!(/#define #{const} .*/, "#define #{const} \"#{Config::CONFIG[key]}\"") 80 | end 81 | File.open('config.h', 'w'){|f| f.puts(config_h)} 82 | 83 | system("make > ../make.log 2>&1") 84 | 85 | binary = "#{binary_dir}/ruby-vanhelsing" 86 | 87 | # Install binary 88 | if File.exist? "ruby" 89 | # Avoid "Text file busy" error 90 | File.delete binary if File.exist? binary 91 | exec("cp ./ruby #{binary}; chmod 755 #{binary}") 92 | else 93 | raise "Binary did not build" 94 | end 95 | end 96 | 97 | end 98 | rescue Object => e 99 | raise "Please see the last modified log file in #{tmp}#{build_dir}, perhaps\nit will contain a clue.\n#{e.to_s}" 100 | end 101 | 102 | # Success 103 | end 104 | 105 | end 106 | -------------------------------------------------------------------------------- /LICENSE_bleak_house: -------------------------------------------------------------------------------- 1 | Academic Free License (AFL) v. 3.0 2 | 3 | This Academic Free License (the "License") applies to any original work 4 | of authorship (the "Original Work") whose owner (the "Licensor") has 5 | placed the following licensing notice adjacent to the copyright notice 6 | for the Original Work: 7 | 8 | Licensed under the Academic Free License version 3.0 9 | 10 | 1) Grant of Copyright License. Licensor grants You a worldwide, 11 | royalty-free, non-exclusive, sublicensable license, for the duration of 12 | the copyright, to do the following: 13 | 14 | a) to reproduce the Original Work in copies, either alone or as part of 15 | a collective work; 16 | 17 | b) to translate, adapt, alter, transform, modify, or arrange the 18 | Original Work, thereby creating derivative works ("Derivative Works") 19 | based upon the Original Work; 20 | 21 | c) to distribute or communicate copies of the Original Work and 22 | Derivative Works to the public, under any license of your choice that 23 | does not contradict the terms and conditions, including Licensor's 24 | reserved rights and remedies, in this Academic Free License; 25 | 26 | d) to perform the Original Work publicly; and 27 | 28 | e) to display the Original Work publicly. 29 | 30 | 2) Grant of Patent License. Licensor grants You a worldwide, 31 | royalty-free, non-exclusive, sublicensable license, under patent claims 32 | owned or controlled by the Licensor that are embodied in the Original 33 | Work as furnished by the Licensor, for the duration of the patents, to 34 | make, use, sell, offer for sale, have made, and import the Original Work 35 | and Derivative Works. 36 | 37 | 3) Grant of Source Code License. The term "Source Code" means the 38 | preferred form of the Original Work for making modifications to it and 39 | all available documentation describing how to modify the Original Work. 40 | Licensor agrees to provide a machine-readable copy of the Source Code of 41 | the Original Work along with each copy of the Original Work that 42 | Licensor distributes. Licensor reserves the right to satisfy this 43 | obligation by placing a machine-readable copy of the Source Code in an 44 | information repository reasonably calculated to permit inexpensive and 45 | convenient access by You for as long as Licensor continues to distribute 46 | the Original Work. 47 | 48 | 4) Exclusions From License Grant. Neither the names of Licensor, nor the 49 | names of any contributors to the Original Work, nor any of their 50 | trademarks or service marks, may be used to endorse or promote products 51 | derived from this Original Work without express prior permission of the 52 | Licensor. Except as expressly stated herein, nothing in this License 53 | grants any license to Licensor's trademarks, copyrights, patents, trade 54 | secrets or any other intellectual property. No patent license is granted 55 | to make, use, sell, offer for sale, have made, or import embodiments of 56 | any patent claims other than the licensed claims defined in Section 2. 57 | No license is granted to the trademarks of Licensor even if such marks 58 | are included in the Original Work. Nothing in this License shall be 59 | interpreted to prohibit Licensor from licensing under terms different 60 | from this License any Original Work that Licensor otherwise would have a 61 | right to license. 62 | 63 | 5) External Deployment. The term "External Deployment" means the use, 64 | distribution, or communication of the Original Work or Derivative Works 65 | in any way such that the Original Work or Derivative Works may be used 66 | by anyone other than You, whether those works are distributed or 67 | communicated to those persons or made available as an application 68 | intended for use over a network. As an express condition for the grants 69 | of license hereunder, You must treat any External Deployment by You of 70 | the Original Work or a Derivative Work as a distribution under section 71 | 1(c). 72 | 73 | 6) Attribution Rights. You must retain, in the Source Code of any 74 | Derivative Works that You create, all copyright, patent, or trademark 75 | notices from the Source Code of the Original Work, as well as any 76 | notices of licensing and any descriptive text identified therein as an 77 | "Attribution Notice." You must cause the Source Code for any Derivative 78 | Works that You create to carry a prominent Attribution Notice reasonably 79 | calculated to inform recipients that You have modified the Original 80 | Work. 81 | 82 | 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants 83 | that the copyright in and to the Original Work and the patent rights 84 | granted herein by Licensor are owned by the Licensor or are sublicensed 85 | to You under the terms of this License with the permission of the 86 | contributor(s) of those copyrights and patent rights. Except as 87 | expressly stated in the immediately preceding sentence, the Original 88 | Work is provided under this License on an "AS IS" BASIS and WITHOUT 89 | WARRANTY, either express or implied, including, without limitation, the 90 | warranties of non-infringement, merchantability or fitness for a 91 | particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL 92 | WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential 93 | part of this License. No license to the Original Work is granted by this 94 | License except under this disclaimer. 95 | 96 | 8) Limitation of Liability. Under no circumstances and under no legal 97 | theory, whether in tort (including negligence), contract, or otherwise, 98 | shall the Licensor be liable to anyone for any indirect, special, 99 | incidental, or consequential damages of any character arising as a 100 | result of this License or the use of the Original Work including, 101 | without limitation, damages for loss of goodwill, work stoppage, 102 | computer failure or malfunction, or any and all other commercial damages 103 | or losses. This limitation of liability shall not apply to the extent 104 | applicable law prohibits such limitation. 105 | 106 | 9) Acceptance and Termination. If, at any time, You expressly assented 107 | to this License, that assent indicates your clear and irrevocable 108 | acceptance of this License and all of its terms and conditions. If You 109 | distribute or communicate copies of the Original Work or a Derivative 110 | Work, You must make a reasonable effort under the circumstances to 111 | obtain the express assent of recipients to the terms of this License. 112 | This License conditions your rights to undertake the activities listed 113 | in Section 1, including your right to create Derivative Works based upon 114 | the Original Work, and doing so without honoring these terms and 115 | conditions is prohibited by copyright law and international treaty. 116 | Nothing in this License is intended to affect copyright exceptions and 117 | limitations (including "fair use" or "fair dealing"). This License shall 118 | terminate immediately and You may no longer exercise any of the rights 119 | granted to You by this License upon your failure to honor the conditions 120 | in Section 1(c). 121 | 122 | 10) Termination for Patent Action. This License shall terminate 123 | automatically and You may no longer exercise any of the rights granted 124 | to You by this License as of the date You commence an action, including 125 | a cross-claim or counterclaim, against Licensor or any licensee alleging 126 | that the Original Work infringes a patent. This termination provision 127 | shall not apply for an action alleging patent infringement by 128 | combinations of the Original Work with other software or hardware. 129 | 130 | 11) Jurisdiction, Venue and Governing Law. Any action or suit relating 131 | to this License may be brought only in the courts of a jurisdiction 132 | wherein the Licensor resides or in which Licensor conducts its primary 133 | business, and under the laws of that jurisdiction excluding its 134 | conflict-of-law provisions. The application of the United Nations 135 | Convention on Contracts for the International Sale of Goods is expressly 136 | excluded. Any use of the Original Work outside the scope of this License 137 | or after its termination shall be subject to the requirements and 138 | penalties of copyright or patent law in the appropriate jurisdiction. 139 | This section shall survive the termination of this License. 140 | 141 | 12) Attorneys' Fees. In any action to enforce the terms of this License 142 | or seeking damages relating thereto, the prevailing party shall be 143 | entitled to recover its costs and expenses, including, without 144 | limitation, reasonable attorneys' fees and costs incurred in connection 145 | with such action, including any appeal of such action. This section 146 | shall survive the termination of this License. 147 | 148 | 13) Miscellaneous. If any provision of this License is held to be 149 | unenforceable, such provision shall be reformed only to the extent 150 | necessary to make it enforceable. 151 | 152 | 14) Definition of "You" in This License. "You" throughout this License, 153 | whether in upper or lower case, means an individual or a legal entity 154 | exercising rights under, and complying with all of the terms of, this 155 | License. For legal entities, "You" includes any entity that controls, is 156 | controlled by, or is under common control with you. For purposes of this 157 | definition, "control" means (i) the power, direct or indirect, to cause 158 | the direction or management of such entity, whether by contract or 159 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 160 | outstanding shares, or (iii) beneficial ownership of such entity. 161 | 162 | 15) Right to Use. You may use the Original Work in all ways not 163 | otherwise restricted or conditioned by this License or by law, and 164 | Licensor promises not to interfere with or be responsible for such uses 165 | by You. 166 | 167 | 16) Modification of This License. This License is Copyright (c) 2005 168 | Lawrence Rosen. Permission is granted to copy, distribute, or 169 | communicate this License without modification. Nothing in this License 170 | permits You to modify this License as applied to the Original Work or to 171 | Derivative Works. However, You may modify the text of this License and 172 | copy, distribute or communicate your modified version (the "Modified 173 | License") and apply it to other original works of authorship subject to 174 | the following conditions: (i) You may not indicate in any way that your 175 | Modified License is the "Academic Free License" or "AFL" and you may not 176 | use those names in the name of your Modified License; (ii) You must 177 | replace the notice specified in the first paragraph above with the 178 | notice "Licensed under " or with a notice 179 | of your own that is not confusingly similar to the notice in this 180 | License; and (iii) You may not claim that your original works are open 181 | source software unless your Modified License has been approved by Open 182 | Source Initiative (OSI) and You comply with its license review and 183 | certification process. 184 | 185 | --------------------------------------------------------------------------------