Skip to content

Instantly share code, notes, and snippets.

@tochiz
tochiz / gist:1153018
Created August 18, 2011 00:37
util-linux want_libuuid ebuild diff (for macosx gentoo prefix testing)
--- util-linux-2.18-r1.ebuild.bak 2011-01-08 23:01:34.000000000 +0900
+++ util-linux-2.18-r1.ebuild 2011-08-18 09:22:46.000000000 +0900
@@ -85,8 +85,8 @@
}
want_libuuid() {
- # bug #350841, currently only not on OS X Snow Leopard
- [[ ${CHOST} != *-darwin10 ]]
+ # bug #350841, currently only not on OS X Snow Leopard & Lion
+ [[ ${CHOST} != *-darwin10 && ${CHOST} != *-darwin11 ]]
@tochiz
tochiz / doxygen-1.7.4-macosx-lion.patch
Created August 11, 2011 18:25
gentoo prefix app-doc/doxygen patch for mac os x lion
diff -ruN doxygen-1.7.4.orig/qtools/qglobal.h doxygen-1.7.4/qtools/qglobal.h
--- doxygen-1.7.4.orig/qtools/qglobal.h 2011-08-12 03:16:23.000000000 +0900
+++ doxygen-1.7.4/qtools/qglobal.h 2011-08-12 03:18:35.000000000 +0900
@@ -89,7 +89,10 @@
# if !defined(MAC_OS_X_VERSION_10_6)
# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
# endif
-# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6)
+# if !defined(MAC_OS_X_VERSION_10_7)
+# define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1
@tochiz
tochiz / counter.cpp
Created August 3, 2011 12:34
C++ fastcgi sample
#include <iostream>
#include <fstream>
#include <fcgi_stdio.h>
#include <unistd.h>
int main( int argc , char * argv[] )
{
int result;
unsigned long long cnt = 0;
const char* output = NULL;
@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
@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: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 / 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 / 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 / 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 / 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="