mirror of https://github.com/lidarr/Lidarr
Distribute fpcalc for netcore builds
This commit is contained in:
parent
8fe924fdcd
commit
d9dfd32568
|
@ -310,6 +310,7 @@ stages:
|
|||
- bash: |
|
||||
wget https://github.com/acoustid/chromaprint/releases/download/v1.4.3/chromaprint-fpcalc-1.4.3-linux-x86_64.tar.gz
|
||||
sudo tar xf chromaprint-fpcalc-1.4.3-linux-x86_64.tar.gz --strip-components=1 --directory /usr/bin
|
||||
chmod a+x _tests/fpcalc
|
||||
displayName: Install fpcalc
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||||
- bash: |
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
<ProjectReference Include="..\NzbDrone.Test.Common\Lidarr.Test.Common.csproj" />
|
||||
<ProjectReference Include="..\NzbDrone.Core\Lidarr.Core.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<RuntimeFiles Include="..\Runtimes\$(RuntimeIdentifier)\*"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\Logo\1024.png">
|
||||
<Link>Files\1024.png</Link>
|
||||
|
@ -28,16 +31,10 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="CopyWindowsRuntimesOnBuild" AfterTargets="AfterBuild" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(OutDir)" />
|
||||
<Target Name="CopyRuntimeFilesOnBuild" AfterTargets="AfterBuild" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||
<Copy SourceFiles="@(RuntimeFiles)" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
<Target Name="CopyWindowsRuntimesOnPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(PublishDir)" />
|
||||
</Target>
|
||||
<Target Name="CopyMacOSRuntimesOnBuild" AfterTargets="AfterBuild" Condition="'$(RuntimeIdentifier)'=='osx-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-macos-x86_64\fpcalc" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
<Target Name="CopyMacOSRuntimesOnPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)'=='osx-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-macos-x86_64\fpcalc" DestinationFolder="$(PublishDir)" />
|
||||
<Target Name="CopyRuntimeFilesOnPublish" AfterTargets="Publish" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||
<Copy SourceFiles="@(RuntimeFiles)" DestinationFolder="$(PublishDir)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -28,21 +28,18 @@
|
|||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<RuntimeFiles Include="..\Runtimes\$(RuntimeIdentifier)\*"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Logo\64.png">
|
||||
<Link>Resources\Logo\64.png</Link>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Target Name="CopyWindowsRuntimesOnBuild" AfterTargets="AfterBuild" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(OutDir)" />
|
||||
<Target Name="CopyRuntimeFilesOnBuild" AfterTargets="AfterBuild" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||
<Copy SourceFiles="@(RuntimeFiles)" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
<Target Name="CopyWindowsRuntimesOnPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(PublishDir)" />
|
||||
</Target>
|
||||
<Target Name="CopyMacOSRuntimesOnBuild" AfterTargets="AfterBuild" Condition="'$(RuntimeIdentifier)'=='osx-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-macos-x86_64\fpcalc" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
<Target Name="CopyMacOSRuntimesOnPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)'=='osx-x64'">
|
||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-macos-x86_64\fpcalc" DestinationFolder="$(PublishDir)" />
|
||||
<Target Name="CopyRuntimeFilesOnPublish" AfterTargets="Publish" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||
<Copy SourceFiles="@(RuntimeFiles)" DestinationFolder="$(PublishDir)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -78,6 +78,20 @@ namespace NzbDrone.Core.Parser
|
|||
private string GetFpcalcPath()
|
||||
{
|
||||
string path = null;
|
||||
|
||||
// Take the fpcalc from the install directory if it exists
|
||||
path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "fpcalc");
|
||||
if (OsInfo.IsWindows)
|
||||
{
|
||||
path += ".exe";
|
||||
}
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
// Otherwise search path for a candidate and check it works
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
// must be on users path on Linux
|
||||
|
@ -103,25 +117,15 @@ namespace NzbDrone.Core.Parser
|
|||
_logger.Debug("fpcalc not found");
|
||||
return null;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
else
|
||||
{
|
||||
// on OSX / Windows, we have put fpcalc in the application folder
|
||||
path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "fpcalc");
|
||||
if (OsInfo.IsWindows)
|
||||
{
|
||||
path += ".exe";
|
||||
}
|
||||
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
_logger.Warn("fpcalc missing from application directory");
|
||||
return null;
|
||||
}
|
||||
_logger.Warn("fpcalc missing from application directory");
|
||||
return null;
|
||||
}
|
||||
|
||||
_logger.Debug($"fpcalc path: {path}");
|
||||
return path;
|
||||
}
|
||||
|
||||
private Version GetFpcalcVersion()
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue