AutoReqProv: no
BuildRequires: patchelf
+BuildRequires: mscorlib
+BuildRequires: corefx-managed
+BuildRequires: csapi-tizenfx-full
+BuildRequires: crossgen2-mic
Requires: corefx-managed-ref
Requires: libicu
%setup -q
mkdir -p dotnet/deps
+mkdir -p dotnet/crossgen2/ref
tar xvfz %{SOURCE21} -C dotnet
tar xvfz %{SOURCE22} -C dotnet/deps
+cp -rf /opt/usr/dotnet/mic/* dotnet/crossgen2
+cp -rf /usr/share/dotnet.tizen/netcoreapp/*.dll dotnet/crossgen2/ref
+cp -rf /usr/share/dotnet.tizen/framework/*.dll dotnet/crossgen2/ref
+
%build
# Prepare dotnet-sdk
%ifnarch x86_64
chmod 0755 ${file}
patchelf --set-rpath %{SDK_PATH}/deps/ ${file}
done
+
+# Prepare crossgen2
+chmod 0755 ./dotnet/crossgen2/* -R
+patchelf --set-interpreter %{SDK_PATH}/crossgen2/ld-linux-x86-64.so.2 ./dotnet/crossgen2/crossgen2
+patchelf --set-rpath %{SDK_PATH}/crossgen2/ ./dotnet/crossgen2/crossgen2
+for file in $( find ./dotnet/crossgen2 -type f \( -name "*.so" -or -name "*.so.*" \) -not -name "*.dbg" -not -name "ld-*.so*" )
+do
+ patchelf --set-rpath %{SDK_PATH}/crossgen2/ ${file}
+done
%endif
# overrides
cp -f overrides/Microsoft.Build.Tasks.Core.dll dotnet/sdk/*/Microsoft.Build.Tasks.Core.dll
%install
-
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{SDK_PATH}
ln -s %{TOOLS_PATH}/dotnet-build.sh %{buildroot}%{_bindir}/dotnet-build
ln -s %{TOOLS_PATH}/dotnet-wrapper.sh %{buildroot}%{_bindir}/dotnet
ln -s %{TOOLS_PATH}/dotnet-validate-struct.sh %{buildroot}%{_bindir}/dotnet-validate-struct
+ln -s %{SDK_PATH}/crossgen2/crossgen2 %{buildroot}%{_bindir}/crossgen2
+
+# Tizen.Pre.AOT.BuildTasks
+install -p -m 644 ./targets/Tizen.Pre.AOT.targets %{buildroot}%{SDK_PATH}/sdk/*/Current/Microsoft.Common.targets/ImportAfter
+install -p -m 644 ./targets/Tizen.Pre.AOT.Reference.targets %{buildroot}%{SDK_PATH}/sdk/*/Current/Microsoft.Common.targets/ImportAfter
%files
%config(noreplace) %{_sysconfdir}/rpm/macros.dotnet-build-tools
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Target Name="PreAOTReference"
+ AfterTargets="coreGenerateSatelliteAssemblies">
+
+ <PropertyGroup>
+ <AppReferencePath>@(ReferencePath)</AppReferencePath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Split Include="$(AppReferencePath.Split(';'))" />
+ </ItemGroup>
+
+ <Exec Command="mkdir -p $(IntermediateOutputPath)crossgen2/ref" />
+ <Exec Command="cp -rf %(Split.Identity) $(IntermediateOutputPath)crossgen2/ref/%(Filename)%(Extension)" Condition="'%(Split.Identity)' != ''" />
+ </Target>
+</Project>
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Target Name="PreAOT"
+ AfterTargets="_TizenPrepareTpkPackage"
+ BeforeTargets="TizenPrepareCertificate">
+
+ <PropertyGroup>
+ <TpkRootPath>$(OutputPath)tpkroot/</TpkRootPath>
+ <BinPath>$(TpkRootPath)bin/</BinPath>
+ <LibPath>$(TpkRootPath)lib/</LibPath>
+ <BinNativeImagePath>$(BinPath).native_image/</BinNativeImagePath>
+ <LibNativeImagePath>$(LibPath).native_image/</LibNativeImagePath>
+ </PropertyGroup>
+
+ <Exec Command ="find $(BinPath) -maxdepth 1 -name '*.dll'" ConsoleToMSBuild="true" >
+ <Output TaskParameter="ConsoleOutput" PropertyName="FindDllOfBin" />
+ </Exec>
+ <Exec Command ="find $(LibPath) -maxdepth 1 -name '*.dll'" ConsoleToMSBuild="true" >
+ <Output TaskParameter="ConsoleOutput" PropertyName="FindDllOfLib" />
+ </Exec>
+ <Exec Command ="find $(BinPath) -maxdepth 1 -name '*.pdb'" ConsoleToMSBuild="true" >
+ <Output TaskParameter="ConsoleOutput" PropertyName="FindPdbOfBin" />
+ </Exec>
+ <Exec Command ="find $(LibPath) -maxdepth 1 -name '*.pdb'" ConsoleToMSBuild="true" >
+ <Output TaskParameter="ConsoleOutput" PropertyName="FindPdbOfLib" />
+ </Exec>
+
+ <ItemGroup>
+ <DllListOfBin Include="$(FindDllOfBin)" />
+ </ItemGroup>
+ <ItemGroup>
+ <DllListOfLib Include="$(FindDllOfLib)" />
+ </ItemGroup>
+ <ItemGroup>
+ <PdbListOfBin Include="$(FindPdbOfBin)" />
+ </ItemGroup>
+ <ItemGroup>
+ <PdbListOfLib Include="$(FindPdbOfLib)" />
+ </ItemGroup>
+
+ <Exec Command="mkdir $(BinNativeImagePath)" Condition="@(DllListOfBin->Count()) != 0 OR @(PdbListOfBin->Count()) != 0" />
+ <Exec Command="mkdir $(LibNativeImagePath)" Condition="@(DllListOfLib->Count()) != 0 OR @(PdbListOfLib->Count()) != 0" />
+
+ <Exec Command="crossgen2 --jitpath /usr/share/dotnet-build-tools/sdk/crossgen2/libclrjit_unix_$(TizenGBSBuildArch)_x64.so --targetarch $(TizenGBSBuildArch) -o $(BinNativeImagePath)%(DllListOfBin.Filename).ni%(DllListOfBin.Extension) --resilient --Ot -r:/usr/share/dotnet-build-tools/sdk/crossgen2/ref/*.dll -r:$(IntermediateOutputPath)crossgen2/ref/*.dll %(DllListOfBin.Identity)" EnvironmentVariables="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" Condition="'$(TizenGBSBuildArch)' != '' and '%(DllListOfBin.Identity)' != ''" />
+ <Exec Command="crossgen2 --jitpath /usr/share/dotnet-build-tools/sdk/crossgen2/libclrjit_unix_$(TizenGBSBuildArch)_x64.so --targetarch $(TizenGBSBuildArch) -o $(LibNativeImagePath)%(DllListOfLib.Filename).ni%(DllListOfLib.Extension) --resilient --Ot -r:/usr/share/dotnet-build-tools/sdk/crossgen2/ref/*.dll -r:$(IntermediateOutputPath)crossgen2/ref/*.dll %(DllListOfLib.Identity)" EnvironmentVariables="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" Condition="'$(TizenGBSBuildArch)' != '' and '%(DllListOfLib.Identity)' != ''" />
+
+ <Exec Command="cp %(PdbListOfBin.Identity) $(BinNativeImagePath)" Condition="'%(PdbListOfBin.Identity)' != ''" />
+ <Exec Command="cp %(PdbListOfLib.Identity) $(LibNativeImagePath)" Condition="'%(PdbListOfLib.Identity)' != ''" />
+
+ <Exec Command="touch $(BinPath)._TIZEN_DOTNET_PRE_COMPILED_PACKAGE" />
+ </Target>
+</Project>