diff --git a/ManagedWimLib.Tests/TestSetup.cs b/ManagedWimLib.Tests/TestSetup.cs index 669c135..125dbc8 100644 --- a/ManagedWimLib.Tests/TestSetup.cs +++ b/ManagedWimLib.Tests/TestSetup.cs @@ -42,44 +42,32 @@ 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)) + string arch = null; + switch (RuntimeInformation.OSArchitecture) { - switch (RuntimeInformation.ProcessArchitecture) - { - case Architecture.X86: - libPath = Path.Combine(x86, dllName); - break; - case Architecture.X64: - libPath = Path.Combine(x64, dllName); - break; - } + case Architecture.X86: + arch = "x86"; + break; + case Architecture.X64: + arch = "x64"; + break; + case Architecture.Arm: + arch = "armhf"; + break; + case Architecture.Arm64: + arch = "arm64"; + break; } + + string libPath = null; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + libPath = Path.Combine(arch, "libwim-15.dll"); else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - switch (RuntimeInformation.ProcessArchitecture) - { - case Architecture.X64: - libPath = Path.Combine(x64, soName); - break; - case Architecture.Arm: - libPath = Path.Combine(armhf, soName); - break; - case Architecture.Arm64: - libPath = Path.Combine(arm64, soName); - break; - } - } + libPath = Path.Combine(arch, "libwim.so"); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + libPath = Path.Combine(arch, "libwim.dylib"); - if (libPath == null) + if (libPath == null || !File.Exists(libPath)) throw new PlatformNotSupportedException(); Wim.GlobalInit(libPath); diff --git a/ManagedWimLib/WimLibLoader.cs b/ManagedWimLib/WimLibLoader.cs index e058e32..b2de14c 100644 --- a/ManagedWimLib/WimLibLoader.cs +++ b/ManagedWimLib/WimLibLoader.cs @@ -80,6 +80,8 @@ protected override string DefaultLibFileName #if !NET451 if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) return "libwim.so.15"; + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + return "libwim.15.dylib"; #endif throw new PlatformNotSupportedException(); } diff --git a/README.md b/README.md index affed08..9927697 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ wimlib is a library that handles Windows Imaging (WIM) archives, written by Eric |-----------|----------------| | Master | [![CI Master Branch Build Status](https://ci.appveyor.com/api/projects/status/wtb8ong8c112f4ug/branch/master?svg=true)](https://ci.appveyor.com/project/ied206/managedwimlib/branch/master) | | Develop | [![CI Develop Branch Build Status](https://ci.appveyor.com/api/projects/status/wtb8ong8c112f4ug/branch/develop?svg=true)](https://ci.appveyor.com/project/ied206/managedwimlib/branch/develop) | -| Azure Pipelines | Master | [![Azure Pipelines CI Master Branch Build Status](https://ied206.visualstudio.com/ManagedWimLib/_apis/build/status/ied206.ManagedWimLib?branchName=master)](https://dev.azure.com/ied206/ManagedWimLib/_build) | -| | Develop | [![Azure Pipelines CI Develop Branch Build Status](https://ied206.visualstudio.com/ManagedWimLib/_apis/build/status/ied206.ManagedWimLib?branchName=develop)](https://dev.azure.com/ied206/ManagedWimLib/_build) |git +| Azure Pipelines | [![Azure Pipelines CI Master Branch Build Status](https://ied206.visualstudio.com/ManagedWimLib/_apis/build/status/ied206.ManagedWimLib?branchName=master)](https://dev.azure.com/ied206/ManagedWimLib/_build) | +| | [![Azure Pipelines CI Develop Branch Build Status](https://ied206.visualstudio.com/ManagedWimLib/_apis/build/status/ied206.ManagedWimLib?branchName=develop)](https://dev.azure.com/ied206/ManagedWimLib/_build) | ## Install diff --git a/USAGE.md b/USAGE.md index 0be1356..8c82aba 100644 --- a/USAGE.md +++ b/USAGE.md @@ -69,6 +69,19 @@ They will be copied into the build directory at build time. | 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) | +| macOS 10.15 | | | + +- Build Command + +| Platform | Binary Source or Build Command | Dependency | +|------------------|--------------------------------|----------------------| +| Windows x86 | [Official Release](https://wimlib.net/downloads/wimlib-1.13.1-windows-i686-bin.zip) | - | +| Windows x64 | [Official Release](https://wimlib.net/downloads/wimlib-1.13.1-windows-x86_64-bin.zip) | - | +| Ubuntu 18.04 x64 | `./configure --without-ntfs-3g --disable-static --enable-ssse3-sha1` | `libxml2`, `libfuse` | +| Debian 10 armhf | `./configure --without-ntfs-3g --disable-static` | `libxml2`, `libfuse` | +| Debian 10 arm64 | `./configure --without-ntfs-3g --disable-static` | `libxml2`, `libfuse` | +| macOS 10.15 | `libxml2`: `./configure --with-minimum --disable-static --with-minimum --without-lzma --with-tree --with-writer` | | +| | `libwim`: `./configure --without-ntfs-3g --without-fuse --disable-static` | | ### Custom binary @@ -77,8 +90,10 @@ To use custom wimlib binary instead, call `Wim.GlobalInit()` with a path to the #### NOTES - Create an empty file named `ManagedWimLib.Precompiled.Exclude` in the project directory to prevent copy of the package-embedded binary. -- Linux binaries were compiled without NTFS-3G support (`./configure --without-ntfs-3g --without-libcrypto --enable-static`) to make them as LGPLv3-licensed. If you want NTFS-3G functionality, use system-provided or custom libwim.so and make sure your program is compatible with GPLv3. +- POSIX binaries were compiled without NTFS-3G support to make them as LGPLv3-licensed. If you want NTFS-3G functionality, provide the library yourself and make sure your program is compatible with GPLv3. + - wimlib depends on `libfuse` and `libxml2`, and it will search them from the system directories. - You may have to compile custom wimlib to use ManagedWimLib in untested Linux distribution. +- If you do not specify `libPath` parameter on Linux or macOS, `ManagedWimLib` will search for system-installed wimlib. ### Cleanup