Building Myth for Mac with MacPorts

From MythTV Official Wiki
Jump to: navigation, search

This page provides a cookbook for building MythTV for Mac OS X via MacPorts. It is assumed that you have at least a little experience using Terminal on the Mac to run command-line driven programs. See the page Myth for Mac with MacPorts for more information. OS X 10.9 (Mavericks) now supported.


Install XCode and MacPorts

In order to install any version of Myth via MacPorts, you first need to obtain the appropriate version of XCode for your version of OS X. Then install the latest version of MacPorts. The MacPorts web site has a good summary:

see http://www.macports.org/install.php


Myth 0.27

Myth 0.27 is the current release of MythTV and is recommended for all users.

Upgrading from a previous version of Myth?

  • Shutdown Myth with Myth_Stop_Start
  • Backup your database:
Using Terminal, enter the following What happens
/opt/local/share/mythtv/mythconverg_backup.pl \
--mysqldump /opt/local/lib/mysql5/bin/mysqldump \
--directory ~/Desktop --verbose
Saves the current state of your Myth software (settings, rules, guide data, etc) into a compressed backup file. If the upgrade fails, you can restore this file and restart your previous version of Myth.
  • Deactivate the MythTV software

See the instructions in the relevant section below, Uninstall Myth 0.26 or Uninstall Myth 0.25, to deactivate your version of Myth.

Build and Install Myth 0.27

With XCode and MacPorts installed, use Terminal to run the following commands:

At the Terminal prompt, you enter What happens
sudo port install mythtv-core.27
Download, build and install the MythTV. This includes the frontend, backend, perl and python bindings but not Myth's plug-ins. All relevant dependencies, including the MySQL client software, will also be installed and, therefore, the first time through, it may take 1 hour or more. Depending on the speed of your Mac, future updates can take as little as 15 minutes.
sudo port install mysql5-server
OPTIONAL. Download, build and install the MySQL database server software* (version 5.1). Myth needs a database server running--this command allows you to run the server on this machine.
sudo port install logrotate +startupitem
OPTIONAL. Download, build and install logrotate. Myth generates a lot of log files, even when just the frontend is used. Logrotate prunes out older ones on a daily basis.
  • MacPorts offers several versions/forks of MySQL. Please select "mysql5" for maximum compatibility at the present time. We hope to allow MySQL 5.5 or even MariaDB or Percona at some point in the future.


Congratulations, you just built Myth for Mac. Virtually all of the installed software and support files are under '/opt/local/' at the root of your hard drive. Feel free to use the Finder to explore.

Upgrading Myth 0.27

The mythtv-core.26 port is based on Myth's 0.27-Fixes branch and is updated periodically as important commits are applied. MacPorts also regularly updates other ports which Myth may rely on. To check for and apply upgrades:

At the Terminal prompt, you enter What happens
sudo port selfupdate
MacPorts downloads an updated list of available ports and, if necessary, updates the MacPorts software itself.
port outdated
MacPorts compares, for each installed port, your installed version versus the currently available version. It lists any ports that are not at the latest version.
sudo port upgrade mythtv-core.26
Upgrade to the latest version of MythTV available through MacPorts. This upgrades the MythTV software and any of the dependencies that were installed to support it.
sudo port upgrade outdated
This upgrades any and all ports that are not at the current version supplied by MacPorts. Obviously, this may take a long time if there are a large number of outdated ports or if something like Qt is affected.

Uninstall Myth 0.27

MacPorts keeps track of every file it installed and makes it easy to uninstall software, if needed. Use Terminal to run one of the following commands.

Before uninstalling Myth, make sure mythbackend is not running. Check Activity Monitor, the 'top' utility or similar. See Myth for Mac with MacPorts for information on stopping the backend.

Enter one of the following What happens
sudo port uninstall --follow-dependencies mythtv-core.27
This option completely removes the MythTV software and all the other dependencies that were installed to support it (such as Qt, MySQL, etc). If, later, you want to reinstall Myth, it may take multiple hours to build everything again.
sudo port uninstall mythtv-core.27
This option completely removes the MythTV software from your machine but leaves all the dependencies installed. Reinstalling Myth faster than the above option and slower than the following.
sudo port deactivate mythtv-core.27
This option saves the current version of MythTV in an archive but otherwise removes the software from your machine. Again, it leaves all dependencies installed. The advantage is that Myth can be re-installed in a minute or two with the "activate" command.


Myth 0.26

Myth 0.26 is the previous release of MythTV and is supported but users are strongly encouraged to upgrade to 0.27.

Upgrading from Myth 0.25?

  • Shutdown Myth 0.25 with Myth_Stop_Start
  • Backup your database:
Using Terminal, enter the following What happens
/opt/local/share/mythtv/mythconverg_backup.pl \
--mysqldump /opt/local/lib/mysql5/bin/mysqldump \
--directory ~/Desktop --verbose
Saves the current state of your Myth software (settings, rules, guide data, etc) into a compressed backup file. If the upgrade fails, you can restore this file and restart Myth 0.25.
  • Deactivate the previous MythTV software

See the instructions in the relevant section below, Uninstall Myth 0.25, to deactivate your version of Myth.

Build and Install Myth 0.26

With XCode and MacPorts installed, use Terminal to run the following commands:

At the Terminal prompt, you enter What happens
sudo port install mythtv-core.26
Download, build and install the MythTV. This includes the frontend, backend, perl and python bindings but not Myth's plug-ins. All relevant dependencies, including the MySQL client software, will also be installed and, therefore, the first time through, it may take 1 hour or more. Depending on the speed of your Mac, future updates can take as little as 15 minutes.
sudo port install mysql5-server
OPTIONAL. Download, build and install the MySQL database server software* (version 5.1). Myth needs a database server running--this command allows you to run the server on this machine.
sudo port install logrotate +startupitem
OPTIONAL. Download, build and install logrotate. Myth generates a lot of log files, even when just the frontend is used. Logrotate prunes out older ones on a daily basis.
  • MacPorts offers several versions/forks of MySQL. Please select "mysql5" for maximum compatibility at the present time. We hope to allow MySQL 5.5 or even MariaDB or Percona at some point in the future.


Congratulations, you just built Myth for Mac. Virtually all of the installed software and support files are under '/opt/local/' at the root of your hard drive. Feel free to use the Finder to explore.

Upgrading Myth 0.26

The mythtv-core.26 port is based on Myth's 0.26-Fixes branch and is updated periodically as important commits are applied. MacPorts also regularly updates other ports which Myth may rely on. To check for and apply upgrades:

At the Terminal prompt, you enter What happens
sudo port selfupdate
MacPorts downloads an updated list of available ports and, if necessary, updates the MacPorts software itself.
port outdated
MacPorts compares, for each installed port, your installed version versus the currently available version. It lists any ports that are not at the latest version.
sudo port upgrade mythtv-core.26
Upgrade to the latest version of MythTV available through MacPorts. This upgrades the MythTV software and any of the dependencies that were installed to support it.
sudo port upgrade outdated
This upgrades any and all ports that are not at the current version supplied by MacPorts. Obviously, this may take a long time if there are a large number of outdated ports or if something like Qt is affected.

Uninstall Myth 0.26

MacPorts keeps track of every file it installed and makes it easy to uninstall software, if needed. Use Terminal to run one of the following commands.

Before uninstalling Myth, make sure mythbackend is not running. Check Activity Monitor, the 'top' utility or similar. See Myth for Mac with MacPorts for information on stopping the backend.

Enter one of the following What happens
sudo port uninstall --follow-dependencies mythtv-core.26
This option completely removes the MythTV software and all the other dependencies that were installed to support it (such as Qt, MySQL, etc). If, later, you want to reinstall Myth, it may take multiple hours to build everything again.
sudo port uninstall mythtv-core.26
This option completely removes the MythTV software from your machine but leaves all the dependencies installed. Reinstalling Myth faster than the above option and slower than the following.
sudo port deactivate mythtv-core.26
This option saves the current version of MythTV in an archive but otherwise removes the software from your machine. Again, it leaves all dependencies installed. The advantage is that Myth can be re-installed in a minute or two with the "activate" command.


Myth 0.25

Myth 0.25 End of Life

Myth 0.25 is no longer supported by the MythTV project and users are encouraged to upgrade to 0.27. MacPorts will retain the mythtv-core.25 port until Myth 0.28 is released or until it becomes too difficult to maintain.

Upgrading Myth 0.25

The mythtv-core.25 port has been updated to the most recent 0.25-Fixes. If you are not willing to upgrade to 0.26 or 0.27, you should ensure that you are running the most recent revision of 0.25:

At the Terminal prompt, you enter What happens
sudo port selfupdate
MacPorts downloads an updated list of available ports and, if necessary, updates the MacPorts software itself.
port outdated
MacPorts compares, for each installed port, your installed version versus the currently available version. It lists any ports that are not at the latest version.
sudo port upgrade mythtv-core.25
Upgrade to the latest version of MythTV available through MacPorts. This upgrades the MythTV software and any of the dependencies that were installed to support it.
sudo port upgrade outdated
This upgrades any and all ports that are not at the current version supplied by MacPorts. Obviously, this may take a long time if there are a large number of outdated ports or if something like Qt is affected.

Uninstall Myth 0.25

MacPorts keeps track of every file it installed and makes it easy to uninstall software, if needed. Use Terminal to run one of the following commands.

Before uninstalling Myth, make sure mythbackend is not running. Check Activity Monitor, the 'top' utility or similar. See Myth for Mac with MacPorts for information on stopping the backend.

Enter one of the following What happens
sudo port uninstall --follow-dependencies mythtv-core.25
This option completely removes the MythTV software and all the other dependencies that were installed to support it (such as Qt, MySQL, etc). If, later, you want to reinstall Myth, it may take multiple hours to build everything again.
sudo port uninstall mythtv-core.25
This option completely removes the MythTV software from your machine but leaves all the dependencies installed. Reinstalling Myth faster than the above option and slower than the following.
sudo port deactivate mythtv-core.25
This option saves the current version of MythTV in an archive but otherwise removes the software from your machine. Again, it leaves all dependencies installed. The advantage is that Myth can be re-installed in a minute or two with the "activate" command.


Problems?

If you have any problems building MythTV via MacPorts, please post to the macports-users mailing list. If necessary, please file a bug with the MacPorts bug tracker.

MacPorts-users mailing list == https://lists.macosforge.org/mailman/listinfo/macports-users

MacPorts ticket system == http://guide.macports.org/#project.tickets