Skip to content
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

generated .pc files have no prefix information #444

Closed
tho- opened this issue Jun 24, 2013 · 8 comments
Closed

generated .pc files have no prefix information #444

tho- opened this issue Jun 24, 2013 · 8 comments
Assignees

Comments

@tho-
Copy link

tho- commented Jun 24, 2013

Generated .pc files in ros-groovy define no "prefix" variable:
% pkg-config --variable=prefix roslib

%

It is customary to define prefix, includedir, libdir, datadir etc. in .pc files, so that one is able to retrieve this information whenever needed. In ros-fuerte, .pc files were correctly defining these. Was this dropped intentionnaly?

@dirk-thomas
Copy link
Member

In Fuerte and before the variable was mainly used to put together the other relative paths:

prefix=/opt/ros/fuerte
includedir=${prefix}/include
libdir=${prefix}/lib

Name: roscpp
Description: Description of roscpp
Version: 1.8.16
Cflags: -I${includedir}
Libs: -L${libdir} -lroscpp
Requires: cpp_common rostime rosconsole roscpp_serialization roscpp_traits std_msgs rosgraph_msgs xmlrpcpp

Since Groovy the include and library information are build differently and in this step the variables prefix, includedir and libdir where removed. It would be easily possible to readd at least the prefix variable if there is need to provide the information (or that is commonly the case for most .pc files).

For other variables like includedir and libdir it would be problematic since the .pc files might contain Cflags and Libs with various different entries and not only a single folder anymore.

@tho-
Copy link
Author

tho- commented Jun 24, 2013

Well, all the point of a .pc file is to be able to deliver this kind of information :) You can't decide (or know) yourself in advance what a end-user will want, so removing it is going to imped those who need the information with no benefit.
And for that matter, I was using the prefix information ;)

I'd say that most .pc files are based on the same pattern:
% cd /usr/local/lib/pkgconfig
% grep ^prefix= *.pc | wc -l
387
% ls -1 *.pc | wc -l
390

If that's easy (I think it's bascially a matter of a @(CMAKE_INSTALL_PREFIX)), why not add it back, please? :)
Or is there another way to retrieve this information?

@dirk-thomas
Copy link
Member

No, there is no other way to retrieve that information from a package. As mentioned, I can readd the prefix for sure. But likely not the other variables.

http://linux.die.net/man/1/pkg-config mentions that Most packages define the variable "prefix". So to follow that I will readd the prefix in the next release of catkin.

@ghost ghost assigned dirk-thomas Jun 24, 2013
@tho-
Copy link
Author

tho- commented Jun 24, 2013

All right, thanks! I'm fine with re-adding just "prefix" :)

Regarding the other variables, I understand your point and I understand that with the current code it's difficult to compute. But I'm not sure to get the rationale. The .pc file is not supposed to include information regarding the dependencies of a package. It must just contain the information for the package itself. So, for instance for includedir, a package is unlikely to install headers in multiple locations. It will basically install its public header in some place (e.g. $prefix/include/$package), and includedir is just that value (it's thus a bit different from Cflags). Are there any ros packages that scatter their includes among multiple directories?

@dirk-thomas
Copy link
Member

It is only true that a package has a single include folder when it has been installed. Inside the workspace (in the devel space) it might have multiple folders: e.g. one with the hand written header inside the package source folder, one inside the devel space containing generated code of for example messages.

@tho-
Copy link
Author

tho- commented Jun 24, 2013

Mmm... I see. I'm really puzzled with that idea of not installing software ... but ok, this is another topic and this is not the place to discuss it.

Thanks again for the quick replies :)

@tho-
Copy link
Author

tho- commented Jun 25, 2013

Thanks, but "prefix" should be a variable and set with `=', like so:
prefix=@PROJECT_SPACE_DIR

@dirk-thomas
Copy link
Member

Thanks for catching this!

PierrickKoch pushed a commit to PierrickKoch/robotpkg that referenced this issue Feb 21, 2014
This is a major update from 0.4.5 (ros-fuerte) to 0.5.67 (ros-groovy),
featuring a massive rewrite. This version is not compatible with the previous.
See CHANGELOG.rst in the sources for the gory details.

Local patches fix issues regarding .pc files, introducing an incompatibility
with official binarary package until this is merged upstream. See:
 ros/catkin#444
 ros/catkin#445

Another local patch installs env.sh, setup.sh at al. in etc/ros instead of the
root prefix. Their functionality is unchanged, though.

While here, rename the package from catkin to ros-catkin, for consistency with
other ros packages and easier package management from the command line
(e.g. robotpkg_delete ros-\*) or in robotpkg.conf (e.g. PKG_OPTIONS.ros-%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants