Skip to content
Unrud edited this page Nov 18, 2020 · 21 revisions

Building miraclecast

1. Install Dependencies:

For Ubuntu 18.04, assuming you're using the cmake build option below

sudo apt install cmake libglib2.0-dev libudev-dev libsystemd-dev libreadline-dev check 

For Ubuntu 20.04, assuming you're using the cmake build option below

sudo apt install cmake libglib2.0-dev libudev-dev libsystemd-dev libreadline-dev check libtool

References:

  1. No package glib-2.0 found - https://unix.stackexchange.com/questions/182156/gentoo-no-package-glib-2-0-found/303618#303618
  2. To fix this error: "cmake Could NOT find Readline (missing: READLINE_INCLUDE_DIR READLINE_LIBRARY)" - https://github.com/turtlecoin/turtlecoin/issues/335#issuecomment-402544461

2. Build. Here are your build system options:

You have a series of options to build miraclecast. Each one is feature complete so as you will:

autotools:

$ mkdir build
$ cd build
$ ../autogen.sh g --prefix=/usr
$ make
$ make install

See g option is for debug compilation Use c for optimized compilation

cmake:

$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr .. 
$ make
$ make install  # May require `sudo`: `sudo make install`

meson:

$ meson build --prefix=/usr --sysconfdir=/etc
$ cd build
$ ninja
$ ninja test
$ ninja install

Tips:

  • Usually you need to install as privilege user. There's many ways to do that, normally sudo will work

    $ sudo make install
    $ sudo ninja install
    
  • In autotools autogen.sh accepts arguments to have specific configuration:

    • c: compilation
    • g: debugging
    • a: pure/const warning
    • l: clang build
    • s: scan-build reporting
  • In cmake remember to remove CMakeCache.txt or cmake . will not regenerate Makefiles

  • Meson build use mesontest --wrap to run test with specific executable. Use that to pass test with valgrind

  • By default all will be installed in /usr/local. if you want to install in standard /usr path add --prefix=/usr to autogen.sh or meson build. For cmake use -DCMAKE_INSTALL_PREFIX=/usr

  • Install step may require root privileges. This is commonly solved using sudo

  • dbus policy is needed to expose dbus interfaces. This is read on '/etc' normally but you can modify it with: --sysconfdir on autotools and meson or -DSYSCONFDIR on cmake

Clone this wiki locally