homebrew-core/Formula/mesa.rb
2019-07-10 04:25:24 +08:00

53 lines
1.9 KiB
Ruby

class Mesa < Formula
include Language::Python::Virtualenv
desc "Graphics Library"
homepage "https://www.mesa3d.org/"
url "https://mesa.freedesktop.org/archive/mesa-19.1.2.tar.xz"
sha256 "813a144ea8ebefb7b48b6733f3f603855b0f61268d86cc1cc26a6b4be908fcfd"
head "https://gitlab.freedesktop.org/mesa/mesa.git"
bottle do
sha256 "04791b5e5844bd560ddeb7b2a2b7536acee71b84e102a2a7a4080643711acd5d" => :mojave
sha256 "9f6b18b930bc6dc453e23e8cba5b4258bdbec765aca6c71398ad2dee65773dfa" => :high_sierra
sha256 "38550737bc0793185a9a17eb38298c561689e5619a06cbe777b1fb56b6a7899c" => :sierra
end
depends_on "meson-internal" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python@2" => :build
depends_on "freeglut" => :test
depends_on "expat"
depends_on "gettext"
depends_on :x11
resource "Mako" do
url "https://files.pythonhosted.org/packages/f9/93/63f78c552e4397549499169198698de23b559b52e57f27d967690811d16d/Mako-1.0.10.tar.gz"
sha256 "7165919e78e1feb68b4dbe829871ea9941398178fa58e6beedb9ba14acf63965"
end
resource "gears.c" do
url "https://www.opengl.org/archives/resources/code/samples/glut_examples/mesademos/gears.c"
sha256 "7df9d8cda1af9d0a1f64cc028df7556705d98471fdf3d0830282d4dcfb7a78cc"
end
def install
ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python2.7/site-packages"
resource("Mako").stage do
system "python", *Language::Python.setup_install_args(buildpath/"vendor")
end
resource("gears.c").stage(pkgshare.to_s)
mkdir "build" do
system "meson", "--prefix=#{prefix}", "-D buildtype=plain", "-D b_ndebug=true", ".."
system "ninja"
system "ninja", "install"
end
end
test do
system ENV.cc, "#{pkgshare}/gears.c", "-o", "gears", "-L#{lib}", "-I#{Formula["freeglut"].opt_include}", "-L#{Formula["freeglut"].opt_lib}", "-lgl", "-lglut"
end
end