fmt
This commit is contained in:
@@ -21,7 +21,6 @@ let
|
||||
version = "2506";
|
||||
|
||||
isAarch64 = stdenv.hostPlatform.system == "aarch64-linux";
|
||||
isX86_64 = stdenv.hostPlatform.system == "x86_64-linux";
|
||||
|
||||
# Always extract x64 binaries (we'll emulate on aarch64)
|
||||
sysArch = "x64";
|
||||
@@ -129,48 +128,46 @@ let
|
||||
|
||||
# Create wrapper scripts for aarch64 that use FEX or muvm
|
||||
# Option 1: Direct FEX execution (simpler, less isolation)
|
||||
fexWrapper = pname: writeShellScript "${pname}-fex-wrapper" ''
|
||||
export FEXINTERPRETER="${fex}/bin/FEXInterpreter"
|
||||
export FEX_ROOTFS="${fex}/share/fex-emu/RootFS"
|
||||
|
||||
# Set up FEX environment
|
||||
export FEX_TSOENABLED=1
|
||||
|
||||
exec ${fex}/bin/FEXBash -c '${omnissaFHSUserEnv pname}/bin/${pname} "$@"' -- "$@"
|
||||
'';
|
||||
fexWrapper =
|
||||
pname:
|
||||
writeShellScript "${pname}-fex-wrapper" ''
|
||||
export FEXINTERPRETER="${fex}/bin/FEXInterpreter"
|
||||
export FEX_ROOTFS="${fex}/share/fex-emu/RootFS"
|
||||
|
||||
# Set up FEX environment
|
||||
export FEX_TSOENABLED=1
|
||||
|
||||
exec ${fex}/bin/FEXBash -c '${omnissaFHSUserEnv pname}/bin/${pname} "$@"' -- "$@"
|
||||
'';
|
||||
|
||||
# Option 2: muvm + FEX (better isolation, handles kernel differences)
|
||||
muvmWrapper = pname: writeShellScript "${pname}-muvm-wrapper" ''
|
||||
# muvm creates a lightweight VM with x86_64 emulation via FEX
|
||||
# This provides better isolation and compatibility
|
||||
|
||||
exec ${muvm}/bin/muvm \
|
||||
--fex \
|
||||
--share-display \
|
||||
--share-sound \
|
||||
-- ${omnissaFHSUserEnv pname}/bin/${pname} "$@"
|
||||
'';
|
||||
muvmWrapper =
|
||||
pname:
|
||||
writeShellScript "${pname}-muvm-wrapper" ''
|
||||
# muvm creates a lightweight VM with x86_64 emulation via FEX
|
||||
# This provides better isolation and compatibility
|
||||
|
||||
exec ${muvm}/bin/muvm \
|
||||
--fex \
|
||||
--share-display \
|
||||
--share-sound \
|
||||
-- ${omnissaFHSUserEnv pname}/bin/${pname} "$@"
|
||||
'';
|
||||
|
||||
# Select the appropriate wrapper based on configuration
|
||||
aarch64Wrapper = pname:
|
||||
if useMusvm
|
||||
then muvmWrapper pname
|
||||
else fexWrapper pname;
|
||||
aarch64Wrapper = pname: if useMusvm then muvmWrapper pname else fexWrapper pname;
|
||||
|
||||
# Final wrapper that handles both architectures
|
||||
universalWrapper = pname:
|
||||
if isAarch64
|
||||
then aarch64Wrapper pname
|
||||
else "${omnissaFHSUserEnv pname}/bin/${pname}";
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "horizon-client";
|
||||
desktopName = "Omnissa Horizon Client";
|
||||
icon = "${omnissaHorizonClientFiles}/share/icons/horizon-client.png";
|
||||
exec = "${
|
||||
if isAarch64
|
||||
then aarch64Wrapper mainProgram
|
||||
else "${omnissaFHSUserEnv mainProgram}/bin/${mainProgram}"
|
||||
if isAarch64 then
|
||||
aarch64Wrapper mainProgram
|
||||
else
|
||||
"${omnissaFHSUserEnv mainProgram}/bin/${mainProgram}"
|
||||
} %u";
|
||||
mimeTypes = [
|
||||
"x-scheme-handler/horizon-client"
|
||||
@@ -192,19 +189,24 @@ stdenv.mkDerivation {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
|
||||
${if isAarch64 then ''
|
||||
# On aarch64, create wrapper scripts that use FEX/muvm
|
||||
cp ${aarch64Wrapper "horizon-client"} $out/bin/horizon-client
|
||||
chmod +x $out/bin/horizon-client
|
||||
cp ${aarch64Wrapper "omnissa-usbarbitrator"} $out/bin/omnissa-usbarbitrator
|
||||
chmod +x $out/bin/omnissa-usbarbitrator
|
||||
'' else ''
|
||||
# On x86_64, use native FHS environment directly
|
||||
ln -s ${omnissaFHSUserEnv "horizon-client"}/bin/horizon-client $out/bin/
|
||||
ln -s ${omnissaFHSUserEnv "omnissa-usbarbitrator"}/bin/omnissa-usbarbitrator $out/bin/
|
||||
''}
|
||||
|
||||
|
||||
${
|
||||
if isAarch64 then
|
||||
''
|
||||
# On aarch64, create wrapper scripts that use FEX/muvm
|
||||
cp ${aarch64Wrapper "horizon-client"} $out/bin/horizon-client
|
||||
chmod +x $out/bin/horizon-client
|
||||
cp ${aarch64Wrapper "omnissa-usbarbitrator"} $out/bin/omnissa-usbarbitrator
|
||||
chmod +x $out/bin/omnissa-usbarbitrator
|
||||
''
|
||||
else
|
||||
''
|
||||
# On x86_64, use native FHS environment directly
|
||||
ln -s ${omnissaFHSUserEnv "horizon-client"}/bin/horizon-client $out/bin/
|
||||
ln -s ${omnissaFHSUserEnv "omnissa-usbarbitrator"}/bin/omnissa-usbarbitrator $out/bin/
|
||||
''
|
||||
}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
@@ -221,7 +223,10 @@ stdenv.mkDerivation {
|
||||
description = "Allows you to connect to your Omnissa Horizon virtual desktop";
|
||||
homepage = "https://www.omnissa.com/products/horizon-8/";
|
||||
license = licenses.unfree;
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
maintainers = with maintainers; [ mhutter ];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user