Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed Oct 29, 2018
2 parents 31ae407 + 88e5ed9 commit 35e1f9c
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 21 deletions.
20 changes: 17 additions & 3 deletions ManagedWimLib.Tests/TestSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions ManagedWimLib/ManagedWimLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
Supports Windows and Linux.</Description>
<Copyright>Copyright (c) 2018 Hajin Jang</Copyright>
<Company>Joveler</Company>
<PackageReleaseNotes>- Add .Net Framework 4.5.1 target</PackageReleaseNotes>
<PackageReleaseNotes>- Support armhf, arm64 on linux</PackageReleaseNotes>
<PackageLicenseUrl>https://github.com/ied206/ManagedWimLib/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/ied206/ManagedWimLib</PackageProjectUrl>
<RepositoryUrl></RepositoryUrl>
<PackageTags>wim wimlib pinvoke interop</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/ied206/ManagedWimLib/master/Image/Logo.png</PackageIconUrl>
<Version>1.2.1</Version>
<Version>1.2.2</Version>
</PropertyGroup>
<Import Project="$(MSBuildProjectDirectory)\ManagedWimLib.targets" />
</Project>
4 changes: 2 additions & 2 deletions ManagedWimLib/ManagedWimLib.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>ManagedWimLib</id>
<title>ManagedWimLib</title>
<version>1.2.1</version>
<version>1.2.2</version>
<owners>ied206</owners>
<authors>Eric Biggers, Hajin Jang</authors>
<licenseUrl>https://github.com/ied206/ManagedWimLib/blob/master/LICENSE</licenseUrl>
Expand All @@ -13,7 +13,7 @@
<description>C# pinvoke library for wimlib.
Supports Windows and Linux.</description>
<summary>C# pinvoke library for wimlib.</summary>
<releaseNotes>- Add .Net Framework 4.5.1 target</releaseNotes>
<releaseNotes>- Support armhf, arm64 on linux</releaseNotes>
<copyright>Copyright (c) 2018 Hajin Jang</copyright>
<tags>wim wimlib pinvoke interop</tags>
<dependencies>
Expand Down
Binary file added ManagedWimLib/Precompiled/arm64/libwim.so
Binary file not shown.
Binary file added ManagedWimLib/Precompiled/armhf/libwim.so
Binary file not shown.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
38 changes: 28 additions & 10 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand All @@ -48,20 +62,24 @@ 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

To use custom wimlib binary instead, call `Wim.GlobalInit()` with a path to the custom binary.

#### 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

Expand Down

0 comments on commit 35e1f9c

Please sign in to comment.