|
|
|
@ -1,9 +1,10 @@ |
|
|
|
class Magnum < Formula |
|
|
|
class Magnum < Formula |
|
|
|
desc "C++11/C++14 graphics middleware for games and data visualization" |
|
|
|
desc "C++11/C++14 graphics middleware for games and data visualization" |
|
|
|
homepage "https://magnum.graphics" |
|
|
|
homepage "https://magnum.graphics" |
|
|
|
url "https://github.com/mosra/magnum/archive/v2020.06.tar.gz" |
|
|
|
# git describe origin/master, except the `v` prefix |
|
|
|
# wget https://github.com/mosra/magnum/archive/v2020.06.tar.gz -O - | sha256sum |
|
|
|
version "2020.06-3494-gb85f0c8df" |
|
|
|
sha256 "98dfe802e56614e4e6bf750d9b693de46a5ed0c6eb479b0268f1a20bf34268bf" |
|
|
|
# Clone instead of getting an archive to have tags for version.h generation |
|
|
|
|
|
|
|
url "https://github.com/mosra/magnum.git", revision: "b85f0c8df" |
|
|
|
head "https://github.com/mosra/magnum.git" |
|
|
|
head "https://github.com/mosra/magnum.git" |
|
|
|
|
|
|
|
|
|
|
|
depends_on "cmake" => :build |
|
|
|
depends_on "cmake" => :build |
|
|
|
@ -12,15 +13,6 @@ class Magnum < Formula |
|
|
|
depends_on "glfw" |
|
|
|
depends_on "glfw" |
|
|
|
|
|
|
|
|
|
|
|
def install |
|
|
|
def install |
|
|
|
# 2020.06 has the options unprefixed, current master has them prefixed. |
|
|
|
|
|
|
|
# Options not present in 2020.06 are prefixed always. |
|
|
|
|
|
|
|
option_prefix = build.head? ? 'MAGNUM_' : '' |
|
|
|
|
|
|
|
# 2020.06 has CMake 3.5 as minimum required for backwards compatibility |
|
|
|
|
|
|
|
# purposes, but it works with any newer. CMake 4.0 removed compatibility |
|
|
|
|
|
|
|
# with it and suggests this as an override. |
|
|
|
|
|
|
|
# TODO remove once a new release is finally made |
|
|
|
|
|
|
|
extra_cmake_args = build.head? ? [] : ['-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
system "mkdir build" |
|
|
|
system "mkdir build" |
|
|
|
cd "build" do |
|
|
|
cd "build" do |
|
|
|
system "cmake", |
|
|
|
system "cmake", |
|
|
|
@ -31,7 +23,7 @@ class Magnum < Formula |
|
|
|
# add this, which ultimately results in `-DCMAKE_FIND_FRAMEWORK=FIRST` |
|
|
|
# add this, which ultimately results in `-DCMAKE_FIND_FRAMEWORK=FIRST` |
|
|
|
# being passed to CMake. No idea what's going on, the regular CI build |
|
|
|
# being passed to CMake. No idea what's going on, the regular CI build |
|
|
|
# outside of Homebrew (although with CMake 3.26) doesn't need that. |
|
|
|
# outside of Homebrew (although with CMake 3.26) doesn't need that. |
|
|
|
*(std_cmake_args(find_framework: "FIRST") + extra_cmake_args), |
|
|
|
*std_cmake_args(find_framework: "FIRST"), |
|
|
|
# Without this, ARM builds will try to look for dependencies in |
|
|
|
# Without this, ARM builds will try to look for dependencies in |
|
|
|
# /usr/local/lib and /usr/lib (which are the default locations) instead |
|
|
|
# /usr/local/lib and /usr/lib (which are the default locations) instead |
|
|
|
# of /opt/homebrew/lib which is dedicated for ARM binaries. Please |
|
|
|
# of /opt/homebrew/lib which is dedicated for ARM binaries. Please |
|
|
|
@ -43,31 +35,31 @@ class Magnum < Formula |
|
|
|
# plugins and not those from the magnum-plugins package. Please |
|
|
|
# plugins and not those from the magnum-plugins package. Please |
|
|
|
# complain to Homebrew about this insane filesystem layout. |
|
|
|
# complain to Homebrew about this insane filesystem layout. |
|
|
|
"-DMAGNUM_PLUGINS_DIR=#{HOMEBREW_PREFIX}/lib/magnum", |
|
|
|
"-DMAGNUM_PLUGINS_DIR=#{HOMEBREW_PREFIX}/lib/magnum", |
|
|
|
"-D#{option_prefix}WITH_AUDIO=ON", |
|
|
|
"-DMAGNUM_WITH_AUDIO=ON", |
|
|
|
"-D#{option_prefix}WITH_GLFWAPPLICATION=ON", |
|
|
|
"-DMAGNUM_WITH_GLFWAPPLICATION=ON", |
|
|
|
"-D#{option_prefix}WITH_SDL2APPLICATION=ON", |
|
|
|
"-DMAGNUM_WITH_SDL2APPLICATION=ON", |
|
|
|
"-D#{option_prefix}WITH_WINDOWLESSCGLAPPLICATION=ON", |
|
|
|
"-DMAGNUM_WITH_WINDOWLESSCGLAPPLICATION=ON", |
|
|
|
"-D#{option_prefix}WITH_CGLCONTEXT=ON", |
|
|
|
"-DMAGNUM_WITH_CGLCONTEXT=ON", |
|
|
|
"-D#{option_prefix}WITH_OPENGLTESTER=ON", |
|
|
|
"-DMAGNUM_WITH_OPENGLTESTER=ON", |
|
|
|
"-D#{option_prefix}WITH_ANYAUDIOIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYAUDIOIMPORTER=ON", |
|
|
|
"-D#{option_prefix}WITH_ANYIMAGECONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYIMAGECONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_ANYIMAGEIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYIMAGEIMPORTER=ON", |
|
|
|
"-D#{option_prefix}WITH_ANYSCENECONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYSCENECONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_ANYSCENEIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYSCENEIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYSHADERCONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_ANYSHADERCONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_MAGNUMFONT=ON", |
|
|
|
"-DMAGNUM_WITH_MAGNUMFONT=ON", |
|
|
|
"-D#{option_prefix}WITH_MAGNUMFONTCONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_MAGNUMFONTCONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_OBJIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_OBJIMPORTER=ON", |
|
|
|
"-D#{option_prefix}WITH_TGAIMAGECONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_TGAIMAGECONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_TGAIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_TGAIMPORTER=ON", |
|
|
|
"-D#{option_prefix}WITH_WAVAUDIOIMPORTER=ON", |
|
|
|
"-DMAGNUM_WITH_WAVAUDIOIMPORTER=ON", |
|
|
|
"-D#{option_prefix}WITH_DISTANCEFIELDCONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_DISTANCEFIELDCONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_FONTCONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_FONTCONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_IMAGECONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_IMAGECONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_SCENECONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_SCENECONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_SHADERCONVERTER=ON", |
|
|
|
"-DMAGNUM_WITH_SHADERCONVERTER=ON", |
|
|
|
"-D#{option_prefix}WITH_GL_INFO=ON", |
|
|
|
"-DMAGNUM_WITH_GL_INFO=ON", |
|
|
|
"-D#{option_prefix}WITH_AL_INFO=ON", |
|
|
|
"-DMAGNUM_WITH_AL_INFO=ON", |
|
|
|
".." |
|
|
|
".." |
|
|
|
system "cmake", "--build", "." |
|
|
|
system "cmake", "--build", "." |
|
|
|
system "cmake", "--build", ".", "--target", "install" |
|
|
|
system "cmake", "--build", ".", "--target", "install" |
|
|
|
|