New: FreeBSD Support

Co-authored-by: Mark McDowall <mark@mcdowall.ca>
This commit is contained in:
Qstick 2022-12-02 17:58:39 -06:00 committed by Mark McDowall
parent aaaf18aec3
commit 3b10400948
3 changed files with 30 additions and 14 deletions

View File

@ -29,12 +29,19 @@ UpdateVersionNumber()
fi fi
} }
EnableBsdSupport() EnableExtraPlatformsInSDK()
{ {
#todo enable sdk with BUNDLEDVERSIONS="${SDK_PATH}/Microsoft.NETCoreSdk.BundledVersions.props"
#SDK_PATH=$(dotnet --list-sdks | grep -P '5\.\d\.\d+' | head -1 | sed 's/\(5\.[0-9]*\.[0-9]*\).*\[\(.*\)\]/\2\/\1/g') if grep -q freebsd-x64 "$BUNDLEDVERSIONS"; then
# BUNDLED_VERSIONS="${SDK_PATH}/Microsoft.NETCoreSdk.BundledVersions.props" echo "Extra platforms already enabled"
else
echo "Enabling extra platform support"
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64/' "$BUNDLEDVERSIONS"
fi
}
EnableExtraPlatforms()
{
if grep -qv freebsd-x64 src/Directory.Build.props; then if grep -qv freebsd-x64 src/Directory.Build.props; then
sed -i'' -e "s^<RuntimeIdentifiers>\(.*\)</RuntimeIdentifiers>^<RuntimeIdentifiers>\1;freebsd-x64</RuntimeIdentifiers>^g" src/Directory.Build.props sed -i'' -e "s^<RuntimeIdentifiers>\(.*\)</RuntimeIdentifiers>^<RuntimeIdentifiers>\1;freebsd-x64</RuntimeIdentifiers>^g" src/Directory.Build.props
fi fi
@ -318,7 +325,8 @@ if [ $# -eq 0 ]; then
FRONTEND=YES FRONTEND=YES
PACKAGES=YES PACKAGES=YES
LINT=YES LINT=YES
ENABLE_BSD=NO ENABLE_EXTRA_PLATFORMS=NO
ENABLE_EXTRA_PLATFORMS_IN_SDK=NO
fi fi
while [[ $# -gt 0 ]] while [[ $# -gt 0 ]]
@ -330,8 +338,12 @@ case $key in
BACKEND=YES BACKEND=YES
shift # past argument shift # past argument
;; ;;
--enable-bsd) --enable-bsd|--enable-extra-platforms)
ENABLE_BSD=YES ENABLE_EXTRA_PLATFORMS=YES
shift # past argument
;;
--enable-extra-platforms-in-sdk)
ENABLE_EXTRA_PLATFORMS_IN_SDK=YES
shift # past argument shift # past argument
;; ;;
-r|--runtime) -r|--runtime)
@ -371,13 +383,17 @@ esac
done done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
if [ "$ENABLE_EXTRA_PLATFORMS_IN_SDK" = "YES" ];
then
EnableExtraPlatformsInSDK
fi
if [ "$BACKEND" = "YES" ]; if [ "$BACKEND" = "YES" ];
then then
UpdateVersionNumber UpdateVersionNumber
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
if [ "$ENABLE_BSD" = "YES" ];
then then
EnableBsdSupport EnableExtraPlatforms
fi fi
Build Build
@ -389,7 +405,7 @@ then
PackageTests "net6.0" "linux-x64" PackageTests "net6.0" "linux-x64"
PackageTests "net6.0" "linux-musl-x64" PackageTests "net6.0" "linux-musl-x64"
PackageTests "net6.0" "osx-x64" PackageTests "net6.0" "osx-x64"
if [ "$ENABLE_BSD" = "YES" ]; if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
then then
PackageTests "net6.0" "freebsd-x64" PackageTests "net6.0" "freebsd-x64"
fi fi
@ -428,7 +444,7 @@ then
Package "net6.0" "linux-arm" Package "net6.0" "linux-arm"
Package "net6.0" "osx-x64" Package "net6.0" "osx-x64"
Package "net6.0" "osx-arm64" Package "net6.0" "osx-arm64"
if [ "$ENABLE_BSD" = "YES" ]; if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
then then
Package "net6.0" "freebsd-x64" Package "net6.0" "freebsd-x64"
fi fi

View File

@ -7,7 +7,7 @@
See https://github.com/xamarin/XamarinComponents/issues/282 See https://github.com/xamarin/XamarinComponents/issues/282
--> -->
<ItemGroup> <ItemGroup>
<PackageReference Include="Mono.Posix.NETStandard" Version="5.20.1.34-servarr18" /> <PackageReference Include="Mono.Posix.NETStandard" Version="5.20.1.34-servarr24" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\NzbDrone.Common.Test\Sonarr.Common.Test.csproj" /> <ProjectReference Include="..\NzbDrone.Common.Test\Sonarr.Common.Test.csproj" />

View File

@ -8,7 +8,7 @@
See https://github.com/xamarin/XamarinComponents/issues/282 See https://github.com/xamarin/XamarinComponents/issues/282
--> -->
<ItemGroup> <ItemGroup>
<PackageReference Include="Mono.Posix.NETStandard" Version="5.20.1.34-servarr18" /> <PackageReference Include="Mono.Posix.NETStandard" Version="5.20.1.34-servarr24" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="6.0.0-preview.5.21301.5" /> <PackageReference Include="System.IO.FileSystem.AccessControl" Version="6.0.0-preview.5.21301.5" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>