homebrew-core/Formula/mesa.rb
2020-01-09 23:12:30 +00:00

61 lines
2.1 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.3.2.tar.xz"
mirror "https://www.mesa3d.org/archive/mesa-19.3.2.tar.xz"
sha256 "4e3aee324616352bbc7f58d47ab573e10f68cc7719fd045bd6d3abcdd97ee1c1"
head "https://gitlab.freedesktop.org/mesa/mesa.git"
bottle do
cellar :any
sha256 "73da7f0342380bfda82c14c97cdd8f70176d7a4ff06de38bd80ce47f67e34509" => :catalina
sha256 "03e7a8b57323e57678b171f45e9e1daa5a135f45a7b242c47f5f746a7acf482c" => :mojave
sha256 "21b610f24631e8c93ec98048c9f5ed5c462565935929ddf96d142506eeb4c8ac" => :high_sierra
end
depends_on "meson-internal" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python" => :build
depends_on "freeglut" => :test
depends_on "expat"
depends_on "gettext"
resource "Mako" do
url "https://files.pythonhosted.org/packages/b0/3c/8dcd6883d009f7cae0f3157fb53e9afb05a0d3d33b3db1268ec2e6f4a56b/Mako-1.1.0.tar.gz"
sha256 "a36919599a9b7dc5d86a7a8988f23a9a3a3d083070023bab23d64f7f1d1e0a4b"
end
resource "gears.c" do
url "https://www.opengl.org/archives/resources/code/samples/glut_examples/mesademos/gears.c"
sha256 "7df9d8cda1af9d0a1f64cc028df7556705d98471fdf3d0830282d4dcfb7a78cc"
end
def install
xy = Language::Python.major_minor_version "python3"
ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python#{xy}/site-packages"
resource("Mako").stage do
system "python3", *Language::Python.setup_install_args(buildpath/"vendor")
end
resource("gears.c").stage(pkgshare.to_s)
mkdir "build" do
system "meson", "--prefix=#{prefix}", "-Dbuildtype=plain", "-Db_ndebug=true", "-Dplatforms=surfaceless", "-Dglx=disabled", ".."
system "ninja"
system "ninja", "install"
end
end
test do
flags = %W[
-framework OpenGL
-I#{Formula["freeglut"].opt_include}
-L#{Formula["freeglut"].opt_lib}
-lglut
]
system ENV.cc, "#{pkgshare}/gears.c", "-o", "gears", *flags
end
end