Subject: [bug#39961] traceroute

From: Christopher Baines <[email-masked]>
Date: Fri, 01 Jan 2021 12:08:01 +0000

Vincent Legoll <[email-masked]> writes:

> ping ?
> Anything I should add ?

This traceroute implementation looks to be particularly difficult to
build, just searching the web for some of the errors brings up other
people having problems with it (like [1]).

1: https://patchwork.ozlabs.org/project/buildroot/patch/[email-masked]/

Some comments though, I'd suggest transforming what you're doing with
make flags from modifying the phases to adding to the #:make-flags
argument, so something like this:

       #:make-flags
       (list (string-append "LIBRARY_PATH="
                            (assoc-ref %build-inputs "libc")
                            "/lib")
             (string-append "CFLAGS=-I"
                            (assoc-ref %build-inputs "kernel-headers")
                            "/include")
             "LDFLAGS=-lm -L../libsupp"
             (string-append "prefix=" (assoc-ref %outputs "out")))

What I've also done here is used the %build-inputs alist, which includes
the implicit libc and kernel-headers inputs, so you can remove those
inputs from the package definition.

As for the -lm issue with the Makefile, that's pretty frustrating. The
best thing I could come up with is something like this:

             (substitute* "default.rules"
               ((" \\$\\(LIBDEPS\\)") "$(filter-out -l%,$(LIBDEPS))"))

That has the advantage of still passing the -lm flag to gcc, and just
avoiding make tripping up over it.

Finally, I think the license might be gpl2+, with lgpl2.1+ for libsupp,
so it would be good to list both of those, with a comment describing
what the lgpl license applies to.

Could you send an updated patch?

Thanks,

Chris