Created
March 9, 2011 21:03
-
-
Save netoneko/863003 to your computer and use it in GitHub Desktop.
freebsd port of homebrew and bugfix for unintentional altering file permissions for executables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff ../Library/Homebrew/ | |
diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb | |
index 58b1a3b..96f2d1e 100644 | |
--- a/Library/Homebrew/cleaner.rb | |
+++ b/Library/Homebrew/cleaner.rb | |
@@ -41,6 +41,9 @@ private | |
when /Mach-O [^ ]* ?executable/ | |
strip path | |
perms=0555 | |
+ when /ELF (.*) executable/ | |
+ strip path | |
+ perms=0555 | |
when /script text executable/ | |
perms=0555 | |
end | |
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb | |
index 5382020..8654910 100644 | |
--- a/Library/Homebrew/extend/ENV.rb | |
+++ b/Library/Homebrew/extend/ENV.rb | |
@@ -21,7 +21,7 @@ module HomebrewEnvExtension | |
self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}" | |
end | |
- if SystemCommand.platform == :linux | |
+ if SystemCommand.platform == :linux || SystemCommand.platform == :freebsd | |
self['CC'] = '/usr/bin/cc' | |
self['CXX'] = '/usr/bin/c++' | |
cflags = ['-O3'] | |
diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb | |
index 834f3d4..89a75c9 100644 | |
--- a/Library/Homebrew/system_command.rb | |
+++ b/Library/Homebrew/system_command.rb | |
@@ -6,6 +6,8 @@ module Homebrew | |
:linux | |
elsif RUBY_PLATFORM =~ /.*-darwin.*/ | |
:mac | |
+ elsif RUBY_PLATFORM =~ /.*-freebsd.*/ | |
+ :freebsd | |
else | |
:dunno | |
end | |
@@ -27,6 +29,8 @@ module Homebrew | |
@@provider ||= SystemCommandLinux.new | |
when 'Darwin' | |
@@provider ||= SystemCommandMac.new | |
+ when 'FreeBSD' | |
+ @@provider ||= SystemCommandFreeBSD.new | |
else | |
raise Exception.new 'Unknown platform. Aborting.' | |
end | |
@@ -79,4 +83,10 @@ module Homebrew | |
end | |
end | |
+ | |
+ class SystemCommandFreeBSD < SystemCommandMac | |
+ def which_s | |
+ "/usr/bin/which" | |
+ end | |
+ end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment