Skip to content

Instantly share code, notes, and snippets.

@blt blt/sfml.rb forked from juniorz/sfml.rb
Last active Dec 17, 2015

Embed
What would you like to do?
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Sfml < Formula
homepage 'http://www.sfml-dev.org'
version '2.0'
url 'http://www.sfml-dev.org/download/sfml/2.0/SFML-2.0-sources.zip'
sha1 'ff8cf290f49e1a1d8517a4a344e9214139da462f'
depends_on 'cmake' => :build
depends_on 'freetype' => :build
depends_on 'jpeg' => :build
depends_on 'glew' => :build
depends_on 'libsndfile' => :build
# libsndfile depends on them (it is all or none)
# flac, libogg, libvorbis
def install
ENV.universal_binary if build.include? 'universal'
args = std_cmake_args
args.delete '-DCMAKE_BUILD_TYPE=None'
args.push '-DCMAKE_BUILD_TYPE=Release', '-DINSTALL_EXTERNAL_LIBS=FALSE'
args.push '-DSFML_BUILD_FRAMEWORKS=TRUE', "-DCMAKE_INSTALL_FRAMEWORK_PREFIX=#{prefix}/Frameworks"
args << '-DBUILD_SHARED_LIBS=FALSE' if build.include? 'static'
system 'cmake', '.', *args
system 'make install'
end
def caveats
msg = ""
msg = <<-EOS.undent
The CMake find-module is available at #{opt_prefix}/share/sfml/cmake/Modules/FindSFML.cmake
You may need to copy it to #{HOMEBREW_PREFIX}/share/cmake/Modules
EOS
msg.concat framework_caveats if build.include? 'framework'
msg.concat examples_caveats if build.include? 'build-examples'
msg
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.