Skip to content

Instantly share code, notes, and snippets.

@iche033
Created December 7, 2016 05:36
Show Gist options
  • Save iche033/1d85da5bf344197eeffaa4410e169e8d to your computer and use it in GitHub Desktop.
Save iche033/1d85da5bf344197eeffaa4410e169e8d to your computer and use it in GitHub Desktop.
require 'formula'
class Ogre19 < Formula
homepage 'http://www.ogre3d.org/'
stable do
url 'https://bitbucket.org/sinbad/ogre/get/v1-9-0.tar.gz'
version '1.9.0'
sha256 'ead2baa807903b740e726ebf2f205ad2de9f9aacaeeae0a38fc3e29184f50f5d'
patch do
url 'https://gist.githubusercontent.com/NikolausDemmel/2b11d1b49b35cd27a102/raw/3af6b11889a90d7e35bb90cdb34c46ea8334eaf3/fix-1.9.0-release.diff'
sha256 'f4c9a332c9dc22711570892163f66e325109e77c5483a00c1c0fa8880b0eb9b3'
end
patch do
url 'https://gist.githubusercontent.com/hgaiser/9ed14de3d776cd34100e/raw/38c7a88cab9067e88a21f1386fbb8ac1aaeed8ac/window.patch'
sha256 'cb19553ff6180ec24e12402ae9493f1c07fd6001b12cdccf98aeacb201506dbc'
end
patch do
url 'https://gist.githubusercontent.com/iche033/68349eebfc436e484b70e6e3508ae27b/raw/d96227cd79ed1d63f051689a18c95a1c174a4efa/ogre-1.9-ois.patch'
sha256 '7ad630740217ccb9f48898507e9c6713dcd37a677a9669cdc16ef39afbf68826'
end
patch do
url 'https://gist.githubusercontent.com/iche033/b73766fac9ab3d628a79b5ed986677cd/raw/878d0902704c7fb51511163052c95294361f1dbe/ogre-1.9-agl.patch'
sha256 '8122c7eb52faae0fdedb70278d24e2581c88d1181de4d6e94d27bc1b3e596181'
end
end
devel do
url 'https://bitbucket.org/sinbad/ogre/get/v1-9.tar.bz2'
version '1.9.1-devel'
sha256 '3ca667b959905b290d782d7f0808e35d075c85db809d3239018e4e10e89b1721'
patch do
url 'https://gist.github.com/NikolausDemmel/2b11d1b49b35cd27a102/raw/bf4a4d16020821218f73db0d56aa111ab2fde679/fix-1.9-HEAD.diff'
sha256 '15ecd1f12266918650ea789e2f96da4b0ef1a96076d7a671d3c56d98e2459712'
end
patch do
# this is the same patch as hgaiser's `window.patch` above, but applicable to the latest 1.9 version
url 'https://gist.githubusercontent.com/NikolausDemmel/927bd7bb3f14c1788599/raw/c9a5ba88b758e80d3f46511629c4e8026b92c462/ogre1.9.patch'
sha256 'e82d842138f7f5ff4637ed313d1140c3b868c8425d4cdba7a71e0a9d7f7e0fd6'
end
patch do
url 'https://gist.githubusercontent.com/iche033/68349eebfc436e484b70e6e3508ae27b/raw/d96227cd79ed1d63f051689a18c95a1c174a4efa/ogre-1.9-ois.patch'
sha256 '7ad630740217ccb9f48898507e9c6713dcd37a677a9669cdc16ef39afbf68826'
end
patch do
url 'https://gist.githubusercontent.com/iche033/b73766fac9ab3d628a79b5ed986677cd/raw/878d0902704c7fb51511163052c95294361f1dbe/ogre-1.9-agl.patch'
sha256 '8122c7eb52faae0fdedb70278d24e2581c88d1181de4d6e94d27bc1b3e596181'
end
patch do
url 'https://gist.githubusercontent.com/iche033/e0080a592c890cc9a4fce31f6863a5ed/raw/875ae8ad1d9f0eaa271fd44eab8e0979bac74119/ogre-1.9-cocoa_window_scale.patch'
sha256 'c20c288530ea4d11b37f9c8b30cb43c89722c85eac0af3b6520cd89c37014e5b'
end
end
#head 'https://bitbucket.org/sinbad/ogre', :using => :hg
#patch :DATA
depends_on 'boost'
depends_on 'cmake' => :build
depends_on 'doxygen'
depends_on 'freeimage'
depends_on 'freetype'
depends_on 'libzzip'
depends_on 'tbb'
depends_on :x11
option 'with-cg'
def install
ENV.m64
cmake_args = [
"-DCMAKE_OSX_ARCHITECTURES='x86_64'",
"-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=OFF",
"-DOGRE_FULL_RPATH:BOOL=FALSE",
"-DOGRE_BUILD_DOCS:BOOL=FALSE",
"-DOGRE_INSTALL_DOCS:BOOL=FALSE",
"-DOGRE_BUILD_SAMPLES:BOOL=FALSE",
"-DOGRE_INSTALL_SAMPLES:BOOL=FALSE",
"-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE",
]
cmake_args << "-DOGRE_BUILD_PLUGIN_CG=OFF" unless build.include? "with-cg"
cmake_args.concat(std_cmake_args)
cmake_args << ".."
mkdir "build" do
system "cmake", *cmake_args
system "make install"
end
# Reference of where debian puts files:
# https://packages.debian.org/jessie/amd64/libogre-1.9-dev/filelist
# https://packages.debian.org/jessie/amd64/libogre-1.9.0/filelist
# FIXME: for now we build with doc and samples OFF, so config files, media
# and docs are not present
# remove config files from bin directory
# (share/'OGRE/config').install Dir[bin/"macosx/*.cfg"]
# rmdir bin/"macosx"
#
# (share/"OGRE/").install prefix/"Media"
# rmdir prefix/"Media"
#
# (doc/"OGRE").install Dir[prefix/"Docs/*"]
# rmdir prefix/"Docs"
# Put these cmake files where Debian puts them
(share/"OGRE/cmake/modules").install Dir[prefix/"CMake/*.cmake"]
rmdir prefix/"CMake"
# This is necessary because earlier versions of Ogre seem to have created
# the plugins with "lib" prefix and software like "rviz" now has Mac
# specific code that looks for the plugins with "lib" prefix. Hence we add
# symlinks with the "lib" prefix manually, but their use is deprecated.
Dir.glob(lib/"OGRE/*.dylib") do |path|
filename = File.basename(path)
symlink path, lib/"OGRE/lib#{filename}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment