v18 How to build kodi with ENABLE_MARIADBCLIENT=ON ... currently getting errors
#1
On Arch Linux, my build of kodi 18.0rc5.2 is throwing errors and I'm not sure why.

My cmake step:
Code:
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DVERBOSE=ON \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DENABLE_EVENTCLIENTS=ON \
    -DENABLE_INTERNAL_FFMPEG=ON \
    -DENABLE_INTERNAL_FMT=ON \
    -DENABLE_INTERNAL_CROSSGUID=ON \
    -DENABLE_INTERNAL_FSTRCMP=ON \
    -DENABLE_INTERNAL_FLATBUFFERS=ON \
    -DENABLE_MARIADBCLIENT=ON \
    -DENABLE_MYSQLCLIENT=OFF \
    -DMARIADBCLIENT_INCLUDE_DIR=/usr/include/mysql \
    -Dlibdvdcss_URL="/libdvdcss-1.4.2-Leia-Beta-5.tar.gz" \
    -Dlibdvdnav_URL="/libdvdnav-6.0.0-Leia-Alpha-3.tar.gz" \
    -Dlibdvdread_URL="/libdvdread-6.0.0-Leia-Alpha-3.tar.gz" \
    -DFFMPEG_URL="/ffmpeg-4.0.3-Leia-RC5.tar.gz" \
    -DFMT_URL="/fmt-5.1.0.tar.gz" \
    -DCROSSGUID_URL="/crossguid-8f399e8bd4.tar.gz" \
    -DFSTRCMP_URL="/fstrcmp-0.7.D001.tar.gz" \
    -DFLATBUFFERS_URL="/flatbuffers-1.9.0.tar.gz" \
    ../"xbmc-18.0rc5.2-Leia"

Example error:
Code:
...
Scanning dependencies of target dbwrappers
[ 55%] Building CXX object build/dbwrappers/CMakeFiles/dbwrappers.dir/Database.cpp.o
In file included from /build/kodi-devel/src/xbmc-18.0rc5.2-Leia/xbmc/dbwrappers/Database.cpp:23:
/build/kodi-devel/src/xbmc-18.0rc5.2-Leia/xbmc/dbwrappers/mysqldataset.h:16:10: fatal error: mariadb/mysql.h: No such file or directory
#include <mariadb/mysql.h>
          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [build/dbwrappers/CMakeFiles/dbwrappers.dir/build.make:63: build/dbwrappers/CMakeFiles/dbwrappers.dir/Database.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:7292: build/dbwrappers/CMakeFiles/dbwrappers.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...

Link to complete build log: https://gist.github.com/graysky2/638ccd9...31d67c7aa6
Need help programming a Streamzap remote?
Reply
#2
Didn't it work 3 days ago? :-)
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
@graysky
I think this is a difference between full blown mariadb and lightweight mariadb-connector-c .
https://git.archlinux.org/svntogit/packa...ariadb#n57 you'll see that they install mariadb headers to /usr/include/mysql
and so do debian/ubuntu
However mariadb-connector-c which is not usually shipped by distros because they use full blown mariadb source installs includes into /usr/include/mariadb
and kodi cmake script looks explicitly for mariadb/*.h
Reply
#4
As you pointed out...
mariadb-libs provides /usr/include/mysql/server/mysql.h
mariadb-connector-c provides /usr/include/mariadb/mysql.h

However, I get the same error if I build with the mariadb-libs package in the build root (as a makedepends) or if I build with the mariadb-connector-c package in the build root (again as a makedepends).  Is there something I need to modify in the kodi cmake scripts to look in the right place?

EDIT: I think I got it... had to modify 2 files and I did not need either the full mariadb package nor the mariadb-connector-c package. Just the mariadb-libs package. Here is the patch I used to modify the 2 files that allowed the build:
Code:
--- a/xbmc/dbwrappers/mysqldataset.h    2019-01-12 12:18:33.000000000 -0500
+++ b/xbmc/dbwrappers/mysqldataset.h    2019-01-19 10:40:41.078632987 -0500
@@ -13,7 +13,7 @@
 #ifdef HAS_MYSQL
 #include "mysql/mysql.h"
 #elif defined(HAS_MARIADB)
-#include <mariadb/mysql.h>
+#include "mysql.h"
 #endif
 
 namespace dbiplus {
--- a/xbmc/dbwrappers/mysqldataset.cpp    2019-01-12 12:18:33.000000000 -0500
+++ b/xbmc/dbwrappers/mysqldataset.cpp    2019-01-19 10:54:52.888268028 -0500
@@ -20,7 +20,7 @@
 #ifdef HAS_MYSQL
 #include "mysql/errmsg.h"
 #elif defined(HAS_MARIADB)
-#include <mariadb/errmsg.h>
+#include "errmsg.h"
 #endif
 
 #ifdef TARGET_POSIX
Need help programming a Streamzap remote?
Reply
#5
So the question is what does building including these two extra cmake lines vs building without them?
Code:
-DENABLE_MARIADBCLIENT=ON -DENABLE_MYSQLCLIENT=OFF \
-DMARIADBCLIENT_INCLUDE_DIR=/usr/include/mysql \

If I diff the configuration output (left = with them and right = without):
Image

If I build WITH the these lines:
Code:
-- #---- CONFIGURATION ----#
-- Platform: X11
-- -- PATH config --
-- Prefix: /usr
-- Libdir: /usr/lib
-- Bindir: /usr/bin
-- Includedir: /usr/include
-- Datarootdir: /usr/share
-- Datadir: /usr/share
-- Docdir: /usr/share/doc/kodi
-- ALSA enabled: Yes
-- AVAHI enabled: Yes
-- BLUETOOTH enabled: Yes
-- BLURAY enabled: Yes
-- CAP enabled: Yes
-- CCACHE enabled: No
-- CEC enabled: Yes
-- DBUS enabled: Yes
-- LCMS2 enabled: Yes
-- LIRCCLIENT enabled: Yes
-- MDNS enabled: No
-- MICROHTTPD enabled: Yes
-- NFS enabled: Yes
-- PULSEAUDIO enabled: Yes
-- PYTHON enabled: Yes
-- SMBCLIENT enabled: Yes
-- SNDIO enabled: No
-- UDEV enabled: Yes
-- XSLT enabled: Yes
-- VAAPI enabled: Yes
-- VDPAU enabled: Yes
-- GLX enabled: Yes
-- PLIST enabled: Yes
-- MARIADBCLIENT enabled: Yes

If I build without these lines:
Code:
-- #---- CONFIGURATION ----#
-- Platform: X11
-- -- PATH config --
-- Prefix: /usr
-- Libdir: /usr/lib
-- Bindir: /usr/bin
-- Includedir: /usr/include
-- Datarootdir: /usr/share
-- Datadir: /usr/share
-- Docdir: /usr/share/doc/kodi
-- ALSA enabled: Yes
-- AVAHI enabled: Yes
-- BLUETOOTH enabled: Yes
-- BLURAY enabled: Yes
-- CAP enabled: Yes
-- CCACHE enabled: No
-- CEC enabled: Yes
-- DBUS enabled: Yes
-- LCMS2 enabled: Yes
-- LIRCCLIENT enabled: Yes
-- MDNS enabled: No
-- MICROHTTPD enabled: Yes
-- NFS enabled: Yes
-- PULSEAUDIO enabled: Yes
-- PYTHON enabled: Yes
-- SMBCLIENT enabled: Yes
-- SNDIO enabled: No
-- UDEV enabled: Yes
-- XSLT enabled: Yes
-- VAAPI enabled: Yes
-- VDPAU enabled: Yes
-- GLX enabled: Yes
-- PLIST enabled: Yes
-- MARIADBCLIENT enabled: Yes
Need help programming a Streamzap remote?
Reply
#6
the whole mysql/mariadb thing is a huge mess. Not only does mariadb ship mysql.h (and ONLY mysql.h), it also does so in different paths for full mariadb and mariadbclient.
What makes matters worse is that distros tend to freely rename and shuffle names and paths around as they see fit, so finding the correct headers (and sometimes libs) is very much hit and miss.

The PR that introduced official mariadb support tries to distinguish between mariadb and mysql via include paths, which obviously fails on many distros.

Can you try https://github.com/wsnipex/xbmc/commit/c...b91b7e746a ?
Reply
#7
@wsnipex - Thank you!  Patching 18.0rc5.2 source with that commit allows for an error-free build.  I also dropped the -DMARIADBCLIENT_INCLUDE_DIR=/usr/include/mysql option so my cmake step in full on x86_64 is:
Code:
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DENABLE_EVENTCLIENTS=ON \
    -DENABLE_INTERNAL_FFMPEG=ON \
    -DENABLE_INTERNAL_FMT=ON \
    -DENABLE_INTERNAL_CROSSGUID=ON \
    -DENABLE_INTERNAL_FSTRCMP=ON \
    -DENABLE_INTERNAL_FLATBUFFERS=ON \
    -DENABLE_MARIADBCLIENT=ON -DENABLE_MYSQLCLIENT=OFF \
    -Dlibdvdcss_URL="/libdvdcss-1.4.2-Leia-Beta-5.tar.gz" \
    -Dlibdvdnav_URL="/libdvdnav-6.0.0-Leia-Alpha-3.tar.gz" \
    -Dlibdvdread_URL="/libdvdread-6.0.0-Leia-Alpha-3.tar.gz" \
    -DFFMPEG_URL="/ffmpeg-4.0.3-Leia-RC5.tar.gz" \
    -DFMT_URL="/fmt-5.1.0.tar.gz" \
    -DCROSSGUID_URL="/crossguid-8f399e8bd4.tar.gz" \
    -DFSTRCMP_URL="/fstrcmp-0.7.D001.tar.gz" \
    -DFLATBUFFERS_URL="/flatbuffers-1.9.0.tar.gz" \
    ../"xbmc-18.0rc5.2-Leia"

The cmake config outputted is:
Code:
-- #---- CONFIGURATION ----#
-- Platform: X11
-- -- PATH config --
-- Prefix: /usr
-- Libdir: /usr/lib
-- Bindir: /usr/bin
-- Includedir: /usr/include
-- Datarootdir: /usr/share
-- Datadir: /usr/share
-- Docdir: /usr/share/doc/kodi
-- ALSA enabled: Yes
-- AVAHI enabled: Yes
-- BLUETOOTH enabled: Yes
-- BLURAY enabled: Yes
-- CAP enabled: Yes
-- CCACHE enabled: No
-- CEC enabled: Yes
-- DBUS enabled: Yes
-- LCMS2 enabled: Yes
-- LIRCCLIENT enabled: Yes
-- MDNS enabled: No
-- MICROHTTPD enabled: Yes
-- NFS enabled: Yes
-- PULSEAUDIO enabled: Yes
-- PYTHON enabled: Yes
-- SMBCLIENT enabled: Yes
-- SNDIO enabled: No
-- UDEV enabled: Yes
-- XSLT enabled: Yes
-- VAAPI enabled: Yes
-- VDPAU enabled: Yes
-- GLX enabled: Yes
-- PLIST enabled: Yes
-- MARIADBCLIENT enabled: Yes
Need help programming a Streamzap remote?
Reply
#8
(2019-01-20, 09:54)wsnipex Wrote: the whole mysql/mariadb thing is a huge mess. Not only does mariadb ship mysql.h (and ONLY mysql.h), it also does so in different paths for full mariadb and mariadbclient.
What makes matters worse is that distros tend to freely rename and shuffle names and paths around as they see fit, so finding the correct headers (and sometimes libs) is very much hit and miss.

The PR that introduced official mariadb support tries to distinguish between mariadb and mysql via include paths, which obviously fails on many distros.

Can you try https://github.com/wsnipex/xbmc/commit/c...b91b7e746a ?
I'd like to get my server on the latest Ubuntu LTS, but the new LTS comes with MythTV .29, current stable kodi-pvr for it only works up to .28. So I would need to goto Leia to get my MythTV working properly. Hence the question.
Reply
#9
Is there  a proper procedure  to upgrade from unstable ppa version RC > final release on stable? Other than just purging one, changing ppa and reinstalling? Anything I need to worry about?

MOD edited out embedded links, probably OP error...
Reply
#10
(2019-01-22, 20:49)pino2000 Wrote: Anything I need to worry about?
Yes... Do not again spam any of your future posts in this forum with embedded links to unrelated websites.
One more time and you will instantly kicked off this forum, no questions asked. This is your first and final warning.
Reply
#11
(2019-01-22, 20:49)pino2000 Wrote: Is there  a proper procedure  to upgrade from unstable ppa version RC > final release on stable? Other than just purging one, changing ppa and reinstalling? Anything I need to worry about?

MOD edited out embedded links, probably OP error...
 ...and why are you replying to a thread focused on a specific aspect of compiling the software with your unrelated question?  Go hijack threads elsewhere.
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
How to build kodi with ENABLE_MARIADBCLIENT=ON ... currently getting errors0