[2014-05-17] Windows 7 で Ruby 2.1.2 がビルドできることを確認。
>ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
RubyIntaller のリポジトリを取得
| module OpenGL | |
| def self.bind_command( sym ) | |
| begin | |
| GL_FUNCTIONS_MAP[sym] = Fiddle::Function.new( @@gl_dll[sym.to_s], | |
| GL_FUNCTIONS_ARGS_MAP[sym], | |
| GL_FUNCTIONS_RETVAL_MAP[sym] ) | |
| rescue Exception => e | |
| func_ptr = wglGetProcAddress(sym.to_s) | |
| # p sym.to_s | |
| GL_FUNCTIONS_MAP[sym] = Fiddle::Function.new( func_ptr, |
| require 'fiddle/import' | |
| module M | |
| extend Fiddle::Importer | |
| dlload "/usr/lib/libstdc++.dylib" | |
| extern "int strcmp(char*, char*)" | |
| extern "int strlen(char*)" | |
| end | |
| str0 = "abc" |
| require 'fiddle/import' | |
| module M | |
| extend Fiddle::Importer | |
| dlload "/usr/lib/libstdc++.dylib" | |
| extern "int strcmp(char*, char*)" | |
| extern "int strlen(char*)" | |
| end | |
| =begin |
| # -*- coding: utf-8 -*- | |
| require 'fiddle' | |
| # Array -> Fiddle::Pointer conversion | |
| class PackedData | |
| attr_reader :data, :pointer | |
| def initialize( src ) | |
| @source = src # Array or String built from packed Array | |
| @data = nil # String |
| require 'fiddle' | |
| =begin | |
| # https://www.opengl.org/sdk/docs/man4/html/glDebugMessageCallback.xhtml | |
| typedef void (APIENTRY *DEBUGPROC)(GLenum source, | |
| GLenum type, | |
| GLuint id, | |
| GLenum severity, | |
| GLsizei length, | |
| const GLchar *message, |
| # Getting LLVM : | |
| # http://llvm.org/releases/download.html#3.4 | |
| # Usage example : | |
| # $ LLVM_CONFIG=~/Downloads/clang+llvm-3.4-x86_64-apple-darwin10.9/bin/llvm-config ruby fficlangtest.rb /usr/include/stdio.h | |
| require 'ffi/clang' | |
| index = FFI::Clang::Index.new | |
| translation_unit = index.parse_translation_unit(ARGV[0]) | |
| cursor = translation_unit.cursor | |
| cursor.visit_children do |cursor, parent| |
| <!-- | |
| Countdown timer using Countdown.js (http://countdownjs.org). | |
| - Put https://bitbucket.org/mckamey/countdown.js/raw/tip/countdown.js here. | |
| - Open this file in your browser. | |
| --> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Countdown Timer</title> | |
| </head> |
| template <typename POD> | |
| struct PODContainer | |
| { | |
| POD* buf; | |
| size_t cap, cnt; | |
| typedef POD* iterator; | |
| PODContainer(size_t capacity) : cnt(0), cap(capacity) { buf = (POD*)malloc(cap * sizeof(POD)); } | |
| ~PODContainer() { free(buf); } |
Installing nokogiri gem for OS X 10.10 / Homebrew [2014-11-24]
I found some strings like
@@HOMEBREW_CELLAR@@/xz/5.0.7/lib
in libxml2's configuration log and Makefile. So I have to set these path strings explicitly via LZMA_* environment variables.
$ which ruby
/Users/foo/.rvm/rubies/ruby-2.1.5/bin/ruby