Alright, compiling Kodi was relatively straight forward and generally simple as long as you are compiling on the machine you want to install to using their instructions for /usr/local. Instructions for building deb packages are not given and those details were challenging to glean. If it helps anyone here is a rough account of what I ended up doing to build deb packages.
I followed the wiki instructions for Ubuntu to get the dependencies installed. Use the install dependencies manually option and copy the sudo apt install line. My system is Mint 21 based on Jammy. All the dependencies came in fine. I skipped Wayland and GBM. Installed the optional doxygen libcap-dev libsndio-dev but not libmariadbd-dev. Now if you move to the general Linux build instructions and follow section 4 you should get a Kodi install into /usr/local. However I wanted deb packages because I don't want to install a complete build system on every machine. So this is the cmake line I used ...
cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr -DCORE_PLATFORM_NAME=x11 -DAPP_RENDER_SYSTEM=gl -DCPACK_GENERATOR=DEB
Now build as normal as per section 4.2
Next create the files changelog.Debian.gz and copyright in kodi-build/packages/deb and it appears they can be empty files.
Now run ...
cpack
In short order you will find debs in kodi-build/packages
Thats it for Kodi. Binary addons are a bit more tricky for deb packages but straight forward instructions are given for installing to /usr/local on the same machine that you compile on. Here is how I ended up finally making a deb package for these.
First, install the kodi-addon dev deb package from the ones you just finished building. Now there seems to be no way to build binary addons without cmake actually installing them as part of the process. So if you have existing addons installed back them up first. The only way to build dep packages for addons appears to be using the out of tree method. To get the source for the addon I first used the in tree build. So roughly this...
cd into kodi-build
sudo make -j 4 -C ../kodi/tools/depends/target/binary-addons PREFIX=/usr ADDONS="pvr.hts"
At this point pvr.hts is installed on your local machine. To make a deb package I then did this...
I made a directory in the kodi source (not kodi-build) directory called DEBS. I dug into kodi/tools/depends/target/binary-addons/native/build/download and found the source code directory for pvr.hts and then copied that directory into kodi/DEBS. Now cd into the pvr.hts source directory inside kodi/DEBS and run cmake ...
cmake -DCMAKE_INSTALL_PREFIX=/usr
Now cd into the debian directory and edit the changelog file to the correct version. Line number 1 should look some thing like this...
kodi-pvr-hts (6:21.2.3-git6c5564f90~jammy) jammy; urgency=low
save changelog and cd ..
To build the deb....
sudo dpkg-buildpackage -rfakeroot -us -uc
The package is found in kodi/DEBS
So I now have debs for Jammy to install on all my machines. Initial tests would seem it all works.
Final comments:
It would have been faster and easier to install a new debian bookworm system with kodi backports from DMO if Kodi is all that runs on the machine. I'm not sure if there is any good reason to stick with an Ubuntu based system any more. The Kodi ppa was one of the things keeping me there, but with Kodi now in debian backports and the ppa gone that certainly changes things. Running Bookworm also give access to MX repos which have some good things. I don't expect the Kodi PPA will ever be resurrected.
If anyone knows of an easier way to build debs for binary addons I'd love to learn of it.