2010-07-10 20:32:50 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Makensis < Formula
|
2010-07-10 20:32:50 +00:00
|
|
|
homepage 'http://nsis.sourceforge.net/'
|
2013-01-29 05:30:54 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46-src.tar.bz2'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '2cc9bff130031a0b1d76b01ec0a9136cdf5992ce'
|
2010-07-10 20:32:50 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'scons' => :build
|
2010-07-10 20:32:50 +00:00
|
|
|
|
2013-12-07 02:26:34 +00:00
|
|
|
# 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
|
|
|
|
|
2013-06-09 00:28:37 +00:00
|
|
|
resource 'nsis' do
|
|
|
|
url 'http://downloads.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46.zip'
|
|
|
|
sha1 'adeff823a1f8af3c19783700a6b8d9054cf0f3c2'
|
|
|
|
end
|
|
|
|
|
2010-07-10 20:32:50 +00:00
|
|
|
def install
|
2013-12-07 02:26:34 +00:00
|
|
|
# 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
|
|
|
|
|
2013-12-06 05:03:32 +00:00
|
|
|
scons = Formula.factory('scons').opt_prefix/'bin/scons'
|
|
|
|
system scons, "makensis"
|
2010-07-10 20:32:50 +00:00
|
|
|
bin.install "build/release/makensis/makensis"
|
2013-06-09 00:28:37 +00:00
|
|
|
(share/'nsis').install resource('nsis')
|
2010-07-10 20:32:50 +00:00
|
|
|
end
|
|
|
|
end
|
2013-12-07 02:26:34 +00:00
|
|
|
|
|
|
|
__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])])
|
|
|
|
|