Skip to content

Instantly share code, notes, and snippets.

@kimuraw
kimuraw / CasualConc_2011-11-16-234403_mukoujima.crash
Created November 18, 2011 23:39
crash at scrolling on RubyCocoa app "CasualConc"
Process: CasualConc [44932]
Path: /Users/*/Library/Developer/Xcode/DerivedData/CasualConc-fvbnrnxrxwnmbvajmshnuclpqrgr/Build/Products/Debug/CasualConc.app/Contents/MacOS/CasualConc
Identifier: CasualConcApp
Version: 1.8.6 (20111019)
Code Type: X86 (Native)
Parent Process: zsh [84720]
Date/Time: 2011-11-16 23:44:02.004 +0900
OS Version: Mac OS X 10.7.2 (11C74)
Report Version: 9
@kimuraw
kimuraw / gist:1378574
Created November 19, 2011 07:02
patch: fix "invalid option -N (-h will show valid options)" to run rubycocoa apps on Xcode-4
diff -ur old/main.m new/main.m
--- old/main.m 2011-11-19 15:49:58.000000000 +0900
+++ new/main.m 2011-11-19 15:49:16.000000000 +0900
@@ -11,5 +11,6 @@
int main(int argc, const char *argv[])
{
- return RBApplicationMain("rb_main.rb", argc, argv);
+ RBApplicationInit("rb_main.rb", argc, argv, nil);
+ return NSApplicationMain(argc, argv);
@kimuraw
kimuraw / ruby19-Portfile.diff
Created April 1, 2012 16:02
workaround to fix #33814 trac.macports.org
Index: ruby19/Portfile
===================================================================
--- ruby19/Portfile (revision 91418)
+++ ruby19/Portfile (working copy)
@@ -72,6 +72,15 @@
configure.args-append "--with-arch=${build_arch}"
}
+platform darwin 8 {
+ configure.args-delete --enable-pthread
@kimuraw
kimuraw / ruby187-numeric.c.diff
Created July 12, 2012 13:57
fix: ruby-1.8.7 built with clang "-Os". bignum does not pass sample/test.rb.
Index: numeric.c
===================================================================
--- numeric.c (revision 36354)
+++ numeric.c (working copy)
@@ -2161,7 +2161,7 @@
VALUE x, y;
{
if (FIXNUM_P(y)) {
-#ifdef __HP_cc
+#if defined(__HP_cc) || defined(__clang__)
@kimuraw
kimuraw / patch-port-ruby-clang.diff
Created July 21, 2012 08:19
MacPorts port:ruby (ruby-1.8.7-p370) supports clang. requires Xcode 4.2 or later.
Index: files/patch-configure.diff
===================================================================
--- files/patch-configure.diff (revision 0)
+++ files/patch-configure.diff (working copy)
@@ -0,0 +1,19 @@
+--- configure.orig 2012-06-29 22:18:24.000000000 +0900
++++ configure 2012-07-21 16:32:51.000000000 +0900
+@@ -2722,6 +2722,7 @@
+
+ case $target_cpu in
@kimuraw
kimuraw / patch-misc.c.diff
Created July 31, 2012 12:51
Fix crash boehmgc-7.2c on Mac OS X 10.8 Mountain Lion
--- misc.c.orig 2012-07-31 21:33:45.000000000 +0900
+++ misc.c 2012-07-31 21:34:09.000000000 +0900
@@ -283,7 +283,7 @@
/* not static because it could also be errorneously defined in .S */
/* file, so this error would be caught by the linker. */
/*ARGSUSED*/
- void * GC_clear_stack_inner(void *arg, ptr_t limit)
+ void * GC_clear_stack_inner(void *arg, volatile ptr_t limit)
{
word dummy[CLEAR_SIZE];
@kimuraw
kimuraw / clang31onMountainLion.markdown
Created August 8, 2012 14:29
clang-3.1 or later (trunk) cannot generate an execute file

On Mac OS X 10.8 Mountain Lion, clang-3.1 does not work.

clang-3.1 (MacPorts)

% cat a.c
int main() {
return 0;
}
% clang-mp-3.1 --version     # MacPorts port:clang-3.1

clang version 3.1 (branches/release_31)

@kimuraw
kimuraw / mongo-220-sm.diff
Created September 22, 2012 06:41
A patch for mongo-2.2.0 to fix build error with --use-system-sm
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index 06022a1..e1dd08f 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -175,7 +175,7 @@ env.CppUnitTest('bson_template_evaluator_test', ['scripting/bson_template_evalua
if usesm:
env.StaticLibrary('scripting', scripting_common_files + ['scripting/engine_spidermonkey.cpp'],
- LIBDEPS=['$BUILD_DIR/third_party/js-1.7/js', 'bson_template_evaluator'])
+ LIBDEPS=['$BUILD_DIR/third_party/shim_spidermonkey', 'bson_template_evaluator'])
@kimuraw
kimuraw / gist:5068437
Last active December 14, 2015 09:58
Portfile style of rb-*|rb19-* port (MacPorts)

numbers of ruby.setup target:

% svn co https://svn.macports.org/repository/macports/trunk/dports/ruby
   :
Checked out revision 103576.
% cd ruby
% ack -a -G Portfile -h ruby\.setup | expand | sed -e 's/  */ /g' -e 's/{[^}]*}/{}/g' |
      cut -f 4 -d \ | cut -f 1 -d \: | sort | uniq -c 
  33 basic_install.rb

7 copy_install

@kimuraw
kimuraw / TemplateInfo.plist
Last active December 16, 2015 03:49
a sample of "InjectionTargets" of Xcode4 project template
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kind</key>
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
<key>Identifier</key>
<!-- Specify an unique identifier -->
<!-- 固有の識別子を指定します -->
<string>jp.nifty.i.kimuraw.dt.unit.AddDebugLog</string>