Skip to content

Instantly share code, notes, and snippets.

View tochiz's full-sized avatar

tochiz tochiz

View GitHub Profile
@tochiz
tochiz / common.c
Created July 20, 2011 04:08
tokyopromenade gist embed patch
diff --git a/common.c b/common.c
index 54f0695..e483fa6 100644
--- a/common.c
+++ b/common.c
@@ -914,6 +914,11 @@ void wikitohtml(TCXSTR *rbuf, const char *str, const char *id, const char *buri,
tcxstrprintf(rbuf, "<div class=\"rule rule_s%d\">"
"<span>----</span></div>\n", lv);
ri++;
+ } else if(tcstrfwm(line, "gist:")){
+ const char *uri;
@tochiz
tochiz / twitpost.c
Created July 21, 2011 18:24
C code for post to twitter.
//
// twitpost.c
// require liboauth and libtokyocabinet
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <oauth.h>
@tochiz
tochiz / gist:1098008
Created July 21, 2011 19:39
promenade.c diff file.
diff --git a/promenade.c b/promenade.c
index 7d82a15..e37ed06 100644
--- a/promenade.c
+++ b/promenade.c
@@ -592,8 +594,11 @@ static void dosession(TCMPOOL *mpool){
if(dbputart(tdb, p_id, cols)){
if(*g_updatecmd != '\0' &&
!doupdatecmd(mpool, "comment", p_scripturl, p_user, now, p_id, cols, ocols))
+ {
tclistprintf(emsgs, "The update command was failed.");
@tochiz
tochiz / gist:1102095
Created July 24, 2011 01:43
gentoo prefix bootstrap_prefix.sh for testing
--- Downloads/bootstrap-prefix.sh 2011-07-24 10:35:03.000000000 +0900
+++ bootstrap-prefix.sh 2011-07-24 10:30:44.000000000 +0900
@@ -161,6 +161,24 @@
HOSTCC='gcc -m64'
"
;;
+ i*86-apple-darwin11)
+ profile="${PORTDIR}/profiles/prefix/darwin/macos/10.7/x86"
+ ldflags_make_defaults="LDFLAGS=\"-Wl,-search_paths_first -L${ROOT}/usr/lib -L${ROOT}/lib\""
+ extra_make_globals="
@tochiz
tochiz / gist:1102253
Created July 24, 2011 04:37
gentoo prefix coreutils patch for mac os x lion (for testing)
diff -ruN coreutils-6.11.orig/coreutils-6.11/lib/stpncpy.c coreutils-6.11/coreutils-6.11/lib/stpncpy.c
--- coreutils-6.11.orig/coreutils-6.11/lib/stpncpy.c 2011-07-24 13:28:40.000000000 +0900
+++ coreutils-6.11/coreutils-6.11/lib/stpncpy.c 2011-07-24 14:32:40.000000000 +0900
@@ -23,6 +23,9 @@
/* Specification. */
#include <string.h>
+#undef __stpncpy
+#undef stpncpy
+
@tochiz
tochiz / macosxlion_prefix.patch
Created July 24, 2011 21:56
gentoo prefix bootstrap_prefix.sh patch for mac os x lion(for testing)#2
--- Downloads/bootstrap-prefix.sh 2011-07-24 10:35:03.000000000 +0900
+++ bootstrap-prefix.sh 2011-07-25 06:48:34.000000000 +0900
@@ -161,6 +161,34 @@
HOSTCC='gcc -m64'
"
;;
+ i*86-apple-darwin11)
+ if [ ! -d ${PORTDIR}/profiles/prefix/darwin/macos/10.7 ]; then
+ cp -r ${PORTDIR}/profiles/prefix/darwin/macos/10.6 ${PORTDIR}/profiles/prefix/darwin/macos/10.7
+ grep -lr 10.6 ${PORTDIR}/profiles/prefix/darwin/macos/10.7 | xargs sed -i 's/10.6/10.7/g'
@tochiz
tochiz / perl-darwin11-nm-ar.patch
Created July 25, 2011 03:48
Gentoo Prefix perl nm ar search error fix patch.
diff -ruN perl-5.12.3.orig/cpan/Archive-Tar/t/02_methods.t perl-5.12.3/cpan/Archive-Tar/t/02_methods.
t
--- perl-5.12.3.orig/cpan/Archive-Tar/t/02_methods.t 2011-07-25 11:23:59.000000000 +0900
+++ perl-5.12.3/cpan/Archive-Tar/t/02_methods.t 2011-07-25 12:24:01.000000000 +0900
@@ -70,6 +70,20 @@
my $TOO_LONG = ($^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'VMS')
&& length( cwd(). $LONG_FILE ) > 247;
+if(!$TOO_LONG) {
+ my $alt = File::Spec->catfile( cwd(), $LONG_FILE);
@tochiz
tochiz / gist:1103706
Created July 25, 2011 07:31
readline ebuild diff
--- portage/sys-libs/readline/readline-6.1_p2.ebuild 2011-02-11 00:31:34.000000000 +0900
+++ local/portage/local/sys-libs/readline/readline-6.1_p2.ebuild 2011-07-25 16:31:04.000000000 +0900
@@ -79,6 +79,9 @@
append-cppflags -D_GNU_SOURCE
econf --with-curses || die
+
+ sed -i -e 's/-dynamic/-dynamiclib/' shlib/Makefile
+
emake || die
@tochiz
tochiz / gist:1103721
Created July 25, 2011 07:44
gettext ebuild diff
--- ../../../../../portage/sys-devel/gettext/gettext-0.18.1.1-r1.ebuild 2011-01-28 04:01:41.000000000 +0900
+++ ./gettext-0.18.1.1-r1.ebuild 2011-07-25 16:40:38.000000000 +0900
@@ -36,6 +36,13 @@
sed -i -e '1c\#!/usr/bin/env sh' \
"${S}"/gettext-tools/misc/convert-archive.in || die
+ if [[ ${CHOST} == *-darwin11 ]] ; then
+ sed -i -e '/^#ifndef weak_alias$/a\# undef __stpncpy' \
+ gettext-tools/gnulib-lib/stpncpy.c
+ sed -i -e '/^# undef __stpncpy$/a\# undef stpncpy' \
@tochiz
tochiz / gist:1105899
Created July 26, 2011 03:33
Gentoo Prefix Python diff(not well-tested!)
--- usr/portage/dev-lang/python/python-2.7.2.ebuild 2011-06-29 01:31:31.000000000 +0900
+++ usr/local/portage/local/dev-lang/python/python-2.7.2-r1.ebuild 2011-07-26 04:14:05.000000000 +0900
@@ -202,6 +202,7 @@
use tk || disable+=" _tkinter"
use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
[[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
+ disable+=" _Fm _Qd _Qdoffs"
export PYTHON_DISABLE_MODULES="${disable}"
if ! use xml; then