Bug 165213 - devel/cmake: Reinplacement of paths in Modules is bad
Summary: devel/cmake: Reinplacement of paths in Modules is bad
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-16 20:40 UTC by Titus von Boxberg
Modified: 2016-01-17 14:28 UTC (History)
2 users (show)

See Also:


Attachments
cmake-port-Makefile.diff.gz (518 bytes, application/x-gzip)
2012-05-05 13:07 UTC, Titus von Boxberg
no flags Details
cmake-port-Makefile.diff (1.19 KB, patch)
2012-05-05 13:56 UTC, Titus von Boxberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Titus von Boxberg 2012-02-16 20:40:09 UTC
Reinplacing paths in cmake's Modules directory is a bad idea:
Especially if using cmake for cross development projects
(which is one of cmake's intended use cases)
it's annoying that standard paths are gone and Find* do not work as expected.

In my case, I need /usr/X11R6 which has been reinplaced by /usr/local.

I don't see why leaving X11R6 in the paths should break something
since that path is present on FreeBSD as well.

Fix: 

I do not know the syntax possible with ${REINPLACE} yet.
For a sed invoked from the command line I'd use e.g.

s,(/usr/X11R6)([^<space><tab>]*),\1\2 ${LOCALBASE}\2,g

to append LOCALBASE instead of replacing X11R6.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-02-16 20:40:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kde

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Titus von Boxberg 2012-05-05 13:07:28 UTC
This patch fixes the problem for the X11R6 and kde4 directories.

Would be nice if the problem could be fixed before cmake 2.8.9
Comment 3 Titus von Boxberg 2012-05-05 13:56:24 UTC
Sorry, here the diff again uncompressed.
Comment 4 Alberto Villa freebsd_committer freebsd_triage 2012-05-05 17:59:59 UTC
I had a quick look at it some time ago, and I remember seeing that the 
solution couldn't be that easy. Breakage is behind the corner. I'll try to 
check it again and see what can be done.
Comment 5 Titus von Boxberg 2012-05-06 10:13:34 UTC
Well, without this patch, it is already crippled/broken...

The regexes in the patch make the right replacement for every unquoted
occurence of the path.

The replacement will surely break when a path to be replaced is enclosed in quotes,
e.g. xxx(... "/usr/X11R6/..." ...)

However, afaics these are not present in the files being searched.
If you want to disable this explicitely then you might add quotes
in the third subexpression of the search regex ([^/A-Za-z0-9_$$-])
so these expressions do not get matched.

For a minimal and clean solution, I'm wondering why it
would not suffice to include ${LOCALBASE}
(or replace /usr/local by ${LOCALBASE})
in CMAKE_SYSTEM_PREFIX_PATH in UnixPaths.cmake ?

And for KDE4, I don't quite get why the replacement is made.
On my system, KDE4 is installed directly in LOCALBASE, so should
get found with the regular SYSTEM_PREFIX paths?

If you could point me to the problem(s) that the original sed replacements
are intended to solve I could dig around to see if a cleaner solution is possible.
Comment 6 Carlo Strub freebsd_committer freebsd_triage 2014-08-29 21:52:13 UTC
back to pool