Interest in Mythbackend Builds

For discussion of topics specific to MythTV on OSX
pmaloney
Junior
Posts: 20
Joined: Wed Nov 08, 2023 2:57 am
United States of America

Re: Interest in Mythbackend Builds

Post by pmaloney »

I guess my point is that "compileMythtvAnsible.sh" is not at that url. Did I miss something?
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

My apologies - the line should have been

Code: Select all

compileMythtvAnsible.zsh --version=fixes/33 --repo-prefix=/usr/local/bin
My mistake on the original suggestion. I'll fix that to reduce other's confusion.

[edit 12/16/23] the script name was updated from "compileMythfrontendAnsible.zsh " to "compileMythtvAnsible.zsh" in a recent commit
Last edited by jhoyt on Sat Dec 16, 2023 5:45 pm, edited 1 time in total.
pmaloney
Junior
Posts: 20
Joined: Wed Nov 08, 2023 2:57 am
United States of America

Re: Interest in Mythbackend Builds

Post by pmaloney »

That compiles the backend, too?
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

Yes as previously stated. Original intent was frontend only. In the process you end up having to compile everything. Then another user made mods to allow it to install at a user set prefix.
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

An update was just accepted changing the build script name from to "compileMythfrontendAnsible.zsh " to "compileMythtvAnsible.zsh" to reduce the confusion. The update also puts the build script in the top level of the OSX tree in packaging (https://github.com/MythTV/packaging/tree/master/OSX ). I'll update my comments in the thread to reflect the update.

Also - as a teaser, the update to the build script adds initial support for building with homebrew. The PR for the ansible repo is under review, but once accepted provides the capability to those who prefer homebrew to macports.
pmaloney
Junior
Posts: 20
Joined: Wed Nov 08, 2023 2:57 am
United States of America

Re: Interest in Mythbackend Builds

Post by pmaloney »

Can this be run completely in a non-admin account?
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

pmaloney wrote:
Sun Dec 17, 2023 8:50 pm
Can this be run completely in a non-admin account?
I'll give you a strong maybe...

The script certainly can be run as a non-admin user, the only item which requires admin privileges is the ansible install of packages. The ansible playbook for homebrew does run most steps as a non admin-user (the become:false line in each step enforces this), but the default ansible behavior in the mythtv playbook is to request admin privileges and so ansible asks for the sudo password every time its run.

If you wanted to skip running ansible and manually install the packages from homebrew, pip (python), and mcanm (perl) yo could then run the compile script with the "--skip-ansible=true" flag which would handle the build without invoking the script.

Is there a driving reason why you're trying to avoid admin privileges?
pmaloney
Junior
Posts: 20
Joined: Wed Nov 08, 2023 2:57 am
United States of America

Re: Interest in Mythbackend Builds

Post by pmaloney »

jhoyt wrote:
Mon Dec 18, 2023 11:49 am
Is there a driving reason why you're trying to avoid admin privileges?
I should blindly give root access to anything that wants it? I don't know what ansible is doing.
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

That's a fair and highly rationale reason.

You could look at the ansible playbooks under roles for both mythtv-xxx and qt5-xxx (qt6 is currently broken) for either homebrew or macports and manually install the required packages, Python, and perl stuff.

When running the install script use "--skip-ansible=true" and it'll run without asking for the sudo password.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Interest in Mythbackend Builds

Post by pvr4me »

pmaloney wrote:
Sat Dec 23, 2023 9:33 pm
jhoyt wrote:
Mon Dec 18, 2023 11:49 am
Is there a driving reason why you're trying to avoid admin privileges?
I should blindly give root access to anything that wants it? I don't know what ansible is doing.
Well, you should do some due diligence first. So just review all the code in MythTV. And then all the code in the 300+ dependencies. After that, go for it!

Image

Craig
Formerly the MacPorts guy.
pmaloney
Junior
Posts: 20
Joined: Wed Nov 08, 2023 2:57 am
United States of America

Re: Interest in Mythbackend Builds

Post by pmaloney »

I got this to sort of work without any root privs. I installed Homebrew (which I've never used before) in the Documents directory of a regular account and ran the build script with --skip-ansible=true, a custom prefix, and the other options recommended above.

I had to manually install a lot of dependencies in homebrew but, once I got past that, it did build.

However, only the frontend works. It opens up a window, connects to the database, then gets stuck at trying to connect to the backend because it's not running.

That brings me to the problem. Only the frontend app has a Frameworks directory. It looks like the end of the script fixes up the linkage and frameworks for the frontend only. None of the other apps have a Frameworks directory.

I can copy/link the frontend's Frameworks directory into the backend/setup apps, etc. and I get past 'file not found' errors. But, then I run into what I think is linkage issues which results in Qt not starting or it complaining that things are linked to two different Qt installations.

Can you update the script to fixup the other apps?
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

pmaloney wrote:
Sun Dec 24, 2023 1:58 pm
I had to manually install a lot of dependencies in homebrew but, once I got past that, it did build.
...hence why I put together the ansible playbooks. It's a pain to manually install all of the dependencies...

Are you building with the "--generate-app=false" flag set? You should be to install the executables like a normal unix system which skips all of the app bundle generation for mythfrontend.

If you elect to run mythbackend on a macOS system, you should be using the executables in the stored in the custom prefix directory. You should NOT be running the application bundles except for mythfrontend. i.e.

Code: Select all

$custom_prefix/bin/mythbackend
$custom_prefix/bin/mythutil
$custom_prefix/bin/...
That being said, you still need to setup a working database (i.e. whatever you installed with homebrew), run and setup mythbackend, and setup a working recorder.
pmaloney wrote:
Sun Dec 24, 2023 1:58 pm
Can you update the script to fixup the other apps?
No, I personally will not, but others may and are highly encouraged to make mods as appropriate. There have been several others who have kindly contributed updates to the script and they have been included after testing.
pmaloney
Junior
Posts: 20
Joined: Wed Nov 08, 2023 2:57 am
United States of America

Re: Interest in Mythbackend Builds

Post by pmaloney »

Building now with --generate-app=false.

I do have a database set up (mysql@8.0). Been a while since I set up .25 under 5.5. For .33, I ran mc.sql on it which just creates an empty database and an associated user. Doesn't the backend handle creating the objects or updating objects to a new version? Will it upgrade .25 objects to .33?
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

Per the wiki, v33 should be able to upgrade anything from v22 and later:

https://www.mythtv.org/wiki/Release_Not ... structions
User avatar
jhoyt
Senior
Posts: 143
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: Interest in Mythbackend Builds

Post by jhoyt »

Some tips if others choose to update the compile script to bundle up mythbackend:
  • Everything past "Assume that all commands past this point only apply to app bundling" needs to be run with appropriate modifications on the backend bundle
  • This can probably be done in a for loop with the "APP" variables and "mythfrontend" hard codes updated at the beginning of the loop.
  • The app's plist will need to be set appropriately and probably needs some new app entitlements to keep SID from killing the main process
  • ALL of the MythTV utility functions will need to be copied into the app bundle (not just the few I copy into mythfrontend)
  • Probably everything installed in your custom prefix under include, lib, and share will need to be copied into the right place in the app bundle
  • A perl executable will likely need to be copied into the app bundle in case there's a conflict with the system's or installed perl. (warning - this was non-trivial for python)
Post Reply