-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check GMT_DOC_DIR if SHAREDIR fails #1964
Conversation
We configured but never used GMT_DOC_DIR. This PR does and should address #1960.
Doesn't work. See the line 2 below.
|
So line two:
is the result of
Thus GMT_DOC_DIR when brew configures things is
which is not too surprising given the config.h.in statement
It sounds like this one simply must be
|
We probably need to check if GMT_DOCDIR is given as an absolute path (like in homebrew) or a relative path (like the GMT default path). |
Yes, so when I just build in a local build dir parallel to src I have it install in build/gmt6/{bin, lib,..} so then GMT_DOC_DIR is "share/doc" and the @CMAKE_INSTALL_PREFIX@/@GMT_DOCDIR@ is what I need. As for config.h it has
so maybe try both GMT_DOC_DIR and GMT_SHARE_DIR? |
src/config.h.in
Outdated
@@ -51,7 +51,7 @@ | |||
#define GMT_BINARY_DIR_SRC_DEBUG "@GMT_BINARY_DIR@/src" | |||
|
|||
/* path to documentation */ | |||
#define GMT_DOC_DIR "@CMAKE_INSTALL_PREFIX@/@GMT_DOCDIR@" | |||
#define GMT_DOC_DIR "@GMT_DOCDIR@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused here. Does it mean @GMT_DOCDIR@
must be an absolute path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the way it was (line two above) you got two hard paths added together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but if someone gives GMT_DOCDIR a relative path, then GMT_DOC_DIR
is also a relative path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I can put it back to what it was but then we get line 2 for brew.
We could add a GMT_INTALLDIR="@CMAKE_INSTALL_PREFIX@" to config.h to have a separate parameter for that, but I guess I don't understand exactly how the package managers are specifying things like doc dir, i.e., relative (to what?) or absolute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Homebrew uses -DGMT_DOCDIR=#{share}/doc/gmt
. I don't know exactly what #{share}
means in homebrew, but probably homebrew should use -DGMT_DOCDIR=share/doc/gmt
, which is relative to ${CMAKE_INSTALL_PREFIX}
.
In gmt/cmake/ConfigUserTemplate.cmake Lines 67 to 71 in 816825d
However, it seems we assume that these paths must be relative paths, e.g. Lines 36 to 42 in 816825d
|
Would the brew guy know? |
https://docs.brew.sh/Formula-Cookbook#variables-for-directory-locations It seems |
OK with me. So leave my changes to config.h.in then (removing the INSTALL PREFIX)? |
The change to config.h.in should be reverted. |
You mean it should be what it was, i.e.,
|
Yes, all the path settings in |
@claudiodsf I made some changes to the homebrew recipe (attached here gmt.rb.zip).
Then I reinstalled GMT with |
I confirm that it now works and that the new formula has the same installation tree than the previous one. |
@claudiodsf Not sure when we'll release 6.0.1. Since "gmt docs" is the main new feature in GMT6, and many macOS users use homebrew, I suggest applying the two patches I mentioned before and bumping the homebrew revision number (i.e. 6.0.0-1). |
Ok, I submitted the PR with version bump to homebrew-core: Homebrew/homebrew-core#46231 |
While we configured GMT_DOC_DIR it was never used. Now it is, and hopefully this PR addresses #1960.