Building Mythtv 31/32 with Ansible

For discussion of topics specific to MythTV on OSX
jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Building Mythtv 31/32 with Ansible

Post by jhoyt » Thu May 14, 2020 12:18 am

Update: 8/1 - The compile script is now in mythtv packaging - update link to download to point to the packaging version.
Update: 7/5-4 - Python bindings and metadata retrieval now work
Update: 7/5-3 - Now works with master / v32
Update: 7/5-2 - Remove dependency on makebundle.sh
Update: 7/5 - Added link to new mythtv wiki entry
Update: 7/4 - Lots of formatting fixes due to plugins now requiring more libraries and automation of finding the correct libraries
Update: 6/30 - Updated script to zsh - will now run as an executable, automated many of the steps including patching.
Update: 5/18 - Fixed ansible playbook call
Update: 5/17 - Added the ability to install mythplugins
Update: 5/16 - Added "Open in Low Resolution" fix for retina screen and mythplugins
Update: 5/15 - Added High Sierra updates and removed the AppKit copy

I just verified that the following build process works with the new updates in mythtv's ansible git repo.

I have managed to get this to compile on a case sensitive file system with:
MythTV version: v31
MacOS: 10.15.4
Xcode: 11.3.1

v31 and master (v32)and a non-case sensitive filesystem:
MacOS: 10.15.4
Xcode: 11.3.1, and 11.4.1

MythTV version: v31 and v32
MacOS: 10.15.5
Xcode: 11.5

MacOS 10.13.4
Xcode 10.0

A BIG thank you to Bill and Craig for getting me over the ansible, macports, and compile humps respectively.

Latest compiled versions (via High Sierra posted here): https://sourceforge.net/projects/mythtvformacosx/

Update build instructions will now live on the mythtv wiki here: https://www.mythtv.org/wiki/Building_My ... n_Mac_OS_X

You can download the compile script from my github repo here: https://github.com/MythTV/packaging/tre ... ts_ansible

Code: Select all

#!/bin/zsh

### Note - macports must be installed on your system for this script to work!!!!!
if ! [ -x "$(command -v port)" ]; then
  echo 'Error: Macports is not installed.' >&2
  exit 1
fi

show_help(){
    cat <<EOF
Usage: compileMythtvAnsible.sh [options]
Options: [defaults in brackets after descriptions]

Standard options:
  --help                                 Print this message
  --build-plugins=BUILD_PLUGINS          Build Mythtvplugins (false)
  --python-version=PYTHON_VERS           Desired Python 3 Version (38)
  --version=MYTHTV_VERS                  Requested mythtv git repo (fixes/31)
Build Options
  --update-git=UPDATE_GIT                Update git repositories to latest (true)
Patch Options
  --apply-patches=APPLY_PATCHES          Apply patches specified in additional arguments (false)
  --mythtv-patch-dir=MYTHTV_PATCH_DIR    Directory containing patch files to be applied to Mythtv
  --packaging-patch-dir=PACK_PATCH_DIR   Directory containing patch files to be applied to Packaging
  --plugins-patch-dir=PLUGINS_PATCH_DR   Directory containing patch files to be applied to Mythplugins
Support Ports Options
  --skip-ansible=SKIP_ANSIBLE            Skip downloading ports with ansible (false)
                                         NOTE: Only do this if you are sure you have installed ALL dependencies
  --update-ports=UPDATE_PORTS            Update macports (false)
EOF

  exit 0
}

# setup default variables
BUILD_PLUGINS=false
PYTHON_VERS="38"
UPDATE_PORTS=false
MYTHTV_VERS="fixes/31"
UPDATE_GIT=true
SKIP_ANSIBLE=false
APPLY_PATCHES=false
MYTHTV_PATCH_DIR=""
PACK_PATCH_DIR=""
PLUGINS_PATCH_DIR=""

# parse user inputs into variables
for i in "$@"
do
  case $i in
      -h|--help)
        show_help
        exit 0
      ;;
      --build-plugins=*)
        BUILD_PLUGINS="${i#*=}"
      ;;
      --python-version=*)
        PYTHON_VERS="${i#*=}"
      ;;
      --update-ports=*)
        UPDATE_PORTS="${i#*=}"
      ;;
      --skip-ansible=*)
        SKIP_ANSIBLE="${i#*=}"
      ;;
      --version=*)
        MYTHTV_VERS="${i#*=}"
      ;;
      --update-git*)
        UPDATE_GIT="${i#*=}"
      ;;
      --apply-patches=*)
        APPLY_PATCHES="${i#*=}"
      ;;
      --mythtv-patch-dir=*)
        MYTHTV_PATCH_DIR="${i#*=}"
      ;;
      --packaging-patch-dir=*)
        PACK_PATCH_DIR="${i#*=}"
      ;;
      --plugins-patch-dir=*)
        PLUGINS_PATCH_DIR="${i#*=}"

      ;;
      *)
        echo "Unknown option $i"
              # unknown option
        exit 1
      ;;
  esac
done

# Specify mythtv version to pull from git
# if we're building on master - get release number from the git tags
# otherwise extract it from the MYTHTV_VERS
case $MYTHTV_VERS in
    master*)
       VERS=$(git ls-remote --tags  git://github.com/MythTV/mythtv.git|tail -n 1)
       VERS=${VERS##*/v}
       VERS=$(echo $VERS|tr -dc '0-9')
    ;;
    *)
      VERS=${MYTHTV_VERS: -2}
    ;;
esac
REPO_DIR=~/mythtv-$VERS
INSTALL_DIR=$REPO_DIR/$VERS-osx-64bit
PYTHON_DOT_VERS="${PYTHON_VERS:0:1}.${PYTHON_VERS:1:4}"
ANSIBLE_PLAYBOOK="ansible-playbook-$PYTHON_DOT_VERS"

# setup some paths to make the following commands easier to understand
SRC_DIR=$REPO_DIR/mythtv/mythtv
APP_DIR=$SRC_DIR/programs/mythfrontend
PLUGINS_DIR=$REPO_DIR/mythtv/mythplugins
THEME_DIR=$REPO_DIR/mythtv/myththemes
PKGING_DIR=$REPO_DIR/mythtv/packaging/
OSX_PKGING_DIR=$PKGING_DIR/OSX/build/
PKG_CONFIG_SYSTEM_INCLUDE_PATH=/opt/local/include
export PATH=/opt/local/lib/mysql57/bin:$PATH
OS_VERS=$(/usr/bin/sw_vers -productVersion)

echo "------------ Setting Up Directory Structure ------------"
# setup the working directory structure
mkdir -p $REPO_DIR
cd $REPO_DIR
# create the install temporary directory
mkdir -p $INSTALL_DIR

# install and configure ansible and gsed
# ansible to install the missing required ports,
# gsed for the plist update later
echo "------------ Setting Up Initial Ports for Ansible ------------"
if $UPDATE_PORTS; then
  # tell macport to retrieve the latest repo
  sudo port selfupdate
  % upgrade all outdated ports
  sudo port upgrade
fi
# check if ansible_playbook is installed, if not install it
if ! [ -x "$(command -v $ANSIBLE_PLAYBOOK)" ]; then
  echo Installing python and ansilble
  sudo port -N install py$PYTHON_VERS-ansible
  sudo port select --set python python$PYTHON_VERS
  sudo port select --set python3 python$PYTHON_VERS
  sudo port select --set ansible py$PYTHON_VERS-ansible
else
  echo "skipping ansible install - it is already installed"
fi

# check is gsed is installed (for patching the .plist file)
if ! [ -x "$(command -v gsed)" ]; then
  sudo port -N install gsed
else
    echo "skipping gsed install - it is already installed"
fi

echo "------------ Running Ansible ------------"
if $SKIP_ANSIBLE; then
  echo "Skipping port installation via ansible"
else
  # get mythtv's ansible playbooks, and install required ports
  # if the repo exists, update (assume the flag is set)
  if [ -d "$REPO_DIR/ansible" ]; then
    echo "updating mythtv-anisble git repo"
    cd $REPO_DIR/ansible
    if $UPDATE_GIT; then
      echo "Updating ansible git repo"
      git pull
    else
      echo "Skipping ansible git repo update"
    fi
  # pull down a fresh repo if none exist
  else
    echo "cloning mythtv-anisble git repo"
    git clone https://github.com/MythTV/ansible.git
  fi
  cd $REPO_DIR/ansible
  export ANSIBLE_DISPLAY_SKIPPED_HOSTS=false
  $ANSIBLE_PLAYBOOK qt5.yml --ask-become-pass
fi
# get the version of python installed by MacPorts
PYTHON_BIN=$(which python$PYTHON_DOT_VERS)
# also get the location of the framework - /opt/local because this is where MacPorts stores its packages
PYTHON_INSTALL_LOC=/opt/local/Library/Frameworks/Python.framework/Versions/$PYTHON_DOT_VERS/lib/python$PYTHON_DOT_VERS/site-packages


echo "------------ Cloning / Updating Mythtv Git Repository ------------"
# setup mythtv source from git
cd $REPO_DIR
# if the repo exists, update it (assuming the flag is set)
if [ -d "$REPO_DIR/mythtv" ]; then
  cd $REPO_DIR/mythtv
  if $UPDATE_GIT; then
    echo "Updateing mythtv/mythplugins git repo"
    git pull
  else
      echo "Skipping mythtv/mythplugins git repo update"
  fi
# else pull down a fresh copy of the repo from github
else
  echo "cloning mythtv git repo"
  git clone -b $MYTHTV_VERS git://github.com/MythTV/mythtv.git
fi
# apply specified patches
if [ $APPLY_PATCHES ] && [ ! -z $MYTHTV_PATCH_DIR ]; then
  cd $REPO_DIR/mythtv
  for file in $MYTHTV_PATCH_DIR/*
    do
    if [ -f "$file" ]; then
      echo "Applying Mythtv patch: $file"
      patch -p1 < $file
    fi
  done
fi
echo "------------ Cloning / Updating Packaging Git Repository ------------"
# get packaging
cd $REPO_DIR/mythtv
# check if the repo exists and update (if the flag is set)
if [ -d $PKGING_DIR ]; then
  cd $PKGING_DIR
  if $UPDATE_GIT; then
    echo "Update packaging git repo"
    git pull
  else
    echo "Skipping packaging git repo update"
  fi
# else pull down a fresh copy of the repo from github
else
  echo "cloning mythtv-packaging git repo"
  git clone -b $MYTHTV_VERS https://github.com/MythTV/packaging.git
fi

# apply any user specified patches if the flag is set
if [ $APPLY_PATCHES ] && [ ! -z $PACK_PATCH_DIR ]; then
  cd $PKGING_DIR
  for file in $PACK_PATCH_DIR/*
    do
    if [ -f "$file" ]; then
      echo "Applying Packaging patch: $file"
      patch -p1 < $file
    fi
  done
fi

echo "------------ Configuring Mythtv ------------"
# configure mythfrontend
cd $SRC_DIR
GIT_VERS=$(git rev-parse --short HEAD)
./configure --prefix=$INSTALL_DIR \
			--runprefix=../Resources \
			--enable-mac-bundle \
			--qmake=/opt/local/libexec/qt5/bin/qmake \
			--cc=clang \
			--cxx=clang++ \
			--extra-cxxflags='-I $SRC_DIR/external -I /opt/local/include' \
			--extra-ldflags='-L $SRC_DIR/external -L /opt/local/lib' \
			--disable-backend \
			--disable-distcc \
			--disable-firewire \
			--enable-libmp3lame \
			--enable-libxvid \
			--enable-libx264 \
			--enable-libx265 \
			--enable-libvpx \
			--enable-bdjava \
	 		--python=$PYTHON_BIN

echo "------------ Compiling Mythtv ------------"
#compile mythfrontend
make
# error out if make failed
if [ $? != 0 ]; then
  echo "Compiling Mythtv failed" >&2
  exit 1
fi
echo "------------ Installing Mythtv ------------"
# need to do a make install or macdeployqt will not copy everything in.
make install

if $BUILD_PLUGINS; then
  echo "------------ Configuring Mythplugins ------------"
  # apply specified patches if flag is set
  if [ $APPLY_PATCHES ] && [ ! -z $PLUGINS_PATCH_DIR ]; then
    cd $PLUGINS_DIR
    for file in $PLUGINS_PATCH_DIR/*
      do
      if [ -f "$file" ]; then
        echo "Applying Plugins patch: $file"
        patch -p1 < $file
      fi
    done
  fi

  # configure plugins
  cd $PLUGINS_DIR
  ./configure --prefix=$INSTALL_DIR \
  			--runprefix=../Resources \
  			--qmake=/opt/local/libexec/qt5/bin/qmake \
  			--cc=clang \
  			--cxx=clang++ \
  			--enable-mythgame \
  			--enable-mythmusic \
   			--enable-fftw \
  			--enable-cdio \
  			--enable-mythnews \
  			--enable-mythweather \
  			--disable-mytharchive \
  			--disable-mythnetvision \
  			--disable-mythzoneminder \
  			--disable-mythzmserver \
  	 		--python=PYTHON_BIN

  echo "------------ Compiling Mythplugins ------------"
  #compile mythfrontend
  /opt/local/libexec/qt5/bin/qmake  mythplugins.pro
  make
  # error out if make failed
  if [ $? != 0 ]; then
    echo "Plugins compile failed" >&2
    exit 1
  fi
  echo "------------ Installing Mythplugins ------------"
  make install
else
  echo "------------ Skipping Mythplugins Compile ------------"
fi

echo "------------ Deploying QT to Mythfrontend Executable ------------"
# Package up the executable
cd $APP_DIR
# run macdeployqt
/opt/local/libexec/qt5/bin/macdeployqt $APP_DIR/mythfrontend.app

echo "------------ Update Mythfrontend.app to use internal dylibs ------------"
# run osx-bundler.pl to copy all of the libraries into the bundle as Frameworks
# we will need to run this utility multiple more time for any plugins and helper apps installed
$OSX_PKGING_DIR/osx-bundler.pl  $APP_DIR/mythfrontend.app/Contents/MacOS/mythfrontend $SRC_DIR/libs/* $INSTALL_DIR/lib/ /opt/local/lib

echo "------------ Installing libcec into Mythfrontend.app ------------"
# copy in libcec (missing for some reason...)
cp /opt/local/lib/libcec.4.*.dylib $APP_DIR/mythfrontend.app/Contents/Frameworks/
install_name_tool -add_rpath "@executable_path/../Frameworks/libcec.4.0.5.dylib" $APP_DIR/mythfrontend.app/Contents/MacOS/mythfrontend
cp /opt/local/lib/libcec.4.dylib $APP_DIR/mythfrontend.app/Contents/Frameworks/
install_name_tool -add_rpath "@executable_path/../Frameworks/libcec.4.dylib" $APP_DIR/mythfrontend.app/Contents/MacOS/mythfrontend
cp /opt/local/lib/libcec.dylib $APP_DIR/mythfrontend.app/Contents/Frameworks/
install_name_tool -add_rpath "@executable_path/../Resources/libcec.dylib" $APP_DIR/mythfrontend.app/Contents/MacOS/mythfrontend

echo "------------ Installing additional mythtv utility executables into Mythfrontend.app  ------------"
# loop over the compiler apps copying in the desired ones for mythfrontend
for helperBinPath in $INSTALL_DIR/bin/*.app
do
  case $helperBinPath in
    *mythmetadatalookup*|*mythreplex*|*mythutil*|*mythpreviewgen*|*mythavtest*)
      # extract the filename from the path
      helperBinFile=$(basename $helperBinPath)
      helperBinFile=${helperBinFile%.app}
      echo "installing $helperBinFile into app"
      # copy into the app
      cp -r $helperBinPath/Contents/MacOS/$helperBinFile $APP_DIR/mythfrontend.app/Contents/MacOS
      # run osx-bundler.pl to setup and copy support libraries into app framework
      $OSX_PKGING_DIR/osx-bundler.pl  $APP_DIR/mythfrontend.app/Contents/MacOS/$helperBinFile
    ;;
    *)
      continue
    ;;
  esac
done

if $BUILD_PLUGINS; then
  echo "------------ Copying Mythplugins dylibs into app ------------"
      #*libmythpostproc*|*libmythavdevice*|*libmythavfilter*|*libmythpostproc*|*libmythprotoserver*|*libmythswscale*)
  #done

  # Now we need to make the plugin dylibs use the dylibs copied into the app's Framework
  # to do this, we're going to copy them into the app's PlugIns dir and the use osx-bundler.pl to point them to the
  # app frameworks' versions
  for plugFilePath in $INSTALL_DIR/lib/mythtv/plugins/*.dylib
  do
      plugFileName=$(basename $plugFilePath)
      echo "installing $plugFileName into app"
      cp $plugFilePath $APP_DIR/mythfrontend.app/Contents/PlugIns/
      # run osx-bundler.pl to setup and copy support libraries into app framework
      $OSX_PKGING_DIR/osx-bundler.pl  $APP_DIR/mythfrontend.app/Contents/PlugIns/$plugFileName $INSTALL_DIR/libs
  done
fi

echo "------------ Copying mythtv share directory into executable  ------------"
# copy in i18n, fonts, themes, plugin resources, etc from the install directory (share)
mkdir -p $APP_DIR/mythfrontend.app/Contents/Resources/share/mythtv
cp -r $INSTALL_DIR/share/mythtv/* $APP_DIR/mythfrontend.app/Contents/Resources/share/mythtv/

echo "------------ Copying mythtv lib/python* and lib/perl directory into application  ------------"
mkdir -p $APP_DIR/mythfrontend.app/Contents/Resources/lib
cp -r $INSTALL_DIR/lib/python* $APP_DIR/mythfrontend.app/Contents/Resources/lib/
cp -r $INSTALL_DIR/lib/perl* $APP_DIR/mythfrontend.app/Contents/Resources/lib/
if [ ! -f $APP_DIR/mythfrontend.app/Contents/Resources/lib/python ]; then
   cd $APP_DIR/mythfrontend.app/Contents/Resources/lib
   ln -s python$PYTHON_DOT_VERS python
   cd $APP_DIR
fi
echo "------------ Copying additional python modules into application  ------------"
PYTHON_APP_LOC="$APP_DIR/mythfrontend.app/Contents/Resources/lib/python$PYTHON_DOT_VERS/site-packages/"
# These libraries were all "dependencies" in MacPorts for the ansible required python-libs
cp -r $PYTHON_INSTALL_LOC/future* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/requests* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/lxml* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/oauthlib* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/curl* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/simplejson* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/wheel* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/PyMySQL* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/pymysql* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/chardet* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/idna* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/urllib3* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/certifi* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/blinker* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/cryptography* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/jwt* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/asn1crypto* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/six* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/cffi* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/pycparser* $PYTHON_APP_LOC
cp -r $PYTHON_INSTALL_LOC/pycurl* $PYTHON_APP_LOC

echo "------------ Copying in dejavu and liberation fonts into Mythfrontend.app   ------------"
# copy in missing fonts
cp /opt/local/share/fonts/dejavu-fonts/*.ttf $APP_DIR/mythfrontend.app/Contents/Resources/share/mythtv/fonts/
cp /opt/local/share/fonts/liberation-fonts/*.ttf $APP_DIR/mythfrontend.app/Contents/Resources/share/mythtv/fonts/

echo "------------ Copying in Mythfrontend.app icon  ------------"
# copy in the icon
cp mythfrontend.icns $APP_DIR/mythfrontend.app/Contents/Resources/application.icns

echo "------------ Add symbolic link structure for copied in files  ------------"
# make some symbolic links to match past working copies
cd $APP_DIR/mythfrontend.app/Contents/MacOS
if $BUILD_PLUGINS; then
  ln -s ../PlugIns/sqldrivers .
fi
cd $APP_DIR/mythfrontend.app/Contents/Resources
ln -s ../MacOS bin
if $BUILD_PLUGINS; then
  mkdir -p $APP_DIR/mythfrontend.app/Contents/Resources/lib/mythtv
  cd $APP_DIR/mythfrontend.app/Contents/Resources/lib/mythtv
  ln -s ../../../PlugIns plugins
fi

echo "------------ Updating application plist  ------------"
# Update the plist
gsed -i "8c\	<string>application.icns</string>" $APP_DIR/mythfrontend.app/Contents/Info.plist
gsed -i "10c\	<string>org.osx-bundler.mythfrontend</string>\n	<key>CFBundleInfoDictionaryVersion</key>\n	<string>6.0</string>" $APP_DIR/mythfrontend.app/Contents/Info.plist
gsed -i "14a\	<key>CFBundleShortVersionString</key>\n	<string>$VERS</string>" $APP_DIR/mythfrontend.app/Contents/Info.plist
gsed -i "18c\	<string>osx-bundler</string>\n	<key>NSAppleScriptEnabled</key>\n	<string>NO</string>\n	<key>CFBundleGetInfoString</key>\n	<string></string>\n	<key>CFBundleVersion</key>\n	<string>1.0</string>\n	<key>NSHumanReadableCopyright</key>\n	<string>MythTV Team</string>" $APP_DIR/mythfrontend.app/Contents/Info.plist

echo "------------ Generating .dmg file  ------------"
# Package up the build
cd $APP_DIR
if $BUILD_PLUGINS; then
    VOL_NAME=MythFrontend-$VERS-intel-$OS_VERS-v$VERS-$GIT_VERS-with-plugins
else
    VOL_NAME=MythFrontend-$VERS-intel-$OS_VERS-v$VERS-$GIT_VERS
fi
if [ -f $APP_DIR/$VOL_NAME.dmg ] ; then
    mv $APP_DIR/$VOL_NAME.dmg $APP_DIR/$VOL_NAME$(date +'%d%m%Y%H%M%S').dmg
fi
hdiutil create $APP_DIR/$VOL_NAME.dmg -fs HFS+ -srcfolder $APP_DIR/Mythfrontend.app -volname $VOL_NAME
Also once you're complete and tested the app, please be so kind as to upload to Sourceforge:

Code: Select all

rsync -avP -e ssh $APP_DIR/$VOL_NAME.dmg YOUR_USER_NAME_HERE,mythtvformacosx@frs.sourceforge.net:/home/frs/project/m/my/mythtvformacosx/
Last edited by jhoyt on Sat Aug 01, 2020 2:23 pm, edited 26 times in total.

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Thu May 14, 2020 12:58 am

Re filters, are they not under .../lib/mythtv/filters ? Eg:

Code: Select all

$ ls -l /opt/local/lib/mythtv/filters
total 1632
-rwxr-xr-x  1 root  admin  49636 10 Jul  2017 libadjust.dylib
-rwxr-xr-x  1 root  admin  41580 10 Jul  2017 libbobdeint.dylib
-rwxr-xr-x  1 root  admin  49636 10 Jul  2017 libcrop.dylib
-rwxr-xr-x  1 root  admin  50000 10 Jul  2017 libdenoise3d.dylib
-rwxr-xr-x  1 root  admin  49628 10 Jul  2017 libfieldorder.dylib
-rwxr-xr-x  1 root  admin  41192 10 Jul  2017 libforce.dylib
-rwxr-xr-x  1 root  admin  58276 10 Jul  2017 libgreedyhdeint.dylib
-rwxr-xr-x  1 root  admin  41332 10 Jul  2017 libinvert.dylib
-rwxr-xr-x  1 root  admin  58748 10 Jul  2017 libivtc.dylib
-rwxr-xr-x  1 root  admin  58496 10 Jul  2017 libkerneldeint.dylib
-rwxr-xr-x  1 root  admin  45604 10 Jul  2017 liblinearblend.dylib
-rwxr-xr-x  1 root  admin  41444 10 Jul  2017 libonefield.dylib
-rwxr-xr-x  1 root  admin  45912 10 Jul  2017 libpostprocess.dylib
-rwxr-xr-x  1 root  admin  49872 10 Jul  2017 libquickdnr.dylib
-rwxr-xr-x  1 root  admin  45696 10 Jul  2017 libvflip.dylib
-rwxr-xr-x  1 root  admin  54616 10 Jul  2017 libyadif.dylib
Craig
The MacPorts guy.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Thu May 14, 2020 11:26 am

not anymore:

Code: Select all

% ls ~/mythtv-31/31-osx-64bit/lib
libmyth-31.31.0.0.dylib                 libmythbase-31.31.dylib                 libmythswresample.3.5.100.dylib
libmyth-31.31.0.dylib                   libmythbase-31.dylib                    libmythswresample.3.dylib
libmyth-31.31.dylib                     libmythfreemheg-31.31.0.0.dylib         libmythswresample.dylib
libmyth-31.dylib                        libmythfreemheg-31.31.0.dylib           libmythswscale.5.5.100.dylib
libmythavcodec.58.54.100.dylib          libmythfreemheg-31.31.dylib             libmythswscale.5.dylib
libmythavcodec.58.dylib                 libmythfreemheg-31.dylib                libmythswscale.dylib
libmythavcodec.dylib                    libmythmetadata-31.31.0.0.dylib         libmythtv-31.31.0.0.dylib
libmythavdevice.58.8.100.dylib          libmythmetadata-31.31.0.dylib           libmythtv-31.31.0.dylib
libmythavdevice.58.dylib                libmythmetadata-31.31.dylib             libmythtv-31.31.dylib
libmythavdevice.dylib                   libmythmetadata-31.dylib                libmythtv-31.dylib
libmythavfilter.7.57.100.dylib          libmythpostproc.55.5.100.dylib          libmythui-31.31.0.0.dylib
libmythavfilter.7.dylib                 libmythpostproc.55.dylib                libmythui-31.31.0.dylib
libmythavfilter.dylib                   libmythpostproc.dylib                   libmythui-31.31.dylib
libmythavformat.58.29.100.dylib         libmythprotoserver-31.31.0.0.dylib      libmythui-31.dylib
libmythavformat.58.dylib                libmythprotoserver-31.31.0.dylib        libmythupnp-31.31.0.0.dylib
libmythavformat.dylib                   libmythprotoserver-31.31.dylib          libmythupnp-31.31.0.dylib
libmythavutil.56.31.100.dylib           libmythprotoserver-31.dylib             libmythupnp-31.31.dylib
libmythavutil.56.dylib                  libmythservicecontracts-31.31.0.0.dylib libmythupnp-31.dylib
libmythavutil.dylib                     libmythservicecontracts-31.31.0.dylib   perl5
libmythbase-31.31.0.0.dylib             libmythservicecontracts-31.31.dylib     python3.8
libmythbase-31.31.0.dylib               libmythservicecontracts-31.dylib
a brute force search for filters also provide no filters folder. I suspect they got pulled on the transition to external FFMPEG a while back. Another thought is that I'm missing a configure flag...

Code: Select all

find . -type d -print|grep -i filter
./mythtv/mythtv/external/FFmpeg/libavfilter
./mythtv/mythtv/external/FFmpeg/libavfilter/tests
./mythtv/mythtv/external/FFmpeg/libavfilter/opencl
./mythtv/mythtv/external/FFmpeg/libavfilter/x86
./mythtv/mythtv/external/FFmpeg/libavfilter/aarch64
./mythtv/mythtv/external/FFmpeg/tests/filtergraphs
./31-osx-64bit/include/mythtv/libavfilter

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Thu May 14, 2020 1:13 pm

You are right. It was a change in MythTV 31:

https://github.com/MythTV/mythtv/commit/ead8718de6

Craig
The MacPorts guy.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Sat May 16, 2020 11:54 pm

@Craig - any tips on how to install plugins into the application? I have them compiled and the dylibs install to the correct directory. I just can't seem to figure out how to copy them into the Application and get mythfrontend to see that they are there.

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Sun May 17, 2020 12:34 am

I'm not sure. I have an old bundled app hanging around that was prepared with the official packaging script (0.25). In that, the libs are all converted to framewords but maybe this helps...
MFE_0.25_contents.jpg
MFE_0.25_contents.jpg (155.46 KiB) Viewed 566 times
Note: The file qt.conf contains:

Code: Select all

[Paths]
Plugins = PlugIns
I take it this is significant!

Craig
The MacPorts guy.

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Sun May 17, 2020 12:43 am

BTW, a considerable amount of stuff in the Resources folder of MFE app related to the plugins...
MFE_0.25_contents_2.jpg
MFE_0.25_contents_2.jpg (197.24 KiB) Viewed 565 times
Craig
The MacPorts guy.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Sun May 17, 2020 11:35 am

Thanks Craig! These should help.

Where you say packager script, do you mean "osx-packager-qtsdk.pl" which is included in packaging? If so, I'll take another pass tryin to understand the file. Unfortunately my perl is quite rusty and there are virtually no comments...

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Sun May 17, 2020 1:04 pm

Yes, the one here:

https://github.com/MythTV/packaging/tre ... /OSX/build

Note that a key difference is that it assumes the user will download a Mac installer from the Qt project to obtain their copy of all the required Qt stuff.

The script also downloads and installs all the necessary dependencies. The trouble is that many of the links are now way out of date as the script hasn't had much maintenance...since 0.27! Nonetheless, you may be able to glean some insights. Since it is GitHub, you can even use the Blame tool to try to see _why_ some things are as they are.

Craig
The MacPorts guy.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Sun May 17, 2020 1:47 pm

Thanks! Staring at it now.

Back in the .29 days, I tried to update that script and compile and now remember pulling my hair out to get things working then. Thankfully during that process, some kind sole (I think WarpMe) figured out how to build everything and posted an app on the wiki.

Years later, I guess it's my turn at the till and am very happy to be building without the script (...so far...). Also very very happy for all of the help from you and Bill.

I think the ansible based install will help keep the maintenance down for future compilers (just wish I could get a successful build worked from someone else on the mailing list or here...). Once I get it squared away, I may take a wack at updating the packaging repository. Possibly even the wiki after that. Unfortunately the wiki is a mess with 4 or so different pages on how to build on mythtv. I'd be tempted to start deleting some to reduce the confusion.
Last edited by jhoyt on Sun May 17, 2020 4:31 pm, edited 1 time in total.

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Sun May 17, 2020 3:00 pm

I'd forgotten about WarpMe's version of the packaging script. That's probably a better reference:

https://github.com/warpme/mythv-osx-build-script

The official packaging script served a couple of purposes but a prime one was to let a Mac-based MythTV developer do incremental builds and test on OS X. IOW, if only one or two source code files changed in Myth, only the affected bits would get recompiled and re-linked. Compared to my MacPorts build process, that is a gigantic time savings. I've still never built with your process--does it recompile everything or only the changed parts?

Yes, the wiki is a mess. That's why I punted and created a few pages specific to MacPorts. The wiki goes back over 10 years and there is a tonne of cruft that needs to be pruned. The trouble is that there are sometimes still nuggets of useful info amongst the dross.

Craig
The MacPorts guy.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Sun May 17, 2020 6:49 pm

I think I finally got it working. Many a keyboard hack trying to get the libraries copied into the correct place and the dylibs updated to look inside the executable.

I'm rerunning on on a fresh system now to verify that I have the correct commands. After that I'll update the install script and upload to sourceforge.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Sun May 17, 2020 8:27 pm

Yep - got it working. If anyone would like the critique the guide and suggest a better / cleaner way to do some of it I'd be most appreciative of the advice.

There's a lot of hacky commands I had to use to get the plugins working. Several commands may actually not be necessary, but I tried to match the older builds internal structure as closely as possible.

User avatar
pvr4me
Senior
Posts: 713
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Building Mythtv 31 with Ansible

Post by pvr4me » Sun May 17, 2020 9:11 pm

Do MythGame, MythBrowser and MythNews actually work? AFAICT none of the games work on the Mac. Pretty sure MythBrowser was badly broken in previous versions. And MythNews depended on MythBrowser.

Even MythWeather has been broken for long stretches before anybody reported it. With so many weather app choices on our phones, it is hard to imagine anyone really wanting MythWeather.

I do use MythMusic a bit. There are a handful of internet radio streams that I like. I think the visualizations are all broken on the Mac, however.

Craig
The MacPorts guy.

jhoyt
Junior
Posts: 64
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Building Mythtv 31 with Ansible

Post by jhoyt » Sun May 17, 2020 9:27 pm

Just checked (I only checked mythmusic on the first pass)

MythBrowser - works
MythGame - seems to work (settings and menus - I'm scanning for games currently)
MythMusic - works
MythNews - works
MythWeather - works

Post Reply