init project
This commit is contained in:
5
Library/PackageCache/com.unity.sysroot@2.0.10/.signature
Executable file
5
Library/PackageCache/com.unity.sysroot@2.0.10/.signature
Executable file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"timestamp": 1707420538,
|
||||
"signature": "RbR328o1RMEj6o8+QkTaRT1Vn8vz4h38cua7JWTMO4wdh4sWDHgBjHhaHBe0IvvYnvu/pPFmHKwk6p0sC1K3IFtgIImKWIayTZWe/q2wPmMcMyeeeTG7K2EVVtSL+NHfiZIY7HW9xWiW+OXPrcYpApTIvdu/z8jFQnIt0+/ZSxomUPNEaQsanGm0AS8HFDYb96vthdV38H5A35hxIygZM6bMPF86/NmuomnszgGZxDGbBcVgFsJGM3G3RDQxoc9dzPgn0nHLtMvsJkRjhqssRhVMpN1cQ1wZMX5ENBLbH/mj9yTH7InUaQpo1FCmSbZwFZ3DIOsOb3yXGCeUddHJogUi9TUJ23a71eJbwu1x2eFIDxVQh+d4053MgcJdeotxuggtUPkl2iptCJHMw/y9Xvvd3d0NHI88wLVw1avlO7e8bp0PUtl2NUIpks2ewnnSAAvZCl1hJabO2C8V5SZD0OGbRteKs4qe54zKMp1GnFrWaNCxpAthJa25K0KFzdP4",
|
||||
"publicKey": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"
|
||||
}
|
||||
128
Library/PackageCache/com.unity.sysroot@2.0.10/CHANGELOG.md
Normal file
128
Library/PackageCache/com.unity.sysroot@2.0.10/CHANGELOG.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# Changelog
|
||||
All notable changes to this package will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.0.10] - 2024-02-02
|
||||
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.9] - 2024-01-12
|
||||
Updated LICENSE.md
|
||||
|
||||
## [2.0.8] - 2023-12-21
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.7] - 2023-07-17
|
||||
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.6] - 2023-05-03
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.5] - 2022-11-24
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.4] - 2022-10-31
|
||||
add support for new IL2CPP arguments APIs for 2022.1.23f1+ editors
|
||||
|
||||
## [2.0.3] - 2022-05-23
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.2] - 2022-04-27
|
||||
bump version number to publish
|
||||
|
||||
## [2.0.1] - 2022-04-06
|
||||
- Add support for new IL2CPP arguments APIs for EmbeddedLinux
|
||||
|
||||
## [2.0.0] - 2022-03-28
|
||||
- Fix 1336012 - Build from windows fails if username contains space
|
||||
- Add support for new IL2CPP arguments APIs
|
||||
|
||||
## [1.0.0] - 2021-12-15
|
||||
label as released package
|
||||
|
||||
## [0.1.20] - 2021-11-24
|
||||
EmbeddedLinux support
|
||||
|
||||
## [0.1.19] - 2021-02-22
|
||||
reduce log spew
|
||||
|
||||
## [0.1.18] - 2021-01-11
|
||||
|
||||
improve diagnostics
|
||||
handle space in path
|
||||
|
||||
## [0.1.17] - 2020-11-24
|
||||
|
||||
removed win symlink code
|
||||
|
||||
## [0.1.16] - 2020-11-09
|
||||
|
||||
change NiceIO namespace to prevent conflicts
|
||||
|
||||
## [0.1.15] - 2020-10-26
|
||||
|
||||
fixed issue where NiceIO would conflict with other packages using it
|
||||
added enviorment variable UNITY_SYSROOT_DEBUG that will enable extra debug logging
|
||||
|
||||
## [0.1.14] - 2020-09-23
|
||||
|
||||
fix redir of cache directory
|
||||
|
||||
## [0.1.13] - 2020-09-22
|
||||
|
||||
allow redir of cache directory
|
||||
|
||||
## [0.1.12] - 2020-08-08
|
||||
|
||||
do not popup command windows on windows
|
||||
|
||||
## [0.1.11] - 2020-07-26
|
||||
|
||||
fix playbackengine check
|
||||
|
||||
## [0.1.10] - 2020-07-20
|
||||
|
||||
only warn about missing LinuxStandalone
|
||||
|
||||
## [0.1.9] - 2020-07-15
|
||||
|
||||
handle case where LinuxStandalone is not present
|
||||
|
||||
## [0.1.8] - 2020-05-27
|
||||
|
||||
documentation
|
||||
|
||||
## [0.1.7] - 2020-05-25
|
||||
|
||||
fix regression
|
||||
|
||||
## [0.1.6] - 2020-05-24
|
||||
|
||||
Reorganization
|
||||
|
||||
## [0.1.5] - 2020-05-21
|
||||
|
||||
Quote paths
|
||||
|
||||
## [0.1.4] - 2020-04-29
|
||||
|
||||
Include 7z binaries
|
||||
|
||||
## [0.1.3] - 2020-04-27
|
||||
|
||||
Cleanup
|
||||
|
||||
## [0.1.2] - 2020-04-25
|
||||
|
||||
Use latest sysroot and toolchains
|
||||
|
||||
## [0.1.1] - 2020-04-01
|
||||
|
||||
Fix platform specific issues, add support fo OSX and Windows cross-compilation
|
||||
|
||||
## [0.1.0] - 2020-02-13
|
||||
|
||||
Initial release
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6903637d170abe311a972b9d76142805
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 349 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 154 KiB |
@@ -0,0 +1,53 @@
|
||||
# Unity IL2CPP Build Support for Linux
|
||||
|
||||
Support for Linux players using IL2CPP is available from 2019.4 onwards.
|
||||
|
||||
Operating systems (OS) have their own build systems which vary from one another. If you build using the headers and libraries on a particular OS, this might result in the built player not running on a different one. To address this, Unity provides a sysroot to build against which works on all supported Linux platforms.
|
||||
|
||||
The sysroot also allows cross-compilation support which enables you to build Linux IL2CPP from Linux, macOS and Windows.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To use the following packages, you need to install the Linux Build Support (IL2CPP) module in your Unity Editor version. Use the Unity Hub to do this. For further information, see [Adding Modules to the Unity Editor](https://docs.unity3d.com/2021.2/Documentation/Manual/GettingStartedAddingEditorComponents.html).
|
||||
|
||||
## Unity toolchain packages
|
||||
|
||||
Unity provides a toolchain package, which installs the sysroot and a toolchain, for building binaries for the target. The naming convention for these packages is:
|
||||
|
||||
* _host platform and architecture_
|
||||
* _target platform and architecture_
|
||||
|
||||
If the host platform and architecture are the same as the target platform and architecture, shorten the name to platform and architecture.
|
||||
|
||||
## Installing a Unity toolchain package
|
||||
|
||||
To install a Unity toolchain package:
|
||||
1. Go to **Window** > **Package Manager**.
|
||||
2. Use the search bar to find the package, and click **Install** in the bottom right corner of the Package Manager window.
|
||||
3. Choose the package based on the host platform.
|
||||
|
||||
| Host | Package |
|
||||
| ------- | ---------------------------------------- |
|
||||
| Linux | com.unity.toolchain.linux-x86_64 |
|
||||
| macOS | com.unity.toolchain.macos-x86_64-linux-x86_64 |
|
||||
| Windows | com.unity.toolchain.windows.x86_64-linux-x86_64 |
|
||||
|
||||

|
||||
|
||||
## Using a Unity toolchain package:
|
||||
|
||||
When you have installed your toolchain package, go to **Project Settings** > **Player** > **Configuration** and set the **ScriptingBackend** to **IL2CPP**.
|
||||
|
||||

|
||||
|
||||
To build your project:
|
||||
1. Go to **File** > **Build Settings**.
|
||||
2. In the **Target Platform** dropdown menu, select **Linux**.
|
||||
3. Click **Build** or **Build and Run**.
|
||||
|
||||
## Technical Details
|
||||
|
||||
Requirements:
|
||||
|
||||
- Unity version 2019.4.1f1
|
||||
- Linux Build Support (IL2CPP) module
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 169765632ffb0f87cb8b3c23abe48007
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("756dc4d8-8ba5-4416-9c4f-d29f993629fe")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
[assembly: InternalsVisibleTo("Unity.Sysroot.Linux_x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Win-x86_64-Linux-x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Win-arm64-Linux-x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Macos-x86_64-Linux-x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Macos-arm64-Linux-x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Linux-x86_64-WebGL")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Linux-x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Sdk.EmbeddedLinux_aarch64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Sdk.EmbeddedLinux_x86_64")]
|
||||
[assembly: InternalsVisibleTo("Unity.Sdk.EmbeddedLinux_arm32")]
|
||||
[assembly: InternalsVisibleTo("Unity.Sdk.EmbeddedLinux_x86")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Macos-x86_64-EmbeddedLinux")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Macos-arm64-EmbeddedLinux")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Win-x86_64-EmbeddedLinux")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Win-arm64-EmbeddedLinux")]
|
||||
[assembly: InternalsVisibleTo("Unity.Toolchain.Linux-x86_64-EmbeddedLinux")]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8687db4f8d1c4354eae1e66a957cba30
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1883
Library/PackageCache/com.unity.sysroot@2.0.10/Editor/NiceIO.cs
Normal file
1883
Library/PackageCache/com.unity.sysroot@2.0.10/Editor/NiceIO.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62e4a7846c9ce998f972153a5182676a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Unity.SysrootPackage.Editor",
|
||||
"references": [
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "Unity",
|
||||
"expression": "(0,2022.1.23f1)",
|
||||
"define": "IL2CPP_LEGACY_API_PRESENT"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 435a4e0ece4e23c4882730a295bbd8cd
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
361
Library/PackageCache/com.unity.sysroot@2.0.10/Editor/Unity.SysrootPackage.cs
Executable file
361
Library/PackageCache/com.unity.sysroot@2.0.10/Editor/Unity.SysrootPackage.cs
Executable file
@@ -0,0 +1,361 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEditorInternal;
|
||||
using UnityEditor;
|
||||
using NiceIO.Sysroot;
|
||||
#if UNITY_STANDALONE_LINUX_API
|
||||
using UnityEditor.LinuxStandalone;
|
||||
#endif
|
||||
#if UNITY_EMBEDDED_LINUX_API
|
||||
using UnityEditor.EmbeddedLinux;
|
||||
#endif
|
||||
|
||||
namespace UnityEditor.Il2Cpp
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Describe a payload location and destination
|
||||
/// </summary>
|
||||
public struct PayloadDescriptor
|
||||
{
|
||||
/// <summary>
|
||||
/// Path of payload tarball
|
||||
/// </summary>
|
||||
internal NPath path;
|
||||
/// <summary>
|
||||
/// Path directory where payload is to be installed
|
||||
/// </summary>
|
||||
internal NPath dir;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialization status
|
||||
/// </summary>
|
||||
enum InitializationStatus
|
||||
{
|
||||
Uninitialized,
|
||||
Failed,
|
||||
Succeeded
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for sysroot and toolchain packages
|
||||
/// </summary>
|
||||
public class SysrootPackage
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
: Sysroot
|
||||
#endif
|
||||
{
|
||||
private static bool IsLinuxIL2CPPPresent()
|
||||
{
|
||||
string targetDir = $"{BuildPipeline.GetPlaybackEngineDirectory(BuildTargetGroup.Standalone, BuildTarget.StandaloneLinux64, BuildOptions.None)}/Variations/il2cpp";
|
||||
if (Directory.Exists(targetDir))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ShouldLogDebugMessage()
|
||||
{
|
||||
return !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("UNITY_SYSROOT_DEBUG"));
|
||||
}
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
private static void IssueWarningIfLinuxIL2CPPNotPresent()
|
||||
{
|
||||
if (ShouldLogDebugMessage() && !IsLinuxIL2CPPPresent())
|
||||
{
|
||||
UnityEngine.Debug.LogWarning($"Linux Compiler Toolchain package(s) present, but required Linux-IL2CPP is missing");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Name of package
|
||||
/// </summary>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string Name => "com.unity.sysroot";
|
||||
|
||||
/// <summary>
|
||||
/// Name of host platform (linux, win, macos)
|
||||
/// </summary>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string HostPlatform => "";
|
||||
|
||||
/// <summary>
|
||||
/// Name of host architecture
|
||||
/// </summary>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string HostArch => "";
|
||||
|
||||
/// <summary>
|
||||
/// Name of target platform (linux, win, macos)
|
||||
/// </summary>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string TargetPlatform => "";
|
||||
|
||||
/// <summary>
|
||||
/// Name of target architecture
|
||||
/// </summary>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string TargetArch => "";
|
||||
|
||||
/// <summary>
|
||||
/// Supplies arguments to il2cpp.exe
|
||||
/// </summary>
|
||||
/// <returns>Next argument to il2cpp.exe</returns>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
IEnumerable<string> GetIl2CppArguments() { return null; }
|
||||
|
||||
#if !IL2CPP_LEGACY_API_PRESENT
|
||||
/// <summary>
|
||||
/// Supplies sysroot argument to il2cpp.exe
|
||||
/// </summary>
|
||||
/// <returns>Next argument to il2cpp.exe</returns>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string GetSysrootPath() { return null; }
|
||||
|
||||
/// <summary>
|
||||
/// Supplies toolchain path argument to il2cpp.exe
|
||||
/// </summary>
|
||||
/// <returns>Next argument to il2cpp.exe</returns>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string GetToolchainPath() { return null; }
|
||||
|
||||
/// <summary>
|
||||
/// Supplies compiler flags argument to il2cpp.exe
|
||||
/// </summary>
|
||||
/// <returns>Next argument to il2cpp.exe</returns>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string GetIl2CppCompilerFlags() { return null; }
|
||||
|
||||
/// <summary>
|
||||
/// Supplies linker flags argument to il2cpp.exe
|
||||
/// </summary>
|
||||
/// <returns>Next argument to il2cpp.exe</returns>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
string GetIl2CppLinkerFlags() { return null; }
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Name of payload tarball
|
||||
/// </summary>
|
||||
protected string Payload => "payload.tar.7z";
|
||||
|
||||
private List<PayloadDescriptor> _payloads = new List<PayloadDescriptor>();
|
||||
private InitializationStatus _initStatus = InitializationStatus.Uninitialized;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize package
|
||||
/// </summary>
|
||||
/// <returns>Success or failure of initialization</returns>
|
||||
public
|
||||
#if UNITY_STANDALONE_LINUX_API || UNITY_WEBGL_API || UNITY_EMBEDDED_LINUX_API
|
||||
override
|
||||
#else
|
||||
virtual
|
||||
#endif
|
||||
bool Initialize()
|
||||
{
|
||||
if (_initStatus != InitializationStatus.Uninitialized)
|
||||
return _initStatus == InitializationStatus.Succeeded;
|
||||
|
||||
foreach (PayloadDescriptor pd in _payloads)
|
||||
{
|
||||
if (!Directory.Exists(pd.dir.ToString(SlashMode.Native)) && !InstallPayload(pd))
|
||||
{
|
||||
UnityEngine.Debug.LogError($"Failed to initialize package: {Name}");
|
||||
_initStatus = InitializationStatus.Failed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
_initStatus = InitializationStatus.Succeeded;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compute path of payload tarball
|
||||
/// </summary>
|
||||
/// <param name="packageName">The name of the package</param>
|
||||
/// <returns>Path of payload tarball</returns>
|
||||
internal NPath PayloadPath(string packageName)
|
||||
{
|
||||
return new NPath(Path.GetFullPath($"Packages/{packageName}")).Combine("data~/payload.tar.7z");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register payload tarball and destination (installed location)
|
||||
/// </summary>
|
||||
/// <param name="packageName">The name of the package</param>
|
||||
/// <param name="payloadDir">The directory to install the payload in relative to sysroot cache</param>
|
||||
public void RegisterPayload(string packageName, string payloadDir)
|
||||
{
|
||||
_payloads.Add(new PayloadDescriptor{path = PayloadPath(packageName).ToString(SlashMode.Native), dir = PayloadInstallDirectory(payloadDir).ToString(SlashMode.Native)});
|
||||
}
|
||||
|
||||
private bool RunShellCommand(string command, string workDir = null)
|
||||
{
|
||||
var p = new Process();
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
#if UNITY_EDITOR_WIN
|
||||
p.StartInfo.CreateNoWindow = true;
|
||||
p.StartInfo.FileName = "cmd";
|
||||
p.StartInfo.Arguments = $"/c \"{command}\"";
|
||||
#else
|
||||
p.StartInfo.FileName = "/bin/sh";
|
||||
p.StartInfo.Arguments = $"-c \'{command}\'";
|
||||
#endif
|
||||
p.StartInfo.WorkingDirectory = string.IsNullOrEmpty(workDir) ? Environment.CurrentDirectory : workDir;
|
||||
p.Start();
|
||||
p.WaitForExit();
|
||||
bool result = p.ExitCode == 0;
|
||||
if (!result && ShouldLogDebugMessage())
|
||||
UnityEngine.Debug.LogError($"Failed to execute command command=\"{p.StartInfo.FileName}\" arguments=\"{p.StartInfo.Arguments}\"");
|
||||
return result;
|
||||
}
|
||||
|
||||
private bool DecompressSysroot(NPath payload, NPath workDir)
|
||||
{
|
||||
if (!RunShellCommand(CommandCreateDirectory(workDir)))
|
||||
{
|
||||
UnityEngine.Debug.LogError($"Failed to create directory {workDir}");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!RunShellCommand(CommandUncompressTarball(payload, workDir), workDir.ToString(SlashMode.Native)))
|
||||
{
|
||||
UnityEngine.Debug.LogError($"Failed to uncompress payload");
|
||||
RunShellCommand(CommandRemoveDirectoryTree(workDir));
|
||||
return false;
|
||||
}
|
||||
|
||||
return PostDecompressActions(workDir);
|
||||
}
|
||||
|
||||
private bool InstallPayload(PayloadDescriptor pd)
|
||||
{
|
||||
return DecompressSysroot(pd.path, pd.dir);
|
||||
}
|
||||
|
||||
private string CommandCreateDirectory(NPath dir)
|
||||
{
|
||||
_initStatus = InitializationStatus.Failed;
|
||||
#if UNITY_EDITOR_WIN
|
||||
return $"mkdir {dir.InQuotes(SlashMode.Native)}";
|
||||
#else
|
||||
return $"mkdir -p {dir.InQuotes()}";
|
||||
#endif
|
||||
}
|
||||
|
||||
private string Get7zPath()
|
||||
{
|
||||
#if UNITY_EDITOR_WIN
|
||||
string command = "7z";
|
||||
#else
|
||||
string command = "7za";
|
||||
#endif
|
||||
return new NPath($"{EditorApplication.applicationContentsPath}/Tools/{command}").InQuotes(SlashMode.Native);
|
||||
}
|
||||
|
||||
private string CommandUncompressTarball(NPath tarball, NPath destDir)
|
||||
{
|
||||
#if UNITY_EDITOR_WIN
|
||||
return $"{Get7zPath()} x -y {tarball.InQuotes(SlashMode.Native)} -so | {Get7zPath()} x -y -aoa -ttar -si";
|
||||
#else
|
||||
return $"{Get7zPath()} x -y {tarball.InQuotes()} -so | tar xf - --directory={destDir.InQuotes()}";
|
||||
#endif
|
||||
}
|
||||
|
||||
private string CommandRemoveDirectoryTree(NPath dir)
|
||||
{
|
||||
#if UNITY_EDITOR_WIN
|
||||
return $"rd /s /q {dir.InQuotes(SlashMode.Native)}";
|
||||
#else
|
||||
return $"rm -rf {dir.InQuotes()}";
|
||||
#endif
|
||||
}
|
||||
|
||||
private bool PostDecompressActions(NPath workDir)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private string UserAppDataFolder()
|
||||
{
|
||||
return
|
||||
#if UNITY_EDITOR_OSX
|
||||
$"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Library/Unity";
|
||||
#else
|
||||
$"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/unity3d";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns path of installed payload
|
||||
/// </summary>
|
||||
/// <param name="payloadDir">The directory to install the payload in relative to sysroot cache</param>
|
||||
/// <returns>Fully-qualified path of install directory</returns>
|
||||
internal NPath PayloadInstallDirectory(string payloadDir)
|
||||
{
|
||||
string cacheDir = Environment.GetEnvironmentVariable("UNITY_SYSROOT_CACHE");
|
||||
if (string.IsNullOrEmpty(cacheDir))
|
||||
cacheDir = $"{UserAppDataFolder()}/cache/sysroots";
|
||||
return new NPath($"{cacheDir}/{payloadDir}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 646b84aea2c7ef2a7813536ed00c02c8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
5
Library/PackageCache/com.unity.sysroot@2.0.10/LICENSE.md
Normal file
5
Library/PackageCache/com.unity.sysroot@2.0.10/LICENSE.md
Normal file
@@ -0,0 +1,5 @@
|
||||
com.unity.sysroot © 2024 Unity Technologies ApS
|
||||
|
||||
Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
|
||||
|
||||
Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e76167c495d53ba6abcbb8df07973457
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
3
Library/PackageCache/com.unity.sysroot@2.0.10/README.md
Normal file
3
Library/PackageCache/com.unity.sysroot@2.0.10/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# com.unity.sysroot
|
||||
|
||||
This is the base sysroot package, containing common code. It is intended to be used only as a dependency by sysroot or toolchain packages.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51f3a1b7b38fe39689977681fe22df32
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Library/PackageCache/com.unity.sysroot@2.0.10/Tests.meta
Normal file
8
Library/PackageCache/com.unity.sysroot@2.0.10/Tests.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21355b98f3d94d714ad8c543adb3c7ef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"createSeparatePackage": false
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cac27dd0398cfe66aa1f1eb45442a1a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.TestTools;
|
||||
using NUnit.Framework;
|
||||
using System.Collections;
|
||||
|
||||
class EditorExampleTest {
|
||||
|
||||
[Test]
|
||||
public void EditorSampleTestSimplePasses() {
|
||||
// Use the Assert class to test conditions.
|
||||
}
|
||||
|
||||
// A UnityTest behaves like a coroutine in PlayMode
|
||||
// and allows you to yield null to skip a frame in EditMode
|
||||
[UnityTest]
|
||||
public IEnumerator EditorSampleTestWithEnumeratorPasses() {
|
||||
// Use the Assert class to test conditions.
|
||||
// yield to skip a frame
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94da573212a9b3278a42dcd34fba767b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Unity.Sysroot.EditorTests",
|
||||
"references": [
|
||||
"Unity.Sysroot.Editor",
|
||||
"Unity.Sysroot"
|
||||
],
|
||||
"optionalUnityReferences": [
|
||||
"TestAssemblies"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "Unity",
|
||||
"expression": "(0,2022.1.23f1)",
|
||||
"define": "IL2CPP_LEGACY_API_PRESENT"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b746f9393832b79384ac03cddf8eb94
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
This package contains third-party software components governed by the license(s) indicated below:
|
||||
---------
|
||||
|
||||
Component Name: NiceIO
|
||||
|
||||
License Type: MIT
|
||||
|
||||
Copyright (c) 2015-2017 Lucas Meijer
|
||||
|
||||
https://github.com/lucasmeijer/NiceIO
|
||||
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © `2015-2017` `Lucas Meijer`
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the “Software”), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77480111a80ad46e7b0d10da3fd3a092
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
Library/PackageCache/com.unity.sysroot@2.0.10/package.json
Normal file
25
Library/PackageCache/com.unity.sysroot@2.0.10/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "com.unity.sysroot",
|
||||
"displayName": "Sysroot Base",
|
||||
"version": "2.0.10",
|
||||
"unity": "2019.4",
|
||||
"keywords": [
|
||||
"unity",
|
||||
"linux",
|
||||
"sysroot"
|
||||
],
|
||||
"description": "This is the base sysroot package required by all sysroot and toolchain packages",
|
||||
"dependencies": {},
|
||||
"_upm": {
|
||||
"changelog": "bump version number to publish"
|
||||
},
|
||||
"upmCi": {
|
||||
"footprint": "8753174da37b75e03036d4e364195bc2b9c05e79"
|
||||
},
|
||||
"documentationUrl": "https://docs.unity3d.com/Packages/com.unity.sysroot@2.0/manual/index.html",
|
||||
"repository": {
|
||||
"url": "https://github.com/Unity-Technologies/com.unity.sysroot.git",
|
||||
"type": "git",
|
||||
"revision": "48e503c8f30007e813fbcec90dc84795285406b4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0445a7983a983d97f848d19d5eeebf7b
|
||||
PackageManifestImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user