aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/makensis.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Formula/makensis.rb b/Library/Formula/makensis.rb
index 44098fbf6..058636870 100644
--- a/Library/Formula/makensis.rb
+++ b/Library/Formula/makensis.rb
@@ -7,15 +7,47 @@ class Makensis < Formula
depends_on 'scons' => :build
+ # scons appears to have no builtin way to override the compiler selection,
+ # and the only options supported on OS X are 'gcc' and 'g++'.
+ # Use the right compiler by forcibly altering the scons config to set these
+ def patches; DATA; end
+
resource 'nsis' do
url 'http://downloads.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46.zip'
sha1 'adeff823a1f8af3c19783700a6b8d9054cf0f3c2'
end
def install
+ # makensis fails to build under libc++; since it's just a binary with
+ # no Homebrew dependencies, we can just use libstdc++
+ # https://sourceforge.net/p/nsis/bugs/1085/
+ ENV.libstdcxx if ENV.compiler == :clang
+
scons = Formula.factory('scons').opt_prefix/'bin/scons'
system scons, "makensis"
bin.install "build/release/makensis/makensis"
(share/'nsis').install resource('nsis')
end
end
+
+__END__
+diff --git a/SCons/config.py b/SCons/config.py
+index a344456..37c575b 100755
+--- a/SCons/config.py
++++ b/SCons/config.py
+@@ -1,3 +1,5 @@
++import os
++
+ Import('defenv')
+
+ ### Configuration options
+@@ -440,6 +442,9 @@ Help(cfg.GenerateHelpText(defenv))
+ env = Environment()
+ cfg.Update(env)
+
++defenv['CC'] = os.environ['CC']
++defenv['CXX'] = os.environ['CXX']
++
+ def AddValuedDefine(define):
+ defenv.Append(NSIS_CPPDEFINES = [(define, env[define])])
+