Skip to content

Instantly share code, notes, and snippets.

@clooth
Forked from blt/sfml.rb
Last active December 23, 2015 09:28
Show Gist options
  • Save clooth/6614288 to your computer and use it in GitHub Desktop.
Save clooth/6614288 to your computer and use it in GitHub Desktop.
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.1/SFML-2.1-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