mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Distribute fpcalc for netcore builds
This commit is contained in:
parent
8fe924fdcd
commit
d9dfd32568
9 changed files with 33 additions and 34 deletions
|
@ -310,6 +310,7 @@ stages:
|
||||||
- bash: |
|
- bash: |
|
||||||
wget https://github.com/acoustid/chromaprint/releases/download/v1.4.3/chromaprint-fpcalc-1.4.3-linux-x86_64.tar.gz
|
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
|
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
|
displayName: Install fpcalc
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||||||
- bash: |
|
- bash: |
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
<ProjectReference Include="..\NzbDrone.Test.Common\Lidarr.Test.Common.csproj" />
|
<ProjectReference Include="..\NzbDrone.Test.Common\Lidarr.Test.Common.csproj" />
|
||||||
<ProjectReference Include="..\NzbDrone.Core\Lidarr.Core.csproj" />
|
<ProjectReference Include="..\NzbDrone.Core\Lidarr.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<RuntimeFiles Include="..\Runtimes\$(RuntimeIdentifier)\*"/>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="..\..\Logo\1024.png">
|
<Content Include="..\..\Logo\1024.png">
|
||||||
<Link>Files\1024.png</Link>
|
<Link>Files\1024.png</Link>
|
||||||
|
@ -28,16 +31,10 @@
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="CopyWindowsRuntimesOnBuild" AfterTargets="AfterBuild" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
<Target Name="CopyRuntimeFilesOnBuild" AfterTargets="AfterBuild" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(OutDir)" />
|
<Copy SourceFiles="@(RuntimeFiles)" DestinationFolder="$(OutDir)" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="CopyWindowsRuntimesOnPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
<Target Name="CopyRuntimeFilesOnPublish" AfterTargets="Publish" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(PublishDir)" />
|
<Copy SourceFiles="@(RuntimeFiles)" 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>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -28,21 +28,18 @@
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Web.Extensions" />
|
<Reference Include="System.Web.Extensions" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<RuntimeFiles Include="..\Runtimes\$(RuntimeIdentifier)\*"/>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="..\..\Logo\64.png">
|
<EmbeddedResource Include="..\..\Logo\64.png">
|
||||||
<Link>Resources\Logo\64.png</Link>
|
<Link>Resources\Logo\64.png</Link>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="CopyWindowsRuntimesOnBuild" AfterTargets="AfterBuild" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
<Target Name="CopyRuntimeFilesOnBuild" AfterTargets="AfterBuild" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(OutDir)" />
|
<Copy SourceFiles="@(RuntimeFiles)" DestinationFolder="$(OutDir)" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="CopyWindowsRuntimesOnPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
<Target Name="CopyRuntimeFilesOnPublish" AfterTargets="Publish" Condition="!$(RuntimeIdentifier.StartsWith('linux')) or '$(TargetFramework)' == 'netcoreapp3.0'">
|
||||||
<Copy SourceFiles="..\Libraries\Fpcalc\chromaprint-fpcalc-1.4.3-windows-x86_64\fpcalc.exe" DestinationFolder="$(PublishDir)" />
|
<Copy SourceFiles="@(RuntimeFiles)" 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>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -78,6 +78,20 @@ namespace NzbDrone.Core.Parser
|
||||||
private string GetFpcalcPath()
|
private string GetFpcalcPath()
|
||||||
{
|
{
|
||||||
string path = null;
|
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)
|
if (OsInfo.IsLinux)
|
||||||
{
|
{
|
||||||
// must be on users path on Linux
|
// must be on users path on Linux
|
||||||
|
@ -103,25 +117,15 @@ namespace NzbDrone.Core.Parser
|
||||||
_logger.Debug("fpcalc not found");
|
_logger.Debug("fpcalc not found");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// on OSX / Windows, we have put fpcalc in the application folder
|
// on OSX / Windows, we have put fpcalc in the application folder
|
||||||
path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "fpcalc");
|
_logger.Warn("fpcalc missing from application directory");
|
||||||
if (OsInfo.IsWindows)
|
return null;
|
||||||
{
|
|
||||||
path += ".exe";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
|
||||||
_logger.Warn("fpcalc missing from application directory");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug($"fpcalc path: {path}");
|
|
||||||
return path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Version GetFpcalcVersion()
|
private Version GetFpcalcVersion()
|
||||||
|
|
BIN
src/Runtimes/linux-arm/fpcalc
Executable file
BIN
src/Runtimes/linux-arm/fpcalc
Executable file
Binary file not shown.
BIN
src/Runtimes/linux-arm64/fpcalc
Executable file
BIN
src/Runtimes/linux-arm64/fpcalc
Executable file
Binary file not shown.
BIN
src/Runtimes/linux-x64/fpcalc
Executable file
BIN
src/Runtimes/linux-x64/fpcalc
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue