Enable Virtualbox guest additions for AARCH64 (#420556)
This commit is contained in:
commit
bc51535691
@ -104,7 +104,7 @@ in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = pkgs.stdenv.hostPlatform.isx86;
|
||||
assertion = pkgs.stdenv.hostPlatform.isx86 || pkgs.stdenv.hostPlatform.isAarch64;
|
||||
message = "Virtualbox not currently supported on ${pkgs.stdenv.hostPlatform.system}";
|
||||
}
|
||||
];
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
virtualboxVersion,
|
||||
virtualboxSubVersion,
|
||||
virtualboxSha256,
|
||||
platform,
|
||||
}:
|
||||
|
||||
let
|
||||
@ -77,13 +78,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
rm -r src/libs/zlib*/
|
||||
'';
|
||||
|
||||
# Apply fix for: https://www.virtualbox.org/ticket/22397
|
||||
patches = lib.optional stdenv.hostPlatform.isAarch64 ./guest-additions-aarch64-fix.patch;
|
||||
|
||||
postPatch = ''
|
||||
set -x
|
||||
sed -e 's@MKISOFS --version@MKISOFS -version@' \
|
||||
-e 's@CXX_FLAGS="\(.*\)"@CXX_FLAGS="-std=c++17 \1"@' \
|
||||
-i configure
|
||||
ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2
|
||||
ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2
|
||||
ls kBuild/bin/linux.${platform}/k* tools/linux.${platform}/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker}
|
||||
|
||||
substituteInPlace ./include/VBox/dbus-calls.h --replace-fail libdbus-1.so.3 ${dbus.lib}/lib/libdbus-1.so.3
|
||||
|
||||
@ -166,11 +169,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
cp -rv ./out/linux.${
|
||||
if stdenv.hostPlatform.is32bit then "x86" else "amd64"
|
||||
}/${buildType}/bin/additions/VBoxGuestAdditions-${
|
||||
if stdenv.hostPlatform.is32bit then "x86" else "amd64"
|
||||
}.tar.bz2 $out/
|
||||
cp -rv ./out/linux.${platform}/${buildType}/bin/additions/VBoxGuestAdditions-${platform}.tar.bz2 $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
@ -16,8 +16,21 @@ let
|
||||
virtualboxSubVersion = "";
|
||||
virtualboxSha256 = "6f9618f39168898134975f51df7c2d6d5129c0aa82b6ae11cf47f920c70df276";
|
||||
|
||||
platform =
|
||||
if stdenv.hostPlatform.isAarch64 then
|
||||
"arm64"
|
||||
else if stdenv.hostPlatform.is32bit then
|
||||
"x86"
|
||||
else
|
||||
"amd64";
|
||||
|
||||
virtualBoxNixGuestAdditionsBuilder = callPackage ./builder.nix {
|
||||
inherit virtualboxVersion virtualboxSubVersion virtualboxSha256;
|
||||
inherit
|
||||
virtualboxVersion
|
||||
virtualboxSubVersion
|
||||
virtualboxSha256
|
||||
platform
|
||||
;
|
||||
};
|
||||
|
||||
# Specifies how to patch binaries to make sure that libraries loaded using
|
||||
@ -54,9 +67,7 @@ stdenv.mkDerivation {
|
||||
pname = "VirtualBox-GuestAdditions";
|
||||
version = "${virtualboxVersion}${virtualboxSubVersion}-${kernel.version}";
|
||||
|
||||
src = "${virtualBoxNixGuestAdditionsBuilder}/VBoxGuestAdditions-${
|
||||
if stdenv.hostPlatform.is32bit then "x86" else "amd64"
|
||||
}.tar.bz2";
|
||||
src = "${virtualBoxNixGuestAdditionsBuilder}/VBoxGuestAdditions-${platform}.tar.bz2";
|
||||
sourceRoot = ".";
|
||||
|
||||
KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
||||
@ -159,6 +170,7 @@ stdenv.mkDerivation {
|
||||
platforms = [
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
broken = stdenv.hostPlatform.is32bit && (kernel.kernelAtLeast "5.10");
|
||||
};
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
diff --git a/configure b/configure
|
||||
index e845993..a5b526e 100644q
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -422,6 +422,10 @@ check_environment()
|
||||
BUILD_MACHINE='sparc32'
|
||||
BUILD_CPU='blend'
|
||||
;;
|
||||
+ aarch64)
|
||||
+ BUILD_MACHINE='arm64'
|
||||
+ BUILD_CPU='blend'
|
||||
+ ;;
|
||||
*)
|
||||
log_failure "Cannot determine system"
|
||||
exit 1
|
||||
Loading…
x
Reference in New Issue
Block a user