Opened 5 years ago

Last modified 5 years ago

#49296 new enhancement

kdelibs4::FindMySQL.cmake

Reported by: RJVB (René Bertin) Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: mkae (Marko Käning)
Port: kdelibs4

Description

Building a new Calligra version I ran into an issue with the cmake macro for finding the MySQL libraries when one has port:mariadb installed instead of a "regular" mysql port -- and that's actually the default with port:akonadi.

I'm attaching a patch that adds support for the mysql libraries provided by MariaDB (and underlines once more that too much sandboxing/compartmentalisation has undesirable implications). The patch will require a corresponding post-patch in the kdelibs Portfile, of course:

post-patch {
    reinplace "s|%PREFIX%|${prefix}|g" \
        ${worksrcpath}/cmake/modules/FindMySQL.cmake
}

Attachments (2)

patch-cmake-modules-FindMySQL.cmake.diff (1.0 KB) - added by RJVB (René Bertin) 5 years ago.
kde4-1.1.diff (1.9 KB) - added by RJVB (René Bertin) 5 years ago.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by RJVB (René Bertin)

Changed 5 years ago by RJVB (René Bertin)

Attachment: kde4-1.1.diff added

comment:1 Changed 5 years ago by RJVB (René Bertin)

I spoke a tad too soon (Calligra takes a "while" to build); the KDE4 portgroup had to be edited too.

I'm not sure whether it should define the executables, or whether those should be left unset and resolved by the user doing a port select. The definitions seem clearly unnecessary: I don't have ${prefix}/bin/mysql_config5 nor ${prefix}/libexec/mysqld, and yet everything always worked as far as I can tell.

comment:2 Changed 5 years ago by mf2k (Frank Schima)

Cc: nicos@… removed
Owner: changed from macports-tickets@… to nicos@…

comment:3 Changed 5 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:4 Changed 5 years ago by NicosPavlov

I fully agree on the paths which are completely obsolete in the PortGroup. I removed them in r142093.

On the other hand, I am not sure about the changes in FindMySQL. First, if they are performed, they should be more general than just for the two ports included (mysql5 and mariadb). Each SQL port and its variants (such as mysql55, mysql56, mariadb55, percona56, ...) create their own subdirectories, which should be taken into account. I am also not that sure about the usefulness of that script. Akonadi, for example, is defining its own variants (as most ports using MySQL and its derivatives) and own paths anyway. I'll have to look into it a bit more to see how used it is.

comment:5 Changed 5 years ago by RJVB (René Bertin)

Evidently my patches to FindMySQL have a bit the character of an example. They show how to address the situation in a way that makes things build in my set-up and in what may or may not be the most common set-ups. I haven't even tried to check all possible alternatives that could be added. I agree it should be done, but I'm not convinced it's necessary to be exhaustive immediately (= one could wait for further reports).

Meanwhile, FindMySLQ *is* used by Calligra's cmake files. Akonadi might actually not be using libraries from the SQL port, but only the executable?

comment:6 Changed 5 years ago by NicosPavlov

Thinking more about it, I realised this would not be a suitable approach, as ports still need to specifically indicate which SQL port they are using, typically through variants. Therefore, just introducing all the paths would not fulfil that goal.

A good example of what can be done is in fact provided in the amarok port, which uses its own local patched FindMySQL script, where variants indicate which SQL port is to be used. A similar approach might be the best for Calligra too.

comment:7 Changed 5 years ago by RJVB (René Bertin)

This depends on whether it is supposed to be possible to install different sql ports.

Note: See TracTickets for help on using tickets.