[mythtv] [mythtv-users] setting up an env

Dan Littlejohn dan.littlejohn at gmail.com
Fri Apr 1 20:45:13 UTC 2016

On Wed, Mar 23, 2016 at 5:38 PM, Roger Siddons <dizygotheca at ntlworld.com>

> On 23/03/16 04:05, Dan Littlejohn wrote:
>> Thanks for the suggestion.  I downloaded QT Creator and have it setup,
>> but if you have a tip or there is a tutorial somewhere on how to create
>> a myth project in it that would be appreciated.  I will likely take a
>> guess at it with the "new project" options or to poke around, but I
>> thought I would just ask.  Not sure if the qmake file comment was a hint.
> I don't know of any tutorials.
> The projects already exist in git - QtCreator will use the same ones as
> the official build script, which makes things easy.
> You'll find that each library and app has a *.pro file alongside its
> sources. The top-level Makefile runs qmake on each one to generate the
> sub-project Makefile, which is then built. QtCreator will do the same when
> you open one of the *.pro files. (Theoretically qmake is run in a different
> environment but I've never had any problems, so I've never investigated.)
> So:
> 1. configure, build and install as usual, in order to build FFmpeg etc and
> install themes etc.
> 2. From QtC open mythfrontend.pro and mythbackend.pro. The first time it
> will 'configure' it. I just use a Debug build with *.o files in the source
> dir (to be compatible with the build script). Use defaults for everything
> else.
> 3. You should then see the sources and be able to build. QtC should
> automatically detect your compiler, debugger and Qt libs ("kits") but the
> settings allow you to fix/adjust them.
> 4. Installing conventionally is problematic because QtC needs sudo
> privileges. You could use ssh-askpass in a deployment step or blat your
> permissions. I skip deployment by symbolically linking the relevant
> apps/libs in /usr/local back to the source tree so that I can just build,
> then run.
> 5. Select each project and run/debug it. It helps to have multiple
> monitors.
> Be wary of project dependencies. Myth project files don't usually specify
> them (the top-level Makefile dictates them). So if you modify libmythui
> code, re-building mythfrontend won't automatically re-link against it. If
> you hunt around the Projects tab, you'll find a Dependencies tab where you
> can set them.
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

Hi Roger:

Thanks for this, it took me a while to sort out a virtual machine dev env
and I still has some to figure out.  I documented it in case it might be
useful for someone else.

I have a couple more questions:

   - I used a prefix so that configure would install the files in
   /usr/local/mythtv.  Per your notes you are building in place and then
   linking back?

ln -s /opt/mythtv/mythtv /usr/local/mythtv

If so does this not cause a problem with commits?  Currently, I can build
projects like the mythbackend, but when I am trying to run I am getting a
weird error about it not being able to attach as a slave and it being
protocol version 77 instead of 88.  There is no other backend running on
the vm.

   - I am not quite understanding the .pro files.  If the mythfrontend uses
   a lib that is causing the problem (like the function GetPlaybackURL in
   libmythmetadata) then you cannot find it in the code if you use the
   mythfrontend.pro file?  How do you sort out problems if this is the
   case, do you have to have all these projects open and just know where stuff
   is?  I found a mythtv.pro file in the top level and it does have
   everything so that is what I was looking through the code with.


MythTV Virtual Machine Dev Env Setup


install vmware workstation player

Mint 17.3 Rosa - x86_64

run vmware and choose "create a new virtual machine".  After boots click on
cdrom to run installer and follow instructions

reboot virtual machine

shut down and in vmware player tool set network adapter for the new vm to

install vmware tools

  sudo apt-get install open-vm-tools

install ssh

  sudo apt-get install openssh-server
  sudo apt-get install openssh-client

set static ip and dns server

  From the menu, System Settings > Network. Click Configure
  ip address should be the same as regular network (since using bridged)

if copying vm need to update hostname

  vi /etc/hostname
  vi /etc/hosts

install git

  sudo apt-get install git

 install dependencies

    sudo apt-get install build-essential
    sudo apt-get install libtool
    sudo apt-get install autoconf

    sudo apt-get install python-dev
    sudo apt-get install python-pip
    sudo apt-get install perl
    sudo apt-get install qt5-default
    sudo apt-get install libqt5webkit5-dev
    sudo apt-get install qtscript5-dev
    sudo apt-get install qtdeclarative5-qtquick2-plugin

    sudo apt-get install yasm
    sudo apt-get install libtag1-dev
    sudo apt-get install libglew-dev
    sudo apt-get install freetype*
    sudo apt-get install libmp3lame-dev
    sudo apt-get install libexiv2-dev
    sudo apt-get install libXinerama-dev

    sudo apt-get install mysql-server
    sudo apt-get install mysql-client
    sudo apt-get install libmysqlclient-dev
    sudo apt-get install libqt5sql5-mysql

configure mysql

    update-rc.d -f mysql defaults
    # comment out this line from /etc/mysql/my.cnf
    #bind-address           =
    mysql -u root -p
    create database mythconverg;
    CREATE USER 'mythtv'@'%' IDENTIFIED BY 'mythtv';
    GRANT ALL PRIVILEGES ON * . * TO 'mythtv'@'%';
    mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

install python modules

    pip install mysql
    pip install urlgrabber

install perl modules

    install DBI
    install DBD::mysql
    install Net::UPnP::QueryResponse
    install Net::UPnP::ControlPoint

re-source profile or open a new xterm

    source ~/.profile

pull mythtv repo

  mkdir /opt/mythtv
  cd /opt/mythtv
  git clone https://github.com/MythTV/mythtv

manually build mythtv

    cd /opt/mythtv/mythtv
    mkdir /usr/local/mythtv
    ./configure --prefix=/usr/local/mythtv
    make test
    make install

install qt creator (http://doc.qt.io/qtcreator/creator-coding.html)

  apt-get install qtcreator

import into qt creator

    open /opt/mythtv/mythtv/programs/mythbackend/mythbackend.pro
    in the project configure screen choose debug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20160401/637b9a1f/attachment.html>

More information about the mythtv-dev mailing list