Skip to content

Commit

Permalink
ocamlsdl 0.9.1 (new formula)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Pagnoux authored and MikeMcQuaid committed Jul 25, 2014
1 parent 06ced8a commit 7f2d9b4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Formula/ocamlsdl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require "formula"

class Ocamlsdl < Formula
homepage "http://ocamlsdl.sourceforge.net/"
url "https://downloads.sourceforge.net/project/ocamlsdl/OCamlSDL/ocamlsdl-0.9.1/ocamlsdl-0.9.1.tar.gz"
sha1 "2e54f8984b06cede493c3ad29006dde17077a79a"

depends_on "sdl"
depends_on "sdl_mixer" => :recommended
depends_on "sdl_image" => :recommended
depends_on "sdl_gfx" => :recommended
depends_on "sdl_ttf" => :recommended
depends_on "objective-caml"

def install
system "./configure", "--prefix=#{prefix}",
"OCAMLLIB=#{lib}/ocaml"
system "make"
system "make", "install"
end

test do
(testpath/'test.ml').write <<-EOS.undent
let main () =
Sdl.init [`VIDEO];
Sdl.quit ()
let _ = main ()
EOS
system "ocamlopt", "-I", "+sdl", "sdl.cmxa", "-cclib", "-lSDLmain", "-cclib", "-lSDL", "-cclib", "-Wl,-framework,Cocoa", "-o", "test" "test.ml"
end
end

0 comments on commit 7f2d9b4

Please sign in to comment.