2009-11-02 02:57:04 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-07-22 22:03:46 +00:00
|
|
|
class FrameworkPython < Requirement
|
2013-01-19 01:30:43 +00:00
|
|
|
fatal true
|
|
|
|
|
2013-01-20 02:45:59 +00:00
|
|
|
satisfy do
|
2012-07-22 22:03:46 +00:00
|
|
|
q = `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
|
|
|
|
not q.chomp.empty?
|
|
|
|
end
|
2013-01-20 02:45:59 +00:00
|
|
|
|
|
|
|
def message
|
|
|
|
"Python needs to be built as a framework."
|
|
|
|
end
|
2012-07-22 22:03:46 +00:00
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Wxmac < Formula
|
2012-02-15 23:23:55 +00:00
|
|
|
homepage 'http://www.wxwidgets.org'
|
2013-06-20 23:08:35 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2'
|
2012-07-23 08:53:34 +00:00
|
|
|
sha1 'c292cd45b51e29c558c4d9cacf93c4616ed738b9'
|
2012-02-15 23:23:55 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on :python => :recommended
|
|
|
|
depends_on FrameworkPython if build.with? "python"
|
2012-07-22 22:03:46 +00:00
|
|
|
|
|
|
|
def install_wx_python
|
2012-02-26 22:04:37 +00:00
|
|
|
args = [
|
2011-03-30 04:29:41 +00:00
|
|
|
# Reference our wx-config
|
|
|
|
"WX_CONFIG=#{bin}/wx-config",
|
2012-01-01 03:01:35 +00:00
|
|
|
# At this time Wxmac is installed Unicode only
|
|
|
|
"UNICODE=1",
|
2012-12-11 13:48:18 +00:00
|
|
|
# Some scripts (e.g. matplotlib) expect to `import wxversion`, which is
|
|
|
|
# only available on a multiversion build. Besides that `import wx` still works.
|
|
|
|
"INSTALL_MULTIVERSION=1",
|
2012-02-15 23:23:55 +00:00
|
|
|
# OpenGL and stuff
|
2012-01-01 03:01:35 +00:00
|
|
|
"BUILD_GLCANVAS=1",
|
2012-02-15 23:23:55 +00:00
|
|
|
"BUILD_GIZMOS=1",
|
|
|
|
"BUILD_STC=1"
|
2011-03-30 04:29:41 +00:00
|
|
|
]
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "wxPython" do
|
2012-02-26 22:04:37 +00:00
|
|
|
ENV.append_to_cflags '-arch x86_64' if MacOS.prefer_64_bit?
|
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
python do
|
|
|
|
system python, "setup.py",
|
2012-02-26 22:04:37 +00:00
|
|
|
"build_ext",
|
|
|
|
"WXPORT=osx_cocoa",
|
|
|
|
*args
|
2013-01-21 09:33:56 +00:00
|
|
|
system python, "setup.py",
|
2012-02-26 22:04:37 +00:00
|
|
|
"install",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"WXPORT=osx_cocoa",
|
|
|
|
*args
|
2013-01-21 09:33:56 +00:00
|
|
|
end
|
2012-02-26 22:04:37 +00:00
|
|
|
end
|
|
|
|
end
|
2012-02-15 23:23:55 +00:00
|
|
|
|
2009-11-02 02:57:04 +00:00
|
|
|
def install
|
2012-08-23 22:14:08 +00:00
|
|
|
# need to set with-macosx-version-min to avoid configure defaulting to 10.5
|
2011-10-30 23:47:24 +00:00
|
|
|
args = [
|
2012-07-22 22:03:46 +00:00
|
|
|
"--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-unicode",
|
|
|
|
"--enable-std_string",
|
|
|
|
"--enable-display",
|
|
|
|
"--with-opengl",
|
|
|
|
"--with-osx_cocoa",
|
|
|
|
"--with-libjpeg",
|
|
|
|
"--with-libtiff",
|
|
|
|
"--with-libpng",
|
|
|
|
"--with-zlib",
|
|
|
|
"--enable-dnd",
|
|
|
|
"--enable-clipboard",
|
|
|
|
"--enable-webkit",
|
|
|
|
"--enable-svg",
|
|
|
|
"--with-expat",
|
2012-08-23 22:14:08 +00:00
|
|
|
"--with-macosx-version-min=#{MacOS.version}"
|
2012-07-22 22:03:46 +00:00
|
|
|
]
|
2011-10-30 23:47:24 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2009-11-02 02:57:04 +00:00
|
|
|
system "make install"
|
2011-03-30 04:29:41 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
if build.with? "python"
|
2011-03-30 04:29:41 +00:00
|
|
|
ENV['WXWIN'] = Dir.getwd
|
2012-02-26 22:04:37 +00:00
|
|
|
# We have already downloaded wxPython in a bundle with wxWidgets
|
|
|
|
install_wx_python
|
2011-03-30 04:29:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
2012-02-15 23:23:55 +00:00
|
|
|
s = ''
|
2012-07-23 08:53:34 +00:00
|
|
|
fp = FrameworkPython.new
|
2013-01-21 09:33:56 +00:00
|
|
|
unless build.without? 'python' or fp.satisfied?
|
2012-07-23 08:53:34 +00:00
|
|
|
s += fp.message
|
2011-03-30 04:29:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return s
|
2009-11-02 02:57:04 +00:00
|
|
|
end
|
|
|
|
end
|