Created
June 13, 2015 10:55
-
-
Save ymmtmdk/5b15f2b06aef5549eb5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md | |
# /usr/local/Library/Contributions/example-formula.rb | |
class Libsge < Formula | |
desc 'An add-on graphics library for the Simple Direct Media Layer' | |
homepage 'https://github.com/flibitijibibo/libSGE/' | |
url 'git://github.com/flibitijibibo/libSGE.git', revision: '1085c4958397b91a42c399bc389e8fddde8f207b' | |
version '1085c49' | |
depends_on 'sdl' | |
def install | |
args = %W( | |
PREFIX=#{prefix} | |
PREFIX_H=#{prefix}/include/SDL | |
) | |
system 'make', 'install', *args | |
end | |
test do | |
(testpath / 'test.c').write <<-EOS.undent | |
#include "sge.h" | |
int main() { | |
sge_Random(1,10); | |
return 0; | |
} | |
EOS | |
system "#{ENV.cc} test.c `sdl-config --cflags --libs` -lsge -otest" | |
system './test' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment