Skip to content

Instantly share code, notes, and snippets.

@camillol
camillol / gist:6020834
Created July 17, 2013 14:05
Add support for using a homebrew-compiled gcc 4.8 to compile other formulas.
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 8d971eb..47ae246 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -164,6 +164,16 @@ module HomebrewEnvExtension
end
alias_method :gcc_4_2, :gcc
+ def gcc48
+ self['CC'] = self['OBJC'] = "#{HOMEBREW_PREFIX}/bin/gcc-4.8"
@camillol
camillol / brew_python_install_scripts.diff
Last active December 11, 2015 07:18
A better way to get packages built against a homebrew-build Python to put their scripts where we want them. Mimics the approach used by the system python.
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index f1f3bd5..a094030 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -12,7 +12,7 @@ import sys, os, string
from types import *
from distutils.core import Command
from distutils.debug import DEBUG
-from distutils.sysconfig import get_config_vars
+from distutils.sysconfig import get_config_vars, get_config_var
@camillol
camillol / 0001-work-around-Ruby-1.8.6-s-lack-of-Symbol-to_proc.patch
Created November 14, 2012 05:22
homebrew-pcc: work around Ruby 1.8.6's lack of Symbol#to_proc
Library/Homebrew/extend/symbol.rb | 7 +++++++
Library/Homebrew/global.rb | 1 +
2 files changed, 8 insertions(+)
create mode 100644 Library/Homebrew/extend/symbol.rb
diff --git a/Library/Homebrew/extend/symbol.rb b/Library/Homebrew/extend/symbol.rb
new file mode 100644
index 0000000..00ac103
--- /dev/null
+++ b/Library/Homebrew/extend/symbol.rb
@camillol
camillol / glib-configurable-paths.diff
Created March 30, 2012 04:23
Patch to make some hardcoded paths in glib configurable
diff --git a/aclocal.m4 b/aclocal.m4
index 18400d2..f308b97 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1510,4 +1510,5 @@ m4_include([m4macros/ltoptions.m4])
m4_include([m4macros/ltsugar.m4])
m4_include([m4macros/ltversion.m4])
m4_include([m4macros/lt~obsolete.m4])
+m4_include([m4macros/as-ac-expand.m4])
m4_include([acinclude.m4])
@camillol
camillol / glib-gtimezone.diff
Created March 29, 2012 09:00
patch to let glib access timezone info on OS X
diff --git a/glib/gtimezone.c b/glib/gtimezone.c
index 8195106..08125ff 100644
--- a/glib/gtimezone.c
+++ b/glib/gtimezone.c
@@ -168,8 +168,12 @@ again:
G_UNLOCK(time_zones);
}
- if (tz->zoneinfo)
+ if (tz->zoneinfo) {
@camillol
camillol / glib-gunicollate.diff
Created March 29, 2012 09:00
patch to fix glib collation on recent OS X
diff --git a/glib/gunicollate.c b/glib/gunicollate.c
index 3649786..bd66c22 100644
--- a/glib/gunicollate.c
+++ b/glib/gunicollate.c
@@ -217,29 +217,25 @@ collate_key_to_string (UCCollationValue *key,
gsize key_len)
{
gchar *result;
- gsize result_len;
- gsize i;
@camillol
camillol / winebuild.patch
Created February 6, 2012 23:52
Wine Clang fix
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index 09f9b73..ed198f8 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -345,10 +345,11 @@ struct strarray *get_as_command(void)
if (!as_command)
{
- static const char * const commands[] = { "gas", "as", NULL };
- as_command = find_tool( "as", commands );
@camillol
camillol / spaceutil.c
Created August 6, 2011 14:54
Two ways of messing with spaces
#include <unistd.h>
#include <CoreServices/CoreServices.h>
#include <ApplicationServices/ApplicationServices.h>
typedef int CGSConnection;
extern OSStatus CGSGetWorkspace(const CGSConnection cid, int *workspace);
extern OSStatus CGSSetWorkspace(const CGSConnection cid, int workspace);
extern CGSConnection _CGSDefaultConnection(void);
int get_space_id(void);