GNOME Bugzilla – Bug 607627
gjs-1.0.pc adds unnecessary libmozjs linkage to client apps
Last modified: 2016-11-29 05:16:38 UTC
Created attachment 151912 [details] [review] Move @JS_PACKAGE@ to Requires.private gjs-1.0.pc.in has a Requires on @JS_PACKAGE@, but users of libgjs don't actually need any of the symbols from libmozjs.so. Moving @JS_PACKAGE@ to Requires.private means that pkg-config --cflags gjs-1.0 will add mozilla-js's CFLAGS, which clients need, but pkg-config --libs gjs-1.0 will not include -lmozjs. Since Mozilla don't support libmozjs as a system library, causing unnecessary dependencies on it is annoying for packagers. The attached trivial patch moves @JS_PACKAGE@ to Requires.private. For added security, a Requires on pkg-config >= 0.22 is added, as this the version of pkg-config (from 2007) which correctly supports CFLAGS from Requires.private (Blog post from the pkg-config maintainer describing the behaviour of Requires.private http://err.no/personal/blog/tech/2008-03-25-18-07_pkg-config,_sonames_and_Requires.private )
This is obsolete, libmozjs is now in Requires.private already. Thanks for the patch anyway and sorry no-one committed it 7 years ago!