Per upstream FAQ [1], Google Test should not be shipped as a library, but instead as a set of source files that can be built with the correct CXXFLAGS. The standard location for this seems to be /usr/src/gtest/, with the important file under that as src/gtest-all.cc. On Debian, it is necessary to -I/usr/src/gtest/ to make the includes work, but Arch does some method of combining all the contents to actually be in that single file. After a period of compatibility, the shared library should be removed. [1] http://code.google.com/p/googletest/wiki/FAQ#Why_is_it_not_recommended_to_install_a_pre-compiled_copy_of_Goog
Yes, you are absolutely right. I'll try to look into this soon. Please stay tuned (or even better, come up with an ebuild yourself).
Created attachment 351792 [details, diff] diff for ebuild to add install of sources. Does not remove binaries yet. I created this based on the Arch packaging [1]; I couldn't make sense of the Debian packaging. This is enough to make my software's tests build. In this patch, I only add the installation of the sources. I'm wary of how removing will interact with the multi-abi thing (which will no longer be needed I think). [1] https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/gtest
Oh, and I've pushed this to my personal overlay, 'o11c' in layman. I'm not *actually* sure if (long term) we need anything but the 3 files in fused-src/
What do you think about the following src_install() { if use examples ; then insinto /usr/share/doc/${PF}/examples doins samples/*.{cc,h} fi doheader -r include/* insinto /usr/src/gtest doins CMakeLists.txt doins -r cmake insinto /usr/src/gtest/src doins fused-src/gtest/* } That would basically be the entirety of the new ebuild. No binaries will be shipped. As you can see, headers go into /usr/include and fused sources (yes you are right, the three files contain everything) go into /usr/src/gtest/src Users of gtest can no follow the README more or less verbatim. Maybe we should document these paths somewhere in elog messages? Could you please test if that works for your use case?
With a little modification, that works. Note that I don't use cmake, but just build the sole object file directly [1]. Full working ebuild is at [2], including ewarn, dodoc, and disabling the default src_configure and src_compile. A quick rgrep shows just one package, app-i18n/mozc, depending on gtest in a suspicious way. However, changes will probably be needed in many other packages when they are built with USE=test, so there should probably be a tracker once this is pushed as -r3 (it's still -r2 in my overlay to keep diffs sane). At some point in the distant future when all current ebuilds go away, you will need to remove the files/ [1] https://github.com/themanaworld/tmwa/blob/test/Makefile [2] https://github.com/o11c/ebuilds/blob/master/dev-cpp/gtest/gtest-1.6.0-r2.ebuild
OK, the discussion on dev wasn't very conclusive. http://thread.gmane.org/gmane.linux.gentoo.devel/86486 On second thought, I agree that installing the sources is strange. If packages need sources, their ebuilds should just download them. There is no benefit to outsource them to a package. I tend to agree that gtest could be treecleaned, but that would be just breaking stuff that is working at the moment. Consequently, I'll just do nothing. Thanks for your input, though.