|
|
|
@ -1,9 +1,10 @@ |
|
|
|
class MagnumBindings < Formula |
|
|
|
class MagnumBindings < Formula |
|
|
|
desc "`Bindings for the Magnum C++11/C++14 graphics engine" |
|
|
|
desc "`Bindings for the Magnum C++11/C++14 graphics engine" |
|
|
|
homepage "https://magnum.graphics" |
|
|
|
homepage "https://magnum.graphics" |
|
|
|
url "https://github.com/mosra/magnum-bindings/archive/v2020.06.tar.gz" |
|
|
|
# git describe origin/master, except the `v` prefix |
|
|
|
# wget https://github.com/mosra/magnum-bindings/archive/v2020.06.tar.gz -O - | sha256sum |
|
|
|
version "2020.06-421-g439945c" |
|
|
|
sha256 "959c703e6409ba0c2cd6c0da3a2b6190f6fac837ff69f64cbdc372e11359e7d8" |
|
|
|
# Clone instead of getting an archive to have tags for version.h generation |
|
|
|
|
|
|
|
url "https://github.com/mosra/magnum-bindings.git", revision: "439945c" |
|
|
|
head "https://github.com/mosra/magnum-bindings.git" |
|
|
|
head "https://github.com/mosra/magnum-bindings.git" |
|
|
|
|
|
|
|
|
|
|
|
depends_on "cmake" => :build |
|
|
|
depends_on "cmake" => :build |
|
|
|
@ -12,35 +13,17 @@ class MagnumBindings < Formula |
|
|
|
depends_on "magnum" |
|
|
|
depends_on "magnum" |
|
|
|
depends_on "pybind11" => :build |
|
|
|
depends_on "pybind11" => :build |
|
|
|
|
|
|
|
|
|
|
|
# Apply a patch to make 2020.06 working with latest pybind11, which changes |
|
|
|
|
|
|
|
# py::module to py::module_ |
|
|
|
|
|
|
|
stable do |
|
|
|
|
|
|
|
patch do |
|
|
|
|
|
|
|
url "https://github.com/mosra/magnum-bindings/commit/57db13422fe36d1bcfc7bee9b138c79901062dae.diff?full_index=1" |
|
|
|
|
|
|
|
sha256 "c13536e1bac8721f0c766768159e2b91babc4674fcbf46edfc0c43c72c77df3b" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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", |
|
|
|
*(std_cmake_args + extra_cmake_args), |
|
|
|
*std_cmake_args, |
|
|
|
# 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 |
|
|
|
# complain to Homebrew about this insane non-obvious filesystem layout. |
|
|
|
# complain to Homebrew about this insane non-obvious filesystem layout. |
|
|
|
"-DCMAKE_INSTALL_NAME_DIR:STRING=#{lib}", |
|
|
|
"-DCMAKE_INSTALL_NAME_DIR:STRING=#{lib}", |
|
|
|
"-D#{option_prefix}WITH_PYTHON=ON", |
|
|
|
"-DMAGNUM_WITH_PYTHON=ON", |
|
|
|
".." |
|
|
|
".." |
|
|
|
system "cmake", "--build", "." |
|
|
|
system "cmake", "--build", "." |
|
|
|
system "cmake", "--build", ".", "--target", "install" |
|
|
|
system "cmake", "--build", ".", "--target", "install" |
|
|
|
|