Page MenuHomeFreeBSD

Add pathfix support for CMake
ClosedPublic

Authored by jhale on Sep 26 2014, 8:49 PM.

Details

Summary

Add support for CMake substitutions to USES=pathfix

CMake projects mostly have trouble with where to put pkgconfig data, so I've added some of the most popular cases to substitute for. There are a few projects that use some custom variables that I did not add, but if there are more generic substitutions that should be added to the list, I'm open to suggestions.

Special note for devel/libical:
I got rid of the useless dependency on gmake and a patch for configure (it uses CMake)

Test Plan

I have tested with several CMake projects and non-CMake projects to check for regression. For any port that had cmake and pathfix already in USES (unnecessarily, I might add), I have fixed to make sure there is no double substitution. Some ports I removed pathfix from altogether because they handled pkgconfig data in a different manner and pathfix was totally pointless then and now.

The only bug I have found is that pathfix must come after cmake in the USES list and I have fixed those cases as well. (Should not be an issue now with latest diff).

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhale retitled this revision from to Add pathfix support for CMake.Sep 26 2014, 8:49 PM
jhale updated this object.
jhale edited the test plan for this revision. (Show Details)
jhale added a reviewer: portmgr.
jhale set the repository for this revision to rP FreeBSD ports repository.
jhale added subscribers: gnome, kde.
jhale updated this revision to Diff 1795.
antoine added inline comments.
Mk/Uses/pathfix.mk
19 ↗(On Diff #1795)

PATHFIX_CMAKELISTSTXT or PATHFIX_CMAKELISTS ?

23 ↗(On Diff #1795)

this doesn't look good
maybe this should be .if ${USES:Mcmake*} ?

jhale added inline comments.Sep 26 2014, 9:21 PM
Mk/Uses/pathfix.mk
19 ↗(On Diff #1795)

Yeah, I could see maybe PATHFIX_CMAKELISTSTXT being better.

23 ↗(On Diff #1795)

Good point. That would probably take care of the order bug.

jhale edited the test plan for this revision. (Show Details)Sep 26 2014, 9:32 PM
jhale updated this revision to Diff 1799.

Add fixes suggested by antoine:

  • Rename PATHFIX_CMAKE -> PATHFIX_CMAKELISTSTXT
  • Test for ${USES:Mcmake*} instead of _INCLUDE_USES_CMAKE_MK
tijl edited edge metadata.Sep 27 2014, 11:32 AM

I don't know if it should be done now, but over time I think it's best to move all the pkgconfig fixes to USES=pkgconfig such that all the complexity of dealing with pkgconfig is contained there. Then ports that use pkgconfig only need USES=pkgconfig and it'll just work while now if you see that pkgconfig is involved you need to think about whether you really need USES=pkgconfig or if USES=pathfix is enough or maybe you need both.

In D850#12, @tijl wrote:

I don't know if it should be done now, but over time I think it's best to move all the pkgconfig fixes to USES=pkgconfig such that all the complexity of dealing with pkgconfig is contained there. Then ports that use pkgconfig only need USES=pkgconfig and it'll just work while now if you see that pkgconfig is involved you need to think about whether you really need USES=pkgconfig or if USES=pathfix is enough or maybe you need both.

The problem with that is that many ports using CMake don't even use pkgconfig to build, but may just install a pkgconfig file (albeit in the wrong place) and need a fix.

For autotools, pathfix corrects more than the pkgconfig file location too. My vote would be to keep them separate.

bapt added a reviewer: bapt.Nov 22 2014, 1:39 PM
bapt accepted this revision.
This revision is now accepted and ready to land.Nov 22 2014, 1:39 PM
This revision was automatically updated to reflect the committed changes.