Building MiKTeX (macOS)

The MiKTeX source code allows you to build a Drag'n'Drop installer for macOS:

Image Text

This HOWTO describes the build procedure.

Prerequisites

  • Homebrew

    Homebrew is a package manager for macOS which you can use to install development libraries and build tools which are required for building MiKTeX on macOS. Please visit https://brew.sh for installation instructions.

  • Xcode

    Building MiKTeX requires a modern C/C++ compiler. The minimum required standard versions are C99 and C++14 which will be satisfied by installing the latest Xcode version.

  • CMake

    The MiKTeX build is driven by CMake, a tool which will create Makefiles suited for the local system. The minimum required CMake version is 3.7.0. Install it with Homebrew:

    brew install cmake
    
  • Various build utilities

    In addition to the compiler and the CMake build system, you will need these utilities:

    • pkg-config

    Install these utilities with Homebrew:

    brew install pkg-config
    
  • Libraries

    You will need development packages for a couple of development packages. Again, use Homebrew to install them:

    brew install icu4c
    brew install freetype
    brew install fribidi
    brew install gmp
    brew install graphite2
    brew install hunspell
    brew install jpeg
    brew install libpng
    brew install libtiff
    brew install libzzip
    brew install log4cxx
    brew install mpfr
    brew install openssl
    brew install pixman
    brew install popt
    brew install potrace
    brew install qt
    brew install uriparser
    brew install xz
    

Running CMake

In order to make some special libraries accessible to CMake, it is necessary to set the environment variable CMAKE_PREFIX_PATH:

brewprefix="`brew --prefix`"
export CMAKE_PREFIX_PATH="${brewprefix}/opt/icu4c:${brewprefix}/opt/openssl:${brewprefix}/opt/icu4c:${brewprefix}/opt/qt:${CMAKE_PREFIX_PATH}"

It is recommended that you build outside the source code directory:

cmake ../source

Here you have to specify the path to the MiKTeX source code directory (../source in the example above).

Building MiKTeX

Run the Make utility to build MiKTeX, for example:

make

Create installer

Run

make package

to build the Drag'n'Drop installer. This will create a .dmg file which you can use to install MiKTeX.