Created attachment 329880 [details] virtualbox-4-enable-tools.diff vditool and vbox-img are useful tools in the virtualbox source tree for advanced disk image manipulation. Upstream landed this patch https://www.virtualbox.org/changeset/43851/vbox Which adds support for building vbox-img and vditool even if you're not doing the test suite, and it would be nice to be able to have these tools available. I managed to patch the respective files with a modified .ebuild and .diff However, once I managed to do this I got a compile error compiling vbox-img that I don't know enough to debug /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lz /var/tmp/portage/app-emulation/virtualbox-4.2.4-r2/work/VirtualBox-4.2.4/out/linux.amd64/release/lib/RuntimeR3.a(fs3-posix.o): In function `rtFsObjInfoAttrSetUnixGroup': /var/tmp/portage/app-emulation/virtualbox-4.2.4-r2/work/VirtualBox-4.2.4/src/VBox/Runtime/r3/posix/fs3-posix.cpp:80: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /var/tmp/portage/app-emulation/virtualbox-4.2.4-r2/work/VirtualBox-4.2.4/out/linux.amd64/release/lib/RuntimeR3.a(fs3-posix.o): In function `rtFsObjInfoAttrSetUnixOwner': /var/tmp/portage/app-emulation/virtualbox-4.2.4-r2/work/VirtualBox-4.2.4/src/VBox/Runtime/r3/posix/fs3-posix.cpp:58: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking INST VBoxTunctl => {C}/out/linux.amd64/release/bin/VBoxTunctl LD VBoxDDR0 --- /usr/portage/app-emulation/virtualbox/virtualbox-4.2.4-r1.ebuild 2012-11-13 07:19:52.000000000 +1300 +++ /usr/portage/app-emulation/virtualbox/virtualbox-4.2.4-r2.ebuild 2012-11-19 08:43:08.643967319 +1300 @@ -26,7 +26,7 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="+additions alsa doc extensions headless java pam pulseaudio +opengl python +qt4 +sdk vboxwebsrv vnc" +IUSE="+additions alsa doc extensions headless java pam pulseaudio +opengl python +qt4 +sdk vboxwebsrv vnc tools" RDEPEND="!app-emulation/virtualbox-bin ~app-emulation/virtualbox-modules-${PV} @@ -172,6 +172,9 @@ EPATCH_SUFFIX="patch" \ EPATCH_FORCE="yes" \ epatch "${WORKDIR}/patches" + if use tools; then + epatch "${FILESDIR}"/${PN}-4-enable-tools.diff + fi } src_configure() {
I need some time to look into this more closely. I am definitely interested in this enhancement but I currently lack enough time to test this thoroughly for inclusion into the portage tree.
Created attachment 360074 [details, diff] patch against virtualbox-4.2.18.ebuild for extra tools Apparently these tools are being built as statically linked, so that's what your previous failure was about. I've added the proper zlib[static-libs] dep and converted to inline sed instead of a separate patch, give this a try if you can. The new tools seem to build/install/run fine here.
Some updates from upstream: vditool was removed upstream some 3 months ago. https://www.virtualbox.org/log/vbox/trunk/src/VBox/Storage/testcase/vditool.cpp?rev=58658&mode=path_history vbox-img is still persent https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Storage/testcase/vbox-img.cpp
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b61b9f265ffdba5cb6bef51d49a86c2e077416c2 commit b61b9f265ffdba5cb6bef51d49a86c2e077416c2 Author: Viorel Munteanu <ceamac@gentoo.org> AuthorDate: 2022-11-08 17:36:37 +0000 Commit: Viorel Munteanu <ceamac@gentoo.org> CommitDate: 2022-11-20 08:16:37 +0000 app-emulation/virtualbox: add 7.0.4 Add vbox-img, a tool that comes with virtualbox but was not being compiled Closes: https://bugs.gentoo.org/443830 Signed-off-by: Viorel Munteanu <ceamac@gentoo.org> app-emulation/virtualbox/Manifest | 1 + .../files/virtualbox-7.0.4-fix-compilation.patch | 26 + app-emulation/virtualbox/virtualbox-7.0.4.ebuild | 689 +++++++++++++++++++++ 3 files changed, 716 insertions(+)