Skip to content

Instantly share code, notes, and snippets.

@mystal
Created September 19, 2015 18:35
Show Gist options
  • Save mystal/0ebc56c18233158bbc2a to your computer and use it in GitHub Desktop.
Save mystal/0ebc56c18233158bbc2a to your computer and use it in GitHub Desktop.
Panda3d Homebrew Formula
class Panda3d < Formula
desc "Framework for 3D rendering and game development"
homepage "https://www.panda3d.org"
url "https://www.panda3d.org/download/panda3d-1.9.0/panda3d-1.9.0.tar.gz"
version "1.9.0"
sha256 "4bcec504d35d64eaaeb93d47be747de460bf582e2b1bf91ed311e0b4fd04cc83"
depends_on :python => :build
depends_on :python => :recommended
depends_on "lzlib" => :recommended
depends_on "libjpeg" => :recommended
depends_on "libpng" => :recommended
depends_on "openssl" => :recommended
depends_on "libvorbis" => :recommended
depends_on "freetype" => :recommended
depends_on "openal-soft" => :recommended
depends_on "eigen" => :recommended
depends_on "libtiff" => :recommended
depends_on "ffmpeg" => :optional
depends_on "bullet" => :optional
depends_on "ode" => :optional
depends_on "fftw" => :optional
def install
inreplace "makepanda/installpanda.py" do |s|
s.gsub! "(sys.platform.startswith(\"win\") or sys.platform == \"darwin\")",
"(sys.platform.startswith(\"win\"))"
s.gsub! "PPATH = get_python_lib(1)",
"PPATH = prefix+\"/lib/python2.7/site-packages\""
s.gsub! "destdir+\"/etc", "destdir+prefix+\"/etc"
end
system "python", "makepanda/makepanda.py", "--everything", "--threads", 4 #"#{ENV.determine_make_jobs}"
system "python", "makepanda/installpanda.py", "--prefix=#{prefix}"
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test panda3d`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "false"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment