Skip to content

Instantly share code, notes, and snippets.

@blt
Forked from juniorz/sfml.rb
Last active December 17, 2015 11:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save blt/5606902 to your computer and use it in GitHub Desktop.
Save blt/5606902 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.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