diff --git a/doc/python/pages/building.rst b/doc/python/pages/building.rst index 611bb0d..7e81d42 100644 --- a/doc/python/pages/building.rst +++ b/doc/python/pages/building.rst @@ -69,6 +69,33 @@ Once built, install the package using ``pacman``: sudo pacman -U magnum-bindings-*.pkg.tar.xz +`Homebrew formulas for macOS`_ +------------------------------ + +macOS `Homebrew `_ formulas building the latest Git revision +are in the `package/homebrew` directory. Either use the `*.rb` files directly +or use the tap at https://github.com/mosra/homebrew-magnum. Right now, there's +no stable release of Python bindings yet, so you need to install the latest Git +revision of all Magnum projects instead: + +.. code:: sh + + brew install --HEAD mosra/magnum/corrade + brew install --HEAD mosra/magnum/magnum + brew install --HEAD mosra/magnum/magnum-bindings + +When installing from the `*.rb` files you need to install the +:dox:`Corrade ` and +:dox:`Magnum ` Homebrew packages first. If you want to +pass additional flags to CMake or ``setup.py`` or enable / disable additional +features, edit the ``*.rb`` file. + +There are also Homebrew packages for +:dox:`Magnum Plugins ` +:dox:`Magnum Integration `, +:dox:`Magnum Extras ` and +:dox:`Magnum Examples `. + `Manual build`_ =============== diff --git a/package/homebrew/magnum-bindings.rb b/package/homebrew/magnum-bindings.rb new file mode 100644 index 0000000..dd3203a --- /dev/null +++ b/package/homebrew/magnum-bindings.rb @@ -0,0 +1,25 @@ +class MagnumBindings < Formula + desc "`Bindings for the Magnum C++11/C++14 graphics engine" + homepage "https://magnum.graphics" + # url "https://github.com/mosra/magnum-plugins/archive/v2019.01.tar.gz" + # wget https://github.com/mosra/magnum-plugins/archive/v2019.01.tar.gz -O - | sha256sum + # sha256 "d3adadc5b6d4f2e5061608d67f0c7fa07f0dd078bab4672dc5604ddbcd11ca80" + head "git://github.com/mosra/magnum-bindings.git" + + depends_on "cmake" + depends_on "python" + depends_on "magnum" + depends_on "pybind11" => :build + + def install + system "mkdir build" + cd "build" do + system "cmake", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_PREFIX=#{prefix}", "-DWITH_PYTHON=ON", ".." + system "cmake", "--build", "." + system "cmake", "--build", ".", "--target", "install" + cd "src/python" do + system "python3", *Language::Python.setup_install_args(prefix) + end + end + end +end