diff --git a/ManagedWimLib.Tests/TestSetup.cs b/ManagedWimLib.Tests/TestSetup.cs index 3b6ab1f..b57dfc6 100644 --- a/ManagedWimLib.Tests/TestSetup.cs +++ b/ManagedWimLib.Tests/TestSetup.cs @@ -42,16 +42,24 @@ public static void Init(TestContext context) BaseDir = Path.GetFullPath(Path.Combine(TestHelper.GetProgramAbsolutePath(), "..", "..", "..")); SampleDir = Path.Combine(BaseDir, "Samples"); + const string x64 = "x64"; + const string x86 = "x86"; + const string armhf = "armhf"; + const string arm64 = "arm64"; + + const string dllName = "libwim-15.dll"; + const string soName = "libwim.so"; + string libPath = null; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { switch (RuntimeInformation.ProcessArchitecture) { case Architecture.X86: - libPath = Path.Combine("x86", "libwim-15.dll"); + libPath = Path.Combine(x86, dllName); break; case Architecture.X64: - libPath = Path.Combine("x64", "libwim-15.dll"); + libPath = Path.Combine(x64, dllName); break; } } @@ -60,7 +68,13 @@ public static void Init(TestContext context) switch (RuntimeInformation.ProcessArchitecture) { case Architecture.X64: - libPath = Path.Combine("x64", "libwim.so"); + libPath = Path.Combine(x64, soName); + break; + case Architecture.Arm: + libPath = Path.Combine(armhf, soName); + break; + case Architecture.Arm64: + libPath = Path.Combine(arm64, soName); break; } } diff --git a/ManagedWimLib/ManagedWimLib.csproj b/ManagedWimLib/ManagedWimLib.csproj index 5a24b83..948b827 100644 --- a/ManagedWimLib/ManagedWimLib.csproj +++ b/ManagedWimLib/ManagedWimLib.csproj @@ -9,13 +9,13 @@ Supports Windows and Linux. Copyright (c) 2018 Hajin Jang Joveler - - Add .Net Framework 4.5.1 target + - Support armhf, arm64 on linux https://github.com/ied206/ManagedWimLib/blob/master/LICENSE https://github.com/ied206/ManagedWimLib wim wimlib pinvoke interop https://raw.githubusercontent.com/ied206/ManagedWimLib/master/Image/Logo.png - 1.2.1 + 1.2.2 diff --git a/ManagedWimLib/ManagedWimLib.nuspec b/ManagedWimLib/ManagedWimLib.nuspec index 845d86e..ec76094 100644 --- a/ManagedWimLib/ManagedWimLib.nuspec +++ b/ManagedWimLib/ManagedWimLib.nuspec @@ -3,7 +3,7 @@ ManagedWimLib ManagedWimLib - 1.2.1 + 1.2.2 ied206 Eric Biggers, Hajin Jang https://github.com/ied206/ManagedWimLib/blob/master/LICENSE @@ -13,7 +13,7 @@ C# pinvoke library for wimlib. Supports Windows and Linux. C# pinvoke library for wimlib. - - Add .Net Framework 4.5.1 target + - Support armhf, arm64 on linux Copyright (c) 2018 Hajin Jang wim wimlib pinvoke interop diff --git a/ManagedWimLib/Precompiled/arm64/libwim.so b/ManagedWimLib/Precompiled/arm64/libwim.so new file mode 100644 index 0000000..ba43e26 Binary files /dev/null and b/ManagedWimLib/Precompiled/arm64/libwim.so differ diff --git a/ManagedWimLib/Precompiled/armhf/libwim.so b/ManagedWimLib/Precompiled/armhf/libwim.so new file mode 100644 index 0000000..8559601 Binary files /dev/null and b/ManagedWimLib/Precompiled/armhf/libwim.so differ diff --git a/README.md b/README.md index 437ffd5..32a92a7 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,18 @@ If you need .Net Framework 4.5 support, use [1.1.x version](https://www.nuget.or ### Supported OS platforms -- Windows x86, x64 -- Linux x64 +| Platform | Architecture | Tested | +|----------|--------------|--------| +| Windows | x86, x64 | Yes | +| Linux | x64, armhf | Yes | +| | arm64 | No | + +#### Tested linux distributions + +| Architecture | Distribution | Note | +|--------------|--------------|------| +| x64 | Ubuntu 18.04 | | +| armhf | Debian 9 | Emulated on QEMU's virt board | ### Supported wimlib version @@ -44,8 +54,8 @@ See [USAGE.md](./USAGE.md). ## License -Licensed under LGPLv3. +Licensed under LGPLv3. See [LICENSE](./LICENSE) for details. -Logo is licensed under CC BY 3.0 US. +Logo is licensed under CC BY 3.0 US. [disc](https://thenounproject.com/term/disc/772617) by Ralf Schmitzer from the Noun Project \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index de5ff18..596bd23 100644 --- a/USAGE.md +++ b/USAGE.md @@ -11,16 +11,24 @@ Put this snippet in your application's init code: ```cs public static void InitNativeLibrary() { + const string x64 = "x64"; + const string x86 = "x86"; + const string armhf = "armhf"; + const string arm64 = "arm64"; + + const string dllName = "libwim-15.dll"; + const string soName = "libwim.so"; + string libPath = null; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { switch (RuntimeInformation.ProcessArchitecture) { - case Architecture.X64: - libPath = Path.Combine("x64", "libwim-15.dll"); - break; case Architecture.X86: - libPath = Path.Combine("x86", "libwim-15.dll"); + libPath = Path.Combine(x86, dllName); + break; + case Architecture.X64: + libPath = Path.Combine(x64, dllName); break; } } @@ -29,7 +37,13 @@ public static void InitNativeLibrary() switch (RuntimeInformation.ProcessArchitecture) { case Architecture.X64: - libPath = Path.Combine("x64", "libwim.so"); + libPath = Path.Combine(x64, soName); + break; + case Architecture.Arm: + libPath = Path.Combine(armhf, soName); + break; + case Architecture.Arm64: + libPath = Path.Combine(arm64, soName); break; } } @@ -48,11 +62,13 @@ public static void InitNativeLibrary() ManagedWimLib comes with sets of binaries of `wimlib 1.13.0-BETA5`. They will be copied into the build directory at build time. -| Platform | Binary | License | -|------------------|-------------------------------|---------| -| Windows x86 | `$(OutDir)\x86\libwim-15.dll` | LGPLv3 | -| Windows x64 | `$(OutDir)\x64\libwim-15.dll` | LGPLv3 | +| Platform | Binary | License | +|------------------|-------------------------------|----------------------| +| Windows x86 | `$(OutDir)\x86\libwim-15.dll` | LGPLv3 | +| Windows x64 | `$(OutDir)\x64\libwim-15.dll` | LGPLv3 | | Ubuntu 18.04 x64 | `$(OutDir)\x64\libwim.so` | LGPLv3 (w/o NTFS-3G) | +| Debian 9 armhf | `$(OutDir)\armhf\libwim.so` | LGPLv3 (w/o NTFS-3G) | +| Debian 9 arm64 | `$(OutDir)\arm64\libwim.so` | LGPLv3 (w/o NTFS-3G) | ### Custom binary @@ -60,8 +76,10 @@ To use custom wimlib binary instead, call `Wim.GlobalInit()` with a path to the #### NOTES -- Ubuntu 18.04 x64 binary is compiled without NTFS-3G support (`./configure --without-ntfs-3g --without-libcrypto --enable-static`) because it makes binary GPLv3 licensed. If you want NTFS-3G functionality, use system-provided or custom libwim.so and make sure your program is compatible with GPLv3. - Create an empty file named `ManagedWimLib.Precompiled.Exclude` in project directory to prevent copy of package-embedded binary. +- Linux binaries were compiled without NTFS-3G support (`./configure --without-ntfs-3g --without-libcrypto --enable-static`) because it makes binaries GPLv3 licensed. If you want NTFS-3G functionality, use system-provided or custom libwim.so and make sure your program is compatible with GPLv3. +- You may have to compile custom wimlib to use ManagedWimLib in untested linux distribution. +- Untested on arm64, because .Net Core 2.1 arm64 runtime has an [issue](https://github.com/dotnet/coreclr/issues/19578). ### Cleanup