On 11/07/2022 05:17, Xi Shen wrote:

I am trying to create an ebuild file for https://github.com/NVIDIA/libnvidia-container <https://github.com/NVIDIA/libnvidia-container>. It has a few other dependencies which will be built by itself.

Such an ebuild already exists in the ::guru overlay (maintainer in CC). I see it is one version behind though. Feel free to bump it to the latest version if you want, probably a simple copy and renaming of the ebuild will do the trick.

My ebuild can download and compile those dependencies. But one of the dependency "libtirpc-1.3.2" needs to install itself in the temporary portage environment. Its Makefile allows me to pass in the "DESTDIR" variable which I passed in "/var/tmp/portage/sys-libs/libnvidia-container-1.10.0/work/libnvidia-container-1.10.0/deps", but when it installs, the package is installed to "/var/tmp/portage/sys-libs/libnvidia-container-1.10.0/work/libnvidia-container-1.10.0/deps/var/tmp/portage/sys-libs/libnvidia-container-1.10.0/work/libnvidia-container-1.10.0/deps/usr/local", the working director got repeated after the "deps" directory.

I checked the makefile, but could not figure out where that path got replicated. I guess when running inside the portage build environment, there's some "chroot" trick that prevents packages from writing the root file system.

So I want to ask if I need to do a "make install" during compilation, how should I pass the destination directory?

Don't try to install things to the installation directory (${ED}) during the compile phase. If you really have something that insists on being installed somewhere to complete the compilation, then install it to some temporary directory, e.g. ${T} and then if necessary copy it from the temporary directory into the installation directory during the install phase. The ebuild in ::guru seems to solve your problem with a bunch of patches, which I think is a better solution.

Best regards,

Reply via email to