Skip to content

Commit

Permalink
Update macOS default library filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed Oct 16, 2019
1 parent a2df2d7 commit 3e2cec7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 37 deletions.
56 changes: 22 additions & 34 deletions ManagedWimLib.Tests/TestSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions ManagedWimLib/WimLibLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 3e2cec7

Please sign in to comment.