You are not logged in.
I maintain the mythtv-git AUR package, and I'm looking into overhauling the mythtv-git PKGBUILD, especially given that upstream is slowly migrating to building with cmake which I think might be the preferred approach going forward when the next version (36) is released early in 2026. (This below PKGBUILD is for `fixes/35` using qt5, however I've also got the build to work on `master` with qt6 (`fixes/35` has some issues with cmake & qt6 which are fixed in `master` so I suspect those fixes will be pulled in for the 36 release).
I've also refreshed the dependencies to bring them more in line with what is recommended on upstream (I've looked at their ansible recipes for this)
One thing that is different from the old ./configure && make && make install method is that cmake will automatically include/exclude features based on whether the appropriate dependencies have been installed or not, (so I no longer need to do ./configure --enablelibx264 for example, I just need to make sure I've installed the x264 package) - as explained in Mythtv's README for cmake:
By default, CMake builds will try and compile in support for as many optional parts of MythTV as possible. If the necessary system libraries are present, then the cmake build will use them. (This is the opposite of the traditional make build, where all optional features were disabled by default.) If you encounter a problem with a feature, you may disable it by adding -DENABLE_<FEATURE>=OFF to the command line. See the options section for more information.
In an effort to give a more full-featured build out-of-the-box (and taking into account that some technically optional but very commonly-enabled features such as x264 & x265 support were already enabled by default in the existing package), I've looked at the various features and what dependencies trigger their enablement and moved most of these out of being optional dependencies, including the perl & python bindings (so these should now be always built), along with all specific audio & video codec support. Some things i've left optional, such as different GPU rendering support, lirc and audio server support.
pkgname=mythtv-git
pkgver=35.0.r44.g7e93f0d
pkgrel=1
pkgdesc="A Homebrew PVR project (Stable 'fixes/' branch, built with cmake)"
arch=('x86_64')
url="https://www.mythtv.org/"
license=('GPL')
depends=(
'aom'
'avahi'
'dav1d'
'exiv2'
'flac'
'fontconfig'
'freetype2'
'lame'
'libass'
'libavc1394'
'libbluray'
'libcdio'
'libcdio-paranoia'
'libcec'
'libdrm'
'libiec61883'
'libmpeg2'
'libsamplerate'
'libvpx'
'libxinerama'
'libxml2'
'libxnvctrl'
'libxrandr'
'libxv'
'libzip'
'mariadb'
'mariadb-clients'
'perl-dbi'
'perl-dbd-mysql'
'perl-io-socket-inet6'
'perl-date-manip'
'perl-xml-simple'
'perl-xml-xpath'
'perl-image-size'
'perl-datetime-format-iso8601'
'perl-soap-lite'
'perl-json'
'perl-findbin'
'perl-ipc-cmd'
'php'
'python-mysqlclient'
'python-lxml'
'python-requests'
'python-setuptools'
'python-pip'
'python-wheel'
'python-pycurl'
'qt5-base'
'qt5-script'
'sdl2'
'systemd-libs'
'v4l-utils'
'x264'
'x265'
'xvidcore'
'soundtouch'
'sqlite3'
'taglib'
)
makedepends=(
'base-devel'
'cmake'
'cronie'
'git'
'gperf'
'lsb-release'
'meson'
'nasm'
'ninja'
'patch'
'perl-net-upnp'
)
optdepends=(
'alsa-lib: Enable ALSA audio support'
'ccache: Use Ccache to speed up future builds'
'jack2: Enable JACK audio support'
'libhdhomerun: Enable support for HDHomeRun boxes'
'libpulse: Enable PulseAudio audio & output support'
'libva: Enable VAAPI hardware accelerated video decoding'
'libvdpau: Enable NVidia VDPAU hardware acceleration'
'lirc: Enable lirc support (Infrared Remotes)'
'qt5-webkit: Enable the mythbrowser plugin'
)
options=(!lto)
provides=("${pkgname%-git}")
conflicts=(
"${pkgname%-git}"
'mythplugins'
)
source=(
"git+https://github.com/MythTV/mythtv#branch=fixes/35"
'mythbackend.service'
'mythtv.desktop'
'mythtv.png'
'99-mythbackend.rules'
'sysusers.d'
)
sha256sums=(
'SKIP'
'5ec7b0f6a3767068d1912188c6bc8957583a543abcb5b4ef52ea7126e316525b'
'3fd2018d0d5aaa7d530835305dac80d4ca7d8fc991cdf9e1cebadebd86e25c03'
'12cb52bf9b084a4f16419c9370fef0450ce6a11308b0c3f7240f4f83df7e2ab6'
'ecfd02bbbef5de9773f4de2c52e9b2b382ce8137735f249d7900270d304fd333'
'470de0a4050c16c7af11a0e5cfe2810b7daae42df4acf5456c7eae274dc7c5ae'
)
pkgver() {
cd "$srcdir/mythtv/mythtv"
printf "%s" "$(git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
}
build() {
cd "$srcdir/mythtv"
# MythTV's cmake configure will fail if CMAKE_INSTALL_PREFIX is not writable so it must be set to inside $srcdir
# Because $pkgdir is not writeable during build()
cmake -Wno-dev -DCMAKE_BUILD_TYPE=RelWithDebugInfo -DCMAKE_INSTALL_PREFIX=$srcdir/usr -DMYTH_BUILD_PLUGINS=ON --preset qt5
cmake --build build-qt5 -j$(nproc)
}
package() {
# Copy the build sources to pkgdir - subsequent runs of cmake will fail if $srcdir/usr becomes empty
# which is why we're coping instead of moving the files
cp -r "$srcdir/usr" "$pkgdir/usr"
install -D -m644 "$srcdir/mythbackend.service" "$pkgdir/usr/lib/systemd/system/mythbackend.service"
install -D -m644 "$srcdir/mythtv/mythtv/database/mc.sql" "$pkgdir/usr/share/mythtv/mc.sql"
install -D -m644 "$srcdir/sysusers.d" "$pkgdir/usr/lib/sysusers.d/mythtv.conf"
# Copy across the contrib directory
mkdir -p "$pkgdir/usr/share/mythtv"
cp -r "$srcdir/mythtv/mythtv/contrib" "$pkgdir/usr/share/mythtv"
# Create logs directory
mkdir -p "$pkgdir/var/log/mythtv"
# Install udev rules https://www.mythtv.org/wiki/Systemd_mythbackend_Configuration#Delay_starting_the_backend_until_tuners_have_initialized
install -Dm644 "$srcdir/99-mythbackend.rules" "$pkgdir/usr/lib/udev/rules.d/99-mythbackend.rules"
# Install desktop file
install -Dm644 "$srcdir/mythtv.png" "$pkgdir/usr/share/pixmaps/mythtv.png"
install -Dm644 "$srcdir/mythtv.desktop" "$pkgdir/usr/share/applications/mythtv.desktop"
}One thing i'm struggling with is that Mythtv's initial `cmake --preset qt5 -DCMAKE_INSTALL_PREFIX=<install_location>` command will fail if the `CMAKE_INSTALL_PREFIX` location is read-only.
Ideally I would have liked to set that to `$pkgdir/usr` however that doesn't work because `$pkgdir` isn't writeable during the build() phase.
Also I couldn't find a way to run `cmake --build build-qt5` but without it installing the files into `CMAKE_INSTALL_PREFIX` either, Ideally I would have wanted to do something like a `cmake --install` during the `package` phase instead.
But instead i'm having to do this horrendous `cp -r` in the `package()` phase which I don't really like.
Finally (and probably most controversially) I'm considering having this package also build and install the plugins as well - partly to stop the existing mythplugins AUR package from becoming out of sync with the mythtv-git package (they're already out of sync with each other, and I don't maintain the latter, and nor do I want to really). However this was mainly a side-effect of me not being sure if I could build mythplugins using their cmake build system without having to compile mythtv itself a 2nd time within the other package, as a pre-requisite.
What do people think of this all? I think a lot of my issues might be because i'm very new to cmake and in particular how mythtv uses it.
Last edited by bergqvistjl (2025-11-24 11:00:39)
Offline
The problem with requiring write access is likely in the --preset used .
The CMakePresets.json has
{
"name": "qt5",
"inherits": "ci-base",
"displayName": "Native system qt5"
},Look at ci-base in that file to see what it does and switch to crafting the cmake options manually .
Also look at https://wiki.archlinux.org/title/CMake_ … guidelines
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
The problem with requiring write access is likely in the --preset used .
Look at ci-base in that file to see what it does and switch to crafting the cmake options manually .
Also look at https://wiki.archlinux.org/title/CMake_ … guidelines
It's not, it's in the base config as far as I can tell: https://github.com/MythTV/mythtv/blob/m … #L242-L247
Even if I run without a preset it will still run that check (but even if that wasn't an issue, I'm not sure how I could get it to run the "install" part separately anyway - their cmake config always writes to that directory even with `cmake --build`, `cmake --install` was having no effect for me)
I did have a look at our own CMake package guidelines, I tried to invoke cmake more like the guidelines suggested, but it didn't help much for the above reasons.
Last edited by bergqvistjl (2025-11-24 15:18:16)
Offline
The configure / make / make install process used now doesn't seem to have those problems.
That suggests the cmake setup focuses on user installs and lacks things needed for installing through a package manager.
I think that should be reported upstream.
I just noticed you have meson listed as makedepend, why do you need cmake and meson ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
The configure / make / make install process used now doesn't seem to have those problems.
That suggests the cmake setup focuses on user installs and lacks things needed for installing through a package manager.I think that should be reported upstream.
I just noticed you have meson listed as makedepend, why do you need cmake and meson ?
Yes, I will do that, thanks. I don't think their Cmake config is as mature yet as I was hoping.
And I added meson because it was listed in their ansible recipes (along with cmake): https://github.com/MythTV/ansible/blob/ … ml#L17-L23
But if they conflict then i'll remove it. I have to be honest their Ansible recipes are all a bit vague too, but that's what their wiki recommends they use...
https://wiki.mythtv.org/wiki/Build_from … th_Ansible
Offline
meson and cmake don't conflict, but they are both build systems for cross-platform software.
Typically upstream chooses one of them, not both.
Try building in a clean chroot without meson in deps to verify if build succeeds without it.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline