Red Hat Bugzilla – Bug 1077812
nqp bundles libtommath
Last modified: 2014-04-04 04:21:40 EDT
nqp appears to bundle libtommath which is available as a separate package in Fedora.
$ repoquery --repoid=rawhide-debuginfo -l nqp-debuginfo | grep libtommath
At patched and newer version of NQP is built in rawhide that to not bundle libtommath.
NQP build URL:
A newer version of rakudo-star is built on top of it.
Seems to work, but please note from the link in initial comment,
"Bundled libraries (and/or their source code) must be explicitly deleted during %prep."
The patch adds a flag has-libtommath to Configure.pl. So this solution is better then simple deleting files. The patch is also sent to upstream and I hope it will be applied.
I think this ticket could be closed.
Yes, I looked into how it's done in git. Deleting the bundled needs to be done *in addition* to your patch so that they won't be accidentally used for example if the patch stops working or if detecting/using system tommath fails.
Deleting sources of bundled libraries is a MUST; the packaging guidelines don't leave it up to the packager whether to do it or not.
(In reply to Ville Skyttä from comment #4)
> Deleting the bundled needs
s/the bundled/the bundled library sources/
I have done a deeper look in the configuration. I think the patch that I have written is a good solution. It adds the link option -ltommoth and builds the two objects that are needed.
Deleting files without a patch would only break the build. My patch is simple to maintain and already send to upstream.
Whenever possible, the patching should be done in a way to conditionalize use of the bundled libraries, so that it can be sent upstream for consideration.
The part you quote says "should", and creating an upstream patch is indeed part of a good solution.
But the very same document you link to says very explicitly just before the part you quoted: "Bundled libraries (and/or their source code) must be explicitly deleted during %prep. Build scripts may need to be patched to deal with this situation"
Note that this is a "must", not "should", and I don't think that leaves anything open. If removing the sources breaks the build, you'll need to remove them anyway and make/patch the build succeed with them removed.
I add a 'rm' command in the %prep section that delete the libtommath source files that are not needed to build NQP.
The build is yust runnig:
The result will be se same.
This removes only a subset of the tommath sources, without an explanation why. If some of the files are still needed, I'd say this issue needs more work, or at the very least an explanation in the specfile why all of them cannot be removed.
bn_mp_(get|set)_long.c files are extentions.
I added a comment in the spec file and a comment of the comment.
The commit log is at:
Because it is only an explanation I do not start the rebuild yet.
Looks fine to me.