Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 686510

Summary: net-vpn/wireguard: properly install examples with USE=tools
Product: Gentoo Linux Reporter: Kalin KOZHUHAROV <kalin>
Component: Current packagesAssignee: Jason A. Donenfeld <zx2c4>
Status: RESOLVED WONTFIX    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: wireguard-0.0.20190406.patch

Description Kalin KOZHUHAROV 2019-05-21 20:55:56 UTC
Created attachment 577532 [details, diff]
wireguard-0.0.20190406.patch

Some of the contrib/examples require compilation and that is not possible the way they are installed on gentoo due to missing sources. For example:

# cd /usr/share/doc/wireguard-0.0.20190406/examples/extract-handshakes/
2019-05-21 22:46 sky extract-handshakes $ make
make -C /lib/modules/4.19.40-r11/build M=/usr/share/doc/wireguard-0.0.20190406/examples/extract-handshakes offset-finder.o
make[1]: Entering directory '/usr/src/linux-4.19.40'
/usr/share/doc/wireguard-0.0.20190406/examples/extract-handshakes/Makefile:27: /usr/share/doc/wireguard-0.0.20190406/examples/extract-handshakes/../../../src/crypto/Kbuild.include: No such file or directory
make[2]: *** No rule to make target '/usr/share/doc/wireguard-0.0.20190406/examples/extract-handshakes/../../../src/crypto/Kbuild.include'.  Stop.
make[1]: *** [Makefile:1677: offset-finder.o] Error 2
make[1]: Leaving directory '/usr/src/linux-4.19.40'
make: *** [Makefile:14: offset-finder.o] Error 2

They are missing a few files from the src directory. By just uncompressing WireGuard-0.0.20190406.tar.xz and building, all is fine.

There are 2 ways to solve it:
* [quick] by installing all in src as well, see the attached patch (it is really dirty hack and installs a lot more than needed, e.g. object files

* [proper] USE=tools should compile the tools that need that during src_compile, so that they can be used directly
Comment 1 Jason A. Donenfeld gentoo-dev 2019-12-28 07:56:09 UTC
This is example *code*, not example programs to be used directly.