Skip to content

Commit

Permalink
build: prepare for dotnet pack
Browse files Browse the repository at this point in the history
  • Loading branch information
protyposis committed Nov 21, 2023
1 parent 6c1737f commit 504e0df
Show file tree
Hide file tree
Showing 21 changed files with 479 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ obj/
**/packages/*

licenseinfo.txt
/dist
9 changes: 9 additions & 0 deletions Dockerfile.libaurioffmpeglinuxbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# A simple image to build the Linux variants of the aurioffmpegproxy library (on Windows).
#
# Usage:
# 1. build image: docker build -f Dockerfile.libaurioffmpeglinuxbuild --tag libaurioffmpegproxybuilder .
# 2. run container: docker run -it --rm -v .:/aurio libaurioffmpegproxybuilder
FROM ubuntu:22.04
RUN apt update && apt install -y cmake ninja-build wget xz-utils
WORKDIR /aurio
CMD [ "./build-nativesrc-linux.sh" ]
1 change: 1 addition & 0 deletions ExocortexDSP/Exocortex.DSP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>Exocortex.DSP.v1</AssemblyName>
<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
Binary file added aurio-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions build-and-pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Write-Host "Setting up VS dev env...";
$vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -latest -property installationpath
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64'

Write-Host "Building native source for Windows...";
./install-deps.ps1
cmake nativesrc --preset x64-debug
cmake --build nativesrc\out\build\x64-debug
cmake nativesrc --preset x64-release
cmake --build nativesrc\out\build\x64-release

Write-Host "Building native source for Linux...";
docker build -f Dockerfile.libaurioffmpeglinuxbuild --tag libaurioffmpegproxybuilder .
docker run -it --rm -v .:/aurio libaurioffmpegproxybuilder

Write-Host "Packing...";
dotnet pack src -c NugetPackRelease -o dist/nuget

Write-Host "Done :)";
6 changes: 6 additions & 0 deletions build-nativesrc-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
./install-deps.sh && \
cmake nativesrc --preset linux-debug && \
cmake --build nativesrc/out/build/linux-debug && \
cmake nativesrc --preset linux-release && \
cmake --build nativesrc/out/build/linux-release
1 change: 1 addition & 0 deletions install-deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $localname = "win64"
$archive = "$version.zip"
$dest = ".\libs\ffmpeg"

$ProgressPreference = 'SilentlyContinue' # https://stackoverflow.com/q/28682642
Invoke-WebRequest https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/$archive -OutFile $archive

Expand-Archive .\$archive -DestinationPath $dest
Expand Down
1 change: 1 addition & 0 deletions install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DEST=./libs/ffmpeg
wget -O $ARCHIVE https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/$ARCHIVE && \
tar xf $ARCHIVE -C $DEST && \
rm $ARCHIVE && \
rm -rf $DEST/$LOCALNAME && \
mv $DEST/$VERSION $DEST/$LOCALNAME
18 changes: 16 additions & 2 deletions src/Aurio.Exocortex/Aurio.Exocortex.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyTitle>Aurio Exocortex.DSP FFT Interface</AssemblyTitle>
<AssemblyTitle>Aurio Exocortex.DSP FFT extension</AssemblyTitle>
<IsPackable>true</IsPackable>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
<Description>Extension library for Aurio, which provides audio FFT and iFFT through the Exocortex.DSP library (see https://benhouston3d.com/dsp/).</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ExocortexDSP\Exocortex.DSP.csproj" />
<ProjectReference Include="..\..\ExocortexDSP\Exocortex.DSP.csproj" PrivateAssets="All" />
<ProjectReference Include="..\Aurio\Aurio.csproj" />
</ItemGroup>
<!--
Include the Exocortex.DSP library in this package (because there is no nuget package).
Since MSBuild does not directly support it, this is a workaround from
https://github.com/NuGet/Home/issues/3891, consisting of below `Target`, `TargetsForTfmSpecificBuildOutput`
property, and the `PrivateAssets` marker on the project reference.
-->
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('PrivateAssets', 'All'))" />
</ItemGroup>
</Target>
</Project>
8 changes: 6 additions & 2 deletions src/Aurio.FFTW/Aurio.FFTW.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyTitle>Aurio FFTW Interface</AssemblyTitle>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<AssemblyTitle>Aurio FFTW extension</AssemblyTitle>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides audio FFT and iFFT through the external FFTW (Fastest Fourier Transform in the West) library (see https://www.fftw.org/).</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
Expand All @@ -10,6 +13,7 @@
<Content Include="..\..\libs\libfftw3f-3.x64.dll">
<Link>libfftw3f-3.x64.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
58 changes: 37 additions & 21 deletions src/Aurio.FFmpeg/Aurio.FFmpeg.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,71 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyTitle>Aurio FFmpeg Interface</AssemblyTitle>
<Configurations>Debug;Release;LinuxDebug;LinuxRelease</Configurations>
<FFmpegProxyConfiguration Condition="'$(Configuration)'=='Debug'">x64-debug</FFmpegProxyConfiguration>
<FFmpegProxyConfiguration Condition="'$(Configuration)'=='Release'">x64-release</FFmpegProxyConfiguration>
<FFmpegProxyConfiguration Condition="'$(Configuration)'=='LinuxDebug'">linux-debug</FFmpegProxyConfiguration>
<FFmpegProxyConfiguration Condition="'$(Configuration)'=='LinuxRelease'">linux-release</FFmpegProxyConfiguration>
<FFmpegProxyPath>..\..\nativesrc\out\build\$(FFmpegProxyConfiguration)\aurioffmpegproxy</FFmpegProxyPath>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<AssemblyTitle>Aurio FFmpeg extension</AssemblyTitle>
<Configurations>Debug;Release;LinuxDebug;LinuxRelease;NugetPackRelease;NugetPackDebug</Configurations>
<FFmpegProxyPlatform>x64</FFmpegProxyPlatform>
<FFmpegProxyPlatform Condition="$(Configuration.Contains('Linux'))">linux</FFmpegProxyPlatform>
<FFmpegProxyBuildConfig>release</FFmpegProxyBuildConfig>
<FFmpegProxyBuildConfig Condition="$(Configuration.Contains('Debug'))">debug</FFmpegProxyBuildConfig>
<FFmpegProxyWindowsPath>..\..\nativesrc\out\build\x64-$(FFmpegProxyBuildConfig)\aurioffmpegproxy</FFmpegProxyWindowsPath>
<FFmpegProxyLinuxPath>..\..\nativesrc\out\build\linux-$(FFmpegProxyBuildConfig)\aurioffmpegproxy</FFmpegProxyLinuxPath>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides audio decoding through FFmpeg (see https://ffmpeg.org/).</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
</ItemGroup>
<ItemGroup Condition="!$(Configuration.Contains('Linux'))">
<Content Include="$(FFmpegProxyPath)\aurioffmpegproxy.dll">
<ItemGroup Condition="!$(Configuration.Contains('Linux')) Or $(Configuration.Contains('NugetPack'))">
<Content Include="$(FFmpegProxyWindowsPath)\aurioffmpegproxy.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\avcodec-60.dll">
<Content Include="$(FFmpegProxyWindowsPath)\avcodec-60.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\avformat-60.dll">
<Content Include="$(FFmpegProxyWindowsPath)\avformat-60.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\avutil-58.dll">
<Content Include="$(FFmpegProxyWindowsPath)\avutil-58.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\swresample-4.dll">
<Content Include="$(FFmpegProxyWindowsPath)\swresample-4.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\swscale-7.dll">
<Content Include="$(FFmpegProxyWindowsPath)\swscale-7.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
</ItemGroup>
<ItemGroup Condition="$(Configuration.Contains('Linux'))">
<Content Include="$(FFmpegProxyPath)\libaurioffmpegproxy.so">
<ItemGroup Condition="$(Configuration.Contains('Linux')) Or $(Configuration.Contains('NugetPack'))">
<Content Include="$(FFmpegProxyLinuxPath)\libaurioffmpegproxy.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\libavcodec.so.60">
<Content Include="$(FFmpegProxyLinuxPath)\libavcodec.so.60">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\libavformat.so.60">
<Content Include="$(FFmpegProxyLinuxPath)\libavformat.so.60">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\libavutil.so.58">
<Content Include="$(FFmpegProxyLinuxPath)\libavutil.so.58">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\libswresample.so.4">
<Content Include="$(FFmpegProxyLinuxPath)\libswresample.so.4">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x64/native</PackagePath>
</Content>
<Content Include="$(FFmpegProxyPath)\libswscale.so.7">
<Content Include="$(FFmpegProxyLinuxPath)\libswscale.so.7">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x64/native</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Aurio.FftSharp/Aurio.FftSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyTitle>Aurio FftSharp Interface</AssemblyTitle>
<AssemblyTitle>Aurio FftSharp extension</AssemblyTitle>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides audio FFT and iFFT through the external FftSharp library (see https://github.com/swharden/FftSharp/).</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/Aurio.LibSampleRate/Aurio.LibSampleRate.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyTitle>Aurio LibSampleRate Interface</AssemblyTitle>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<AssemblyTitle>Aurio LibSampleRate extension</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides audio resampling through the external libsamplerate/SecretRabbitCode library (see https://github.com/libsndfile/libsamplerate).</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
Expand All @@ -11,6 +14,7 @@
<Content Include="..\..\libs\libsamplerate-0.x64.dll">
<Link>libsamplerate-0.x64.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Aurio.Matching.SQLite/Aurio.Matching.SQLite.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyTitle>Aurio SQLite Fingerprint Collision Map</AssemblyTitle>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides a fingerprint collision map implementation based on an SQLite DB.</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
Expand Down
8 changes: 6 additions & 2 deletions src/Aurio.PFFFT/Aurio.PFFFT.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyTitle>Aurio PFFFT Interface</AssemblyTitle>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<AssemblyTitle>Aurio PFFFT extension</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides audio FFT and iFFT through the external PFFFT (Pretty Fast FFT) library (see https://bitbucket.org/jpommier/pffft/).</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
Expand All @@ -11,6 +14,7 @@
<Content Include="..\..\libs\pffft.x64.dll">
<Link>pffft.x64.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/Aurio.Soxr/Aurio.Soxr.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyTitle>Aurio SoxResampler Interface</AssemblyTitle>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<AssemblyTitle>Aurio SoxResampler extension</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides audio resampling through the external Soxr (SoX Resampler) library (see https://github.com/chirlu/soxr).</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader" Link="Aurio.licenseheader" />
Expand All @@ -11,6 +14,7 @@
<Content Include="..\..\libs\soxr.x64.dll">
<Link>soxr.x64.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x64/native</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Aurio.WaveControls/Aurio.WaveControls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>Library</OutputType>
<UseWPF>true</UseWPF>
<AssemblyTitle>Aurio WPF Audio Controls Library</AssemblyTitle>
<AssemblyTitle>Aurio WPF Audio Controls</AssemblyTitle>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio with WPF UI controls and utilities.</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\Aurio.licenseheader">
Expand Down
4 changes: 3 additions & 1 deletion src/Aurio.Windows/Aurio.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyTitle>Aurio Windows Library</AssemblyTitle>
<AssemblyTitle>Aurio Windows extension</AssemblyTitle>
<IsPackable>true</IsPackable>
<Description>Extension library for Aurio, which provides Windows-specific functionality (playback, NAudio MP3 decoder).</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 504e0df

Please sign in to comment.