2013-12-31 09:00:47 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class FrameworkPython < Requirement
|
|
|
|
fatal true
|
|
|
|
|
|
|
|
satisfy do
|
|
|
|
q = `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
|
|
|
|
not q.chomp.empty?
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
"Python needs to be built as a framework."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Wxpython < Formula
|
2014-02-28 04:47:43 +00:00
|
|
|
homepage "http://www.wxwidgets.org"
|
2014-03-05 04:02:39 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/wxpython/wxPython/3.0.0.0/wxPython-src-3.0.0.0.tar.bz2"
|
2014-02-28 04:47:43 +00:00
|
|
|
sha1 "48451763275cfe4e5bbec49ccd75bc9652cba719"
|
2013-12-31 09:00:47 +00:00
|
|
|
|
|
|
|
depends_on :python
|
|
|
|
depends_on FrameworkPython
|
2014-02-28 04:47:43 +00:00
|
|
|
depends_on "wxmac"
|
2013-12-31 09:00:47 +00:00
|
|
|
|
|
|
|
def install
|
2014-02-28 04:47:43 +00:00
|
|
|
ENV["WXWIN"] = buildpath
|
2013-12-31 09:00:47 +00:00
|
|
|
|
|
|
|
args = [
|
2014-02-28 04:47:43 +00:00
|
|
|
"WXPORT=osx_cocoa",
|
2013-12-31 09:00:47 +00:00
|
|
|
# Reference our wx-config
|
2014-03-06 05:28:31 +00:00
|
|
|
"WX_CONFIG=#{Formula["wxmac"].opt_bin}/wx-config",
|
2013-12-31 09:00:47 +00:00
|
|
|
# At this time Wxmac is installed Unicode only
|
|
|
|
"UNICODE=1",
|
|
|
|
# Some scripts (e.g. matplotlib) expect to `import wxversion`, which is
|
2014-02-28 04:47:43 +00:00
|
|
|
# only available on a multiversion build.
|
2013-12-31 09:00:47 +00:00
|
|
|
"INSTALL_MULTIVERSION=1",
|
|
|
|
# OpenGL and stuff
|
|
|
|
"BUILD_GLCANVAS=1",
|
|
|
|
"BUILD_GIZMOS=1",
|
|
|
|
"BUILD_STC=1"
|
|
|
|
]
|
2014-02-28 04:47:43 +00:00
|
|
|
|
2013-12-31 09:00:47 +00:00
|
|
|
cd "wxPython" do
|
|
|
|
ENV.append_to_cflags "-arch #{MacOS.preferred_arch}"
|
|
|
|
|
|
|
|
system "python", "setup.py",
|
|
|
|
"build_ext",
|
|
|
|
*args
|
2014-02-28 04:47:43 +00:00
|
|
|
|
2013-12-31 09:00:47 +00:00
|
|
|
system "python", "setup.py",
|
|
|
|
"install",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
*args
|
|
|
|
end
|
|
|
|
end
|
2014-02-28 04:47:43 +00:00
|
|
|
end
|