Skip to content

Commit

Permalink
Changed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gingters committed Mar 28, 2020
1 parent ec85409 commit f011ad9
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Temporary package path
nugets/
8 changes: 8 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# We require the C++ toolchain to build the native lib
# as well as .NET core to build our library and samples.

make --directory ./rpi-rgb-led-matrix all
New-Item -Path ./rpi-rgb-led-matrix/lib/librgbmatrix.so -ItemType SymbolicLink -Value librgbmatrix.so.1 -ErrorAction SilentlyContinue

dotnet pack ./src/SharpPiLed/SharpPiLed.csproj -c Release -o ./nugets
dotnet build ./src/examples/Matrix/Matrix.csproj -c Release
44 changes: 44 additions & 0 deletions install-prereqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# go home
cd ~

echo "Download .NET Core SDK, ASP.NET Core Runtime and Powershell Core"
wget https://download.visualstudio.microsoft.com/download/pr/ccbcbf70-9911-40b1-a8cf-e018a13e720e/03c0621c6510f9c6f4cca6951f2cc1a4/dotnet-sdk-3.1.201-linux-arm.tar.gz
wget https://download.visualstudio.microsoft.com/download/pr/b68cde83-05c7-4421-ad9a-3e6f2cc53824/876dbfc9b4521d3ca89a226c6438ffc1/aspnetcore-runtime-3.1.3-linux-arm.tar.gz
wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm32.tar.gz

echo "Unpacking the SDK, runtime and powershell"
mkdir dotnet-arm32
tar zxf dotnet-sdk-3.1.201-linux-arm.tar.gz -C $HOME/dotnet-arm32
tar zxf aspnetcore-runtime-3.1.3-linux-arm.tar.gz -C $HOME/dotnet-arm32

mkdir powershell
tar zxf powershell-7.0.0-linux-arm32.tar.gz -C $HOME/powershell

echo "Cleanup downloaded files"
rm dotnet-sdk-3.1.201-linux-arm.tar.gz
rm aspnetcore-runtime-3.1.3-linux-arm.tar.gz
rm powershell-7.0.0-linux-arm32.tar.gz

# set .NET Core SDK and Runtime path
export DOTNET_ROOT=$HOME/dotnet-arm32
export PATH=$PATH:$HOME/dotnet-arm32;$HOME/powershell

echo "Add DOTNET_ROOT variable and dotnet to path in .profile"
echo "
# set PATH so it includes dotnet runtime if it exists
if [ -d \"\$HOME/dotnet-arm32\" ] ; then
DOTNET_ROOT=\"\$HOME/dotnet-arm32\"
PATH=\"\$PATH:\$HOME/dotnet-arm32\"
fi
" >> .profile

echo "Add powershell to path in .profile"
echo "
if [ -d \"\$HOME/powershell\" ] ; then
PATH=\"\$PATH:\$HOME/powershell\"
fi
" >> .profile

echo "Create a new shell, there you should be able to use dotnet and pwsh"
5 changes: 1 addition & 4 deletions src/SharpPiLed/SharpPiLed.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
</PropertyGroup>

<ItemGroup>
<None Include="../../rpi-rgb-led-matrix/lib/librgbmatrix.so.1">
<Link>%(Filename)</Link> <!-- drop the .1 -->
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="../../rpi-rgb-led-matrix/lib/librgbmatrix.so" Pack="True" PackagePath="runtimes/linux-arm/native" />
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion src/examples/Matrix/Matrix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
<RestoreAdditionalProjectSources>../../../nugets</RestoreAdditionalProjectSources>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\SharpPiLed\SharpPiLed.csproj" />
<PackageReference Include="SharpPiLed" Version="1.0.0" />
</ItemGroup>

</Project>

0 comments on commit f011ad9

Please sign in to comment.