Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playing around with ogre 1.8 and 1.9. #24

Closed
wants to merge 11 commits into from
2 changes: 1 addition & 1 deletion gazebo2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Gazebo2 < Formula
depends_on 'doxygen'
depends_on 'freeimage'
depends_on 'libtar'
depends_on 'ogre'
depends_on 'ogre1.9'
depends_on 'protobuf'
depends_on 'protobuf-c'
depends_on 'qt'
Expand Down
63 changes: 63 additions & 0 deletions ogre1.8.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
require 'formula'

class Ogre18 < Formula
homepage 'http://www.ogre3d.org/'
# url 'http://downloads.sourceforge.net/project/ogre/ogre/1.7/ogre_src_v1-7-4.tar.bz2'
# version '1.7.4'
# sha1 'e989b96eacc2c66f8cf8a19dae6cfd962a165207'

url 'http://downloads.sourceforge.net/project/ogre/ogre/1.8/1.8.1/ogre_src_v1-8-1.tar.bz2'
version '1.8.1'
sha1 'd6153cacda24361a81e7d0a6bf9aa641ad9dd650'

# url 'https://bitbucket.org/sinbad/ogre/get/v1-9-0.tar.gz'
# version '1.9.0'
# sha1 'dd1c0a27ff76a34d3c0daf7534ab9cd16e399f86'

head 'https://bitbucket.org/sinbad/ogre', :branch => 'v1-8', :using => :hg

patch do
url 'https://gist.githubusercontent.com/NikolausDemmel/dad2dec7e52bed7c1bec/raw/f1bde5b93aa3f13780f7494f84dd3c76dd57c360/fixogre1.8.patch'
sha1 '0f9f15bfcb2296a7a12017acd2668594958bffe7'
end

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_FULL_RPATH:BOOL=FALSE",
"-DOGRE_BUILD_DOCS:BOOL=TRUE",
"-DOGRE_INSTALL_DOCS:BOOL=TRUE",
"-DOGRE_BUILD_SAMPLES:BOOL=FALSE",
"-DOGRE_INSTALL_SAMPLES:BOOL=FALSE",
"-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE",
"-DOGRE_CONFIG_ENABLE_LIBCPP_SUPPORT=ON",
]
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

Dir.glob(lib/"OGRE/*.dylib") do |path|
filename = File.basename(path)
symlink path, lib/"OGRE/lib#{filename}"
end

end
end
106 changes: 106 additions & 0 deletions ogre1.9.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
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'
sha1 'dd1c0a27ff76a34d3c0daf7534ab9cd16e399f86'

patch do
url 'https://gist.githubusercontent.com/NikolausDemmel/2b11d1b49b35cd27a102/raw/3af6b11889a90d7e35bb90cdb34c46ea8334eaf3/fix-1.9.0-release.diff'
sha1 '9ad217fc33690f76fd857ba49c3840715d4f3527'
end

patch do
url 'https://gist.githubusercontent.com/hgaiser/9ed14de3d776cd34100e/raw/38c7a88cab9067e88a21f1386fbb8ac1aaeed8ac/window.patch'
sha1 'c520d0641183bb275a0b29ef6188353bc2ba6217'
end
end

devel do
url 'https://bitbucket.org/sinbad/ogre/get/v1-9.tar.bz2'
version '1.9.1-devel'
sha1 'aa9b0c6d371802e0535515758e88c4893045cd5f'

patch do
url 'https://gist.github.com/NikolausDemmel/2b11d1b49b35cd27a102/raw/bf4a4d16020821218f73db0d56aa111ab2fde679/fix-1.9-HEAD.diff'
sha1 '90bef44c2a821bba3254c011b0aa0f5ecedeb788'
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'
sha1 '44ef20d7a7124814bacade807a7d97bb8c1e6356'
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