summaryrefslogtreecommitdiff
path: root/packaging/coreclr.spec
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:14:40 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-06-13 18:51:15 +0900
commit2a3c18d8ae9f5a3da5182dcc7cf981054508d89a (patch)
treee14d50348b8a36ae2323a86fd3916b7b30140a82 /packaging/coreclr.spec
parent61d6a817e39d3bae0f47dbc09838d51db22a5d30 (diff)
downloadcoreclr-2a3c18d8ae9f5a3da5182dcc7cf981054508d89a.tar.gz
coreclr-2a3c18d8ae9f5a3da5182dcc7cf981054508d89a.tar.bz2
coreclr-2a3c18d8ae9f5a3da5182dcc7cf981054508d89a.zip
Add packaging directory for building CoreCLR
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com> Change-Id: I548a41193800622ca782003171bcef0a9ce0c64d
Diffstat (limited to 'packaging/coreclr.spec')
-rw-r--r--packaging/coreclr.spec350
1 files changed, 350 insertions, 0 deletions
diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec
new file mode 100644
index 0000000000..e8f5a0aa97
--- /dev/null
+++ b/packaging/coreclr.spec
@@ -0,0 +1,350 @@
+%{!?dotnet_buildtype: %define dotnet_buildtype Release}
+
+%ifarch x86_64
+%define support_test 1
+%define skipnative 0
+%define skipmscorlib 0
+%endif
+
+%ifarch armv7l
+%define support_test 1
+%define skipnative 0
+%define skipmscorlib 0
+%endif
+
+Name: coreclr
+Version: 1.1.0
+Release: 0
+Summary: Microsoft .NET Runtime, Coreclr
+Group: Development/Languages
+License: MIT
+URL: http://github.com/dotnet/coreclr
+Source0: %{name}-%{version}.tar.gz
+Source1000: downloaded_files.tar.gz
+Source1001: %{name}.manifest
+# Gbp-Ignore-Patches: 0 1 2
+Patch0: Add-Tizen-distro.patch
+Patch1: Do-not-ignore-project.lock.json.patch
+Patch2: Support-managed-build-on-armv7l-env.patch
+
+BuildRequires: python
+BuildRequires: python-xml
+# libcoreclr.so
+BuildRequires: pkgconfig(libunwind)
+BuildRequires: pkgconfig(uuid)
+# System.Globalization.Native.so
+BuildRequires: libicu-devel
+BuildRequires: tizen-release
+
+%if 0%{skipnative}
+%else
+BuildRequires: cmake
+BuildRequires: llvm >= 3.8
+BuildRequires: llvm-devel >= 3.8
+#BuildRequires: libllvm >= 3.8
+BuildRequires: clang >= 3.8
+BuildRequires: clang-devel >= 3.8
+BuildRequires: lldb >= 3.8
+BuildRequires: lldb-devel >= 3.8
+BuildRequires: gettext-tools
+BuildRequires: libopenssl-devel
+# C include headers
+BuildRequires: libstdc++-devel
+%ifarch x86_64
+BuildRequires: pkgconfig(lttng-ust)
+%endif
+
+# The followings are suggested by Jan Kotas
+Requires: libunwind
+#(if you are debugging)
+#Requires: lldb >= 3.8
+%endif
+
+%if 0%{skipmscorlib}
+%else
+%ifarch armv7l
+BuildRequires: patchelf
+%endif
+%endif
+
+%description
+The CoreCLR repo contains the complete runtime implementation for .NET Core. It includes RyuJIT, the .NET GC, native interop and many other components. It is cross-platform, with multiple OS and CPU ports in progress.
+
+%package extra
+Summary: Dotnet Core Extra Files
+Requires: coreclr
+
+%description extra
+Libsosplugin and others
+
+%package test
+Summary: Dotnet Core Unit Test
+Requires: coreclr
+
+%description test
+Unit Test objs
+
+%package -n mscorlib
+Summary: Core Library for MS .NET
+Requires: coreclr
+
+%description -n mscorlib
+The MSCORLIB.DLL for .NET Core Runtime (coreclr)
+
+%prep
+%setup -q -n %{name}-%{version}
+cp %{SOURCE1001} .
+%if 0%{skipmscorlib}
+%else
+# Gbp-Patch-Macros
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+cp %{SOURCE1000} ./
+tar xf %{SOURCE1000}
+%ifarch armv7l
+patchelf --set-interpreter /emul/lib64/ld-linux-x86-64.so.2 ./Tools/dotnetcli/dotnet
+patchelf --set-rpath /emul/usr/lib64/ ./Tools/dotnetcli/dotnet
+patchelf --set-interpreter /emul/lib64/ld-linux-x86-64.so.2 ./Tools/dotnetcli/shared/Microsoft.NETCore.App/1.0.0-rc3-002733/dotnet
+patchelf --set-rpath /emul/usr/lib64/ ./Tools/dotnetcli/shared/Microsoft.NETCore.App/1.0.0-rc3-002733/dotnet
+for file in $( find ./Tools -iname "*.so" )
+do
+ patchelf --set-rpath /emul/usr/lib64/ $file
+done
+%endif
+%endif
+
+%build
+# NOTHING to build
+%ifarch x86_64
+# Even though build architectur is x86_64, it will be running on arm board.
+# So we need to pass the arch argument as arm.
+%define _barch %{?cross:%{cross}}%{!?cross:x64}
+
+%if 0%{skipnative}
+%else
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/:/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/
+export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib64/:/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/
+export CFLAGS="-B/usr/local/lib64/ -B/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/"
+export CPPFLAGS="-B/usr/local/lib64/ -B/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/"
+export CXXFLAGS="-B/usr/local/lib64/ -B/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/"
+export CPLUS_INCLUDE_PATH="/usr/local/include/llvm/:/usr/local/include/llvm-c/:/usr/local/lib64/clang/3.8.1/include/:/usr/include/:/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/include/:/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/include/c++/:/usr/lib64/gcc/x86_64-tizen-linux-gnu/4.9.2/include/c++/x86_64-tizen-linux-gnu/"
+export C_INCLUDE_PATH="/usr/local/include/llvm-c/:/usr/include/"
+%endif
+
+%else
+%ifarch aarch64
+%define _barch arm64
+
+%if 0%{skipnative}
+%else
+# BEWARE: NOT EVER TESTED.
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/gcc/aarch64-tizen-linux/4.9
+export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib64/gcc/aarch64-tizen-linux-gnueabi/4.9
+export CFLAGS="-B/usr/lib64/llvm/ -B/usr/lib64/gcc/aarch64-tizen-linux-gnueabi/4.9/"
+export CPPFLAGS="-B/usr/lib64/llvm/ -B/usr/lib64/gcc/aarch64-tizen-linux-gnueabi/4.9/"
+export CXXFLAGS="-B/usr/lib64/llvm/ -B/usr/lib64/gcc/aarch64-tizen-linux-gnueabi/4.9/"
+export CPLUS_INCLUDE_PATH="/usr/include/llvm/:/usr/include/llvm-c/:/usr/include/c++/4.9/:/usr/include/c++/4.9/backward:/usr/include/c++/4.9/aarch64-tizen-linux-gnueabi/:/usr/local/include:/usr/lib/clang/3.6.0/include/:/usr/include/"
+export C_INCLUDE_PATH="/usr/include/llvm-c/:/usr/include/"
+%endif
+
+%else
+%ifarch i586
+%define _barch x86
+
+%if 0%{skipnative}
+%else
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/gcc/i586-tizen-linux/4.9
+export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/gcc/i586-tizen-linux/4.9
+export CFLAGS="-B/usr/lib/llvm/ -B/usr/lib/gcc/i586-tizen-linux/4.9/"
+export CPPFLAGS="-B/usr/lib/llvm/ -B/usr/lib/gcc/i586-tizen-linux/4.9/"
+export CXXFLAGS="-B/usr/lib/llvm/ -B/usr/lib/gcc/i586-tizen-linux/4.9/"
+export CPLUS_INCLUDE_PATH="/usr/include/llvm/:/usr/include/llvm-c/:/usr/include/c++/4.9/:/usr/include/c++/4.9/backward:/usr/include/c++/4.9/i586-tizen-linux/:/usr/local/include:/usr/lib/clang/3.6.0/include/:/usr/include/"
+export C_INCLUDE_PATH="/usr/include/llvm-c/:/usr/include/"
+%endif
+
+%else
+%ifarch armv7l
+%define _barch arm-softfp
+
+%if 0%{skipnative}
+%else
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2
+export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2
+export CFLAGS="-U__GNUC_MINOR__ -D__GNUC_MINOR__=3 -B/usr/local/lib/ -B/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/ -O2 --param=ssp-buffer-size=32 -fdiagnostics-color=never -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -Wp,-D__SOFTFP__ -Wno-error=inline-asm -integrated-as -Wno-ignored-attributes -Wno-switch-enum -Wno-switch -Wno-error=switch -Wno-error=switch-enum -w"
+export CPPFLAGS="-U__GNUC_MINOR__ -D__GNUC_MINOR__=3 -B/usr/local/lib/ -B/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/ -O2 --param=ssp-buffer-size=32 -fdiagnostics-color=never -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -Wp,-D__SOFTFP__ -Wno-error=inline-asm -integrated-as -Wno-ignored-attributes -Wno-switch-enum -Wno-switch -Wno-error=switch -Wno-error=switch-enum -w"
+export CXXFLAGS="-U__GNUC_MINOR__ -D__GNUC_MINOR__=3 -B/usr/local/lib/ -B/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/ -O2 --param=ssp-buffer-size=32 -fdiagnostics-color=never -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -Wp,-D__SOFTFP__ -Wno-error=inline-asm -integrated-as -Wno-ignored-attributes -Wno-switch-enum -Wno-switch -Wno-error=switch -Wno-error=switch-enum -w"
+export CPLUS_INCLUDE_PATH="/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/:/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/armv7l-tizen-linux-gnueabi/:/usr/local/include/llvm/:/usr/local/include/llvm-c/:/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/:/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/backward:/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/armv7l-tizen-linux-gnueabi/:/usr/local/include:/usr/include/"
+export C_INCLUDE_PATH="/usr/local/include/llvm-c/:/usr/include/"
+%endif
+
+%else
+# write the paths in general!
+
+%endif
+%endif
+%endif
+%endif
+
+%define _buildtype %{dotnet_buildtype}
+%define _reldir bin/Product/Linux.%{_barch}.%{_buildtype}
+%define _clrdebug 0
+%define _paldebug 0
+
+%if 0%{support_test}
+%define testopt ''
+%else
+%define testopt 'skiptests'
+%endif
+
+%if 0%{_clrdebug}
+export COMPlus_LogEnable=1
+export COMPlus_LogLevel=10
+export COMPlus_LogToFile=1
+export COMPlus_LogFile="clr.log"
+%else
+export COMPlus_LogEnable=0
+%endif
+
+%if 0%{_paldebug}
+export PAL_DBG_CHANNELS="+all.all"
+export PAL_DBG_CHANNELS="+PAL.TRACE:-FILE.ERROR"
+export PAL_API_TRACING="pal.log"
+%else
+export PAL_DBG_CHANNELS=""
+%endif
+
+%if 0%{skipmscorlib}
+%if 0%{skipnative}
+# No build native and mscorlib.
+%else
+# Build native only.
+./build.sh %{_barch} %{_buildtype} clang3.8 skipmscorlib skipgenerateversion skipnuget %{testopt} cmakeargs -DFEATURE_GDBJIT=TRUE
+%endif
+%else
+%if 0%{skipnative}
+# Build mscorlib only.
+./build.sh %{_barch} %{_buildtype} -skiprestore skipnative skipnuget %{testopt}
+%else
+# Build native and mscorlib.
+./build.sh %{_barch} %{_buildtype} clang3.8 skipgenerateversion -skiprestore skipnuget %{testopt} cmakeargs -DFEATURE_GDBJIT=TRUE
+%endif
+%endif
+
+%install
+# .NET Core Runtime
+%define dotnetdir dotnet
+%define netshareddir %{dotnetdir}/shared
+%define netcoreappdir %{netshareddir}/Microsoft.NETCore.App/1.1.0
+mkdir -p %{buildroot}/opt/usr/share/%{netcoreappdir}
+
+# .NET Tizen Runtime
+%define dotnettizendir dotnet.tizen
+%define dotnetfwdir %{dotnettizendir}/framework
+%define dotnettestdir %{dotnettizendir}/test
+mkdir -p %{buildroot}/opt/usr/share/%{dotnettizendir}
+mkdir -p %{buildroot}/opt/usr/share/%{dotnetfwdir}
+mkdir -p %{buildroot}/opt/usr/share/%{dotnettestdir}
+
+# .NET & Mono CoreOverlay
+%define tizennetdir tizen.net
+%define tizenmonodir tizen.mono
+mkdir -p %{buildroot}/opt/usr/share/%{tizennetdir}
+mkdir -p %{buildroot}/opt/usr/share/%{tizenmonodir}
+
+%if 0%{skipnative}
+%else
+cp %{_reldir}/corerun %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libclrjit.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libcoreclr.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libdbgshim.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libmscordaccore.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libmscordbi.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libsos.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/libsosplugin.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/System.Globalization.Native.so %{buildroot}/opt/usr/share/%{netcoreappdir}
+ln -sf ../%{netcoreappdir}/corerun %{buildroot}/opt/usr/share/%{dotnetdir}/corerun
+
+# make link for .NET CoreOverlay
+ln -sf ../%{netcoreappdir}/corerun %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libclrjit.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libcoreclr.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libdbgshim.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libmscordaccore.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libmscordbi.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libsos.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/libsosplugin.so %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/System.Globalization.Native.so %{buildroot}/opt/usr/share/%{tizennetdir}
+
+# extra
+cp %{_reldir}/coreconsole %{buildroot}/opt/usr/share/%{dotnetfwdir}
+cp %{_reldir}/crossgen %{buildroot}/opt/usr/share/%{dotnetfwdir}
+cp %{_reldir}/ilasm %{buildroot}/opt/usr/share/%{dotnetfwdir}
+cp %{_reldir}/ildasm %{buildroot}/opt/usr/share/%{dotnetfwdir}
+
+# test
+cp -rf bin/obj/Linux.%{_barch}.%{_buildtype}/tests/src %{buildroot}/opt/usr/share/%{dotnettestdir}
+
+# make linke to /usr/share
+mkdir -p %{buildroot}%{_datadir}
+ln -sf /opt/usr/share/%{dotnetdir} %{buildroot}%{_datadir}/
+ln -sf /opt/usr/share/%{dotnettizendir} %{buildroot}%{_datadir}/
+ln -sf /opt/usr/share/%{tizennetdir} %{buildroot}%{_datadir}/
+%endif
+
+%if 0%{skipmscorlib}
+%else
+cp %{_reldir}/mscorlib.dll %{buildroot}/opt/usr/share/%{netcoreappdir}
+#cp %{_reldir}/mscorlib.ni.dll %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/System.Private.CoreLib.dll %{buildroot}/opt/usr/share/%{netcoreappdir}
+#cp %{_reldir}/System.Private.CoreLib.ni.dll %{buildroot}/opt/usr/share/%{netcoreappdir}
+cp %{_reldir}/SOS.NETCore.dll %{buildroot}/opt/usr/share/%{netcoreappdir}
+
+# make link for .NET CoreOverlay
+ln -sf ../%{netcoreappdir}/mscorlib.dll %{buildroot}/opt/usr/share/%{tizennetdir}
+#ln -sf ../%{netcoreappdir}/mscorlib.ni.dll %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/System.Private.CoreLib.dll %{buildroot}/opt/usr/share/%{tizennetdir}
+#ln -sf ../%{netcoreappdir}/System.Private.CoreLib.ni.dll %{buildroot}/opt/usr/share/%{tizennetdir}
+ln -sf ../%{netcoreappdir}/SOS.NETCore.dll %{buildroot}/opt/usr/share/%{tizennetdir}
+%endif
+
+%if 0%{skipnative}
+%else
+%files
+%manifest %{name}.manifest
+%dir /opt/usr/share/%{dotnetdir}
+%dir /opt/usr/share/%{netcoreappdir}
+%dir /opt/usr/share/%{tizennetdir}
+/opt/usr/share/%{netcoreappdir}/corerun
+/opt/usr/share/%{netcoreappdir}/*.so
+/opt/usr/share/%{tizennetdir}/*
+/opt/usr/share/%{dotnetdir}/corerun
+%dir %{_datadir}/%{dotnetdir}
+%dir %{_datadir}/%{dotnettizendir}
+%dir %{_datadir}/%{tizennetdir}
+
+%files extra
+%manifest %{name}.manifest
+%dir /opt/usr/share/%{dotnetfwdir}
+/opt/usr/share/%{dotnetfwdir}/*
+
+%files test
+%manifest %{name}.manifest
+%dir /opt/usr/share/%{dotnettestdir}
+/opt/usr/share/%{dotnettestdir}/*
+%endif
+
+%if 0%{skipmscorlib}
+%else
+%files -n mscorlib
+%manifest %{name}.manifest
+%dir /opt/usr/share/%{dotnetdir}
+%dir /opt/usr/share/%{netcoreappdir}
+%dir /opt/usr/share/%{tizennetdir}
+/opt/usr/share/%{netcoreappdir}/*.dll
+/opt/usr/share/%{tizennetdir}/*.dll
+%endif
+
+%changelog
+* Fri Jan 22 2016 MyungJoo Ham <myungjoo.ham@samsung.com> - 0.0.1-1
+- Initial spec file for corerun