homebrew-core/Formula/allegro.rb

64 lines
1.9 KiB
Ruby
Raw Normal View History

class Allegro < Formula
desc "C/C++ multimedia library for cross-platform game development"
homepage "http://liballeg.org/"
revision 1
head "https://github.com/liballeg/allegro5.git", :branch => "master"
2015-10-17 14:38:17 +00:00
stable do
url "http://download.gna.org/allegro/allegro/5.2.1.1/allegro-5.2.1.1.tar.gz"
sha256 "b5d9df303bc6d72d54260c24505889acd995049b75463b46344e797a58a44a71"
# Fix compilation on 10.12
# https://github.com/liballeg/allegro5/pull/682
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/2daef1c/allegro/patch-allegro-10.12.diff"
sha256 "f2879676a370749319b8247ab7437b8060c9d9dc2f58f45db0d782419fe37adf"
end
end
2015-06-01 03:40:48 +00:00
bottle do
cellar :any
2016-10-17 14:58:27 +00:00
sha256 "8491d79cf614dbf5a4fe3798d18d70493c64035d8d9c36db580f3654b7d294fe" => :sierra
sha256 "91486ac3298f48f4160fbed4980fc0ee3f92ff9ee6c3d92b9d1af83fc5bb2c88" => :el_capitan
sha256 "7488de3a760d2e36ab3a5933cff118c622a3dd9fb854bc31b8934922bb5cede6" => :yosemite
2015-06-01 03:40:48 +00:00
end
depends_on "cmake" => :build
depends_on "libvorbis" => :recommended
depends_on "freetype" => :recommended
depends_on "flac" => :recommended
depends_on "physfs" => :recommended
depends_on "libogg" => :recommended
depends_on "opusfile" => :recommended
depends_on "theora" => :recommended
depends_on "dumb" => :optional
def install
args = std_cmake_args
args << "-DWANT_DOCS=OFF"
args << "-DWANT_MODAUDIO=1" if build.with?("dumb")
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
end
end
test do
(testpath/"allegro_test.cpp").write <<-EOS
#include <assert.h>
#include <allegro5/allegro5.h>
int main(int n, char** c) {
if (!al_init()) {
return 1;
}
return 0;
}
EOS
system ENV.cxx, "-I#{include}", "-L#{lib}", "-lallegro", "-lallegro_main", "-o", "allegro_test", "allegro_test.cpp"
system "./allegro_test"
end
end