Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#49120 closed defect (worksforme)

port:automoc should install its cmake files where others expect them

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: michaelld (Michael Dickens)
Port: automoc

Description

A recent change to port:automoc "fixed" the install location CMake files, presumably to put them where MacPorts puts them (followed by 1 or 2 more "fixes".

This causes issues with polkit-qt, phonon, and probably others which use a FindAutomoc4.cmake script to find the Automoc cmake files.

A quick glance on my Linux rig shows that automoc's Automoc4Config.cmake file is installed in the equivalent location as where port:automoc used to put it: in /usr/lib/automoc4 .

Was that "fix" from r133624 meant to address an issue or was it looking for one? In the latter case I suggest the attached patch to revert the fix to the ain't-broke situation; in the former case ${prefix}/lib/automoc4 should be symlinked to the new location so that we don't have to patch an unknown number of dependent ports for what's probably just a cosmetics change.

Attachments (1)

automoc.diff (805 bytes) - added by RJVB (René Bertin) 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by RJVB (René Bertin)

Attachment: automoc.diff added

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Priority: HighNormal

The Priority field is for use by Macports team members only.

comment:2 Changed 9 years ago by michaelld (Michael Dickens)

Resolution: worksforme
Status: newclosed

The changes moved the cmake files from ${prefix}/lib/cmake to ${prefix}/share/cmake . Both of these directories are searched by cmake -by default- for modules (new-style Find* scripts). We in MP land prefer (for some reason) to install cmake scripts into the latter. Hence the change.

I just installed phonon on a fresh MP 10.11 build. Works fine.

polkit-qt provides its own FindAutomoc4.cmake file which isn't robustly written. It should not rely on cmake scripts being in solely ${prefix} or ${prefix}/lib. In my projects, we use CMAKE_MODULE_PATH (ditto for the cmake PortGroup) -- a separate variable that robustly allows for these files to be anywhere. Removing the FindAutomoc4.cmake and trusting cmake and the files provided by automoc4, all is well again.

A well-written build script will survive these sorts of changes.

I'd much prefer to fix polkit-qt rather than revert something that already works.

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

It seems that your port:phonon version has a patch on the location where external cmake files are expected. If that assessment is correct than my hunch only gets stronger that the automoc patch requires patching more than just 1 port. My version which has what I presume is the previous version of the CMakeLists patch does NOT build. Worse, the configure step fails with errors that do not even indicate clearly what went wrong.

I also don't really like the idea of having to use CMAKE_MODULE_PATH extensively. It's not a Tcl-style variable with -append, -replace and -delete operations; I'm not aware of a CMake feature to add elements to a variable via the commandline rather than (re)setting it.

Installing all cmake files in a dedicated directory is nice but mostly cosmetics. It shouldn't come at the expense of increasing code and maintenance complexity in Portfiles.

Anyway, you're welcome to "fix" polkit-qt ...

comment:4 Changed 9 years ago by michaelld (Michael Dickens)

The phonon I'm building is current to the MP trunk latest revision (140944 right now). I have only rev-bumped it to get the qt4-mac changes (local to my test install). There's nothing else special about it or the PortGroups it's using.

Let me repeat: cmake looks in both ${prefix}/lib/cmake and ${prefix}/share/cmake for files. It does this out of the box, no changes needed by us, and has done so for a long time. Some projects install their cmake files into the former by default, while others choose the latter by default. Some projects easily allow this directory to be selected, while others don't. There is no 'best practices' to the best of my knowledge for which to install into. I do not know why MP has decided to install into the latter; but, we do, and I try my best to honor that setting. From cmake's perspective, it really does not matter. What does matter is when projects assume one setting and ignore the other. That's not good programming & then we have to go in and fix it. Hopefully notify upstream & they fix it too.

I will fix up polkit-qt sometime today, when doing the commits for qt4-mac & qt4-1.0.

Note: See TracTickets for help on using tickets.