commit:     c57b8288fc08194c8c01144608bf4d8c1ac9edfe
Author:     Eddy Zavaleta <eddy <AT> mictlanix <DOT> com>
AuthorDate: Thu Mar 23 05:21:19 2017 +0000
Commit:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
CommitDate: Thu Mar 23 05:21:19 2017 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=c57b8288

Add dotnet-cli 1.1.1 for .NET Core SDK with .NET Core 1.0.4 and .NET Core 1.1.1

 dev-dotnet/dotnet-cli/dotnet-cli-1.1.1.ebuild      | 187 +++++++++++++++++++++
 .../files/coreclr-1.0.6-icu57-commit-352df35.patch |  42 +++++
 .../dotnet-cli/files/corefx-1.1.1-buildtools.patch |  13 ++
 .../files/corefx-1.1.1-init-tools-script.patch     |  38 +++++
 .../dotnet-cli/files/corefx-1.1.1-run-script.patch |  11 ++
 5 files changed, 291 insertions(+)

diff --git a/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1.ebuild 
b/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1.ebuild
new file mode 100644
index 0000000..eeadb37
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1.ebuild
@@ -0,0 +1,187 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#BASED ON https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=dotnet-cli
+
+EAPI="6"
+
+CORE_V1_0=1.0.3
+CLI_V1_0=1.0.0-preview2-003156
+CORECLR_V1_0=1.0.6
+COREFX_V1_0=1.0.4
+
+DIST='debian-x64'
+
+COREFX=corefx-${COREFX_V}
+
+DESCRIPTION=".NET Core cli utility for building, testing, packaging and 
running projects"
+HOMEPAGE="https://www.microsoft.com/net/core";
+LICENSE="MIT"
+
+IUSE=""
+SRC_URI="https://github.com/dotnet/coreclr/archive/v${CORECLR_V1_0}.tar.gz -> 
coreclr-${CORECLR_V1_0}.tar.gz
+       https://github.com/dotnet/corefx/archive/v${COREFX_V1_0}.tar.gz -> 
corefx-${COREFX_V1_0}.tar.gz
+       
https://download.microsoft.com/download/0/3/0/030449F5-F093-44A6-9889-E19B50A59777/sdk/dotnet-dev-${DIST}.${CLI_V1_0}.tar.gz
+       https://github.com/dotnet/coreclr/archive/v${PV}.tar.gz -> 
coreclr-${PV}.tar.gz
+       https://github.com/dotnet/corefx/archive/v${PV}.tar.gz -> 
corefx-${PV}.tar.gz
+       
https://download.microsoft.com/download/F/D/5/FD52A2F7-65B6-4912-AEDD-4015DF6D8D22/dotnet-${PV}-sdk-${DIST}.tar.gz";
+
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       >=sys-devel/llvm-3.7.1-r3[lldb]
+       >=sys-libs/libunwind-1.1-r1
+       >=dev-libs/icu-57.1
+       >=dev-util/lttng-ust-2.8.1
+       >=dev-libs/openssl-1.0.2h-r2
+       >=net-misc/curl-7.49.0
+       >=app-crypt/mit-krb5-1.14.2
+       >=sys-libs/zlib-1.2.8-r1 "
+DEPEND="${RDEPEND}
+       >=dev-util/cmake-3.3.1-r1
+       >=sys-devel/make-4.1-r1
+       >=sys-devel/clang-3.7.1-r100
+       >=sys-devel/gettext-0.19.7"
+
+PATCHES=(
+       "${FILESDIR}/coreclr-${CORECLR_V1_0}-icu57-commit-352df35.patch"
+       "${FILESDIR}/corefx-${PV}-init-tools-script.patch"
+       "${FILESDIR}/corefx-${PV}-run-script.patch"
+)
+
+S=${WORKDIR}
+CLI_1_0_S="${S}/tools-dotnet"
+CORECLR_1_0_S="${S}/coreclr-${CORECLR_V1_0}"
+COREFX_1_0_S="${S}/corefx-${COREFX_V1_0}"
+CLI_S="${S}/dotnetcli-${PV}"
+CORECLR_S="${S}/coreclr-${PV}"
+COREFX_S="${S}/corefx-${PV}"
+
+CORECLR_FILES=(
+       'libclrjit.so'
+       'libcoreclr.so'
+       'libcoreclrtraceptprovider.so'
+       'libdbgshim.so'
+       'libmscordaccore.so'
+       'libmscordbi.so'
+       'libsos.so'
+       'libsosplugin.so'
+       'System.Globalization.Native.so'
+)
+
+COREFX_FILES=(
+       'System.IO.Compression.Native.so'
+       'System.Native.a'
+       'System.Native.so'
+       'System.Net.Http.Native.so'
+       'System.Net.Security.Native.so'
+)
+
+CRYPTO_V1_0_FILES=(
+       'System.Security.Cryptography.Native.so'
+)
+
+CRYPTO_FILES=(
+       'System.Security.Cryptography.Native.OpenSsl.so'
+)
+
+src_unpack() {
+       unpack "coreclr-${CORECLR_V1_0}.tar.gz" "corefx-${COREFX_V1_0}.tar.gz" 
"coreclr-${PV}.tar.gz" "corefx-${PV}.tar.gz"
+       mkdir "${CLI_1_0_S}" "${CLI_S}" || die
+       cd "${CLI_S}" || die
+       unpack "dotnet-${PV}-sdk-${DIST}.tar.gz"
+       cd "${CLI_1_0_S}" || die
+       unpack "dotnet-dev-${DIST}.${CLI_V1_0}.tar.gz"
+}
+
+src_prepare() {
+       cp "${FILESDIR}/corefx-${PV}-buildtools.patch" 
"${COREFX_S}/buildtools.patch"
+
+       for file in "${CORECLR_FILES[@]}"; do
+               rm "${CLI_S}/shared/Microsoft.NETCore.App/${PV}/${file}"
+               rm "${CLI_S}/shared/Microsoft.NETCore.App/1.0.4/${file}"
+               rm 
"${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/${file}"
+       done
+
+       for file in "${COREFX_FILES[@]}"; do
+               rm "${CLI_S}/shared/Microsoft.NETCore.App/${PV}/${file}"
+               rm "${CLI_S}/shared/Microsoft.NETCore.App/1.0.4/${file}"
+               rm 
"${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/${file}"
+       done
+
+       for file in "${CRYPTO_FILES[@]}"; do
+               rm "${CLI_S}/shared/Microsoft.NETCore.App/${PV}/${file}"
+       done
+       
+       for file in "${CRYPTO_V1_0_FILES[@]}"; do
+               rm "${CLI_S}/shared/Microsoft.NETCore.App/1.0.4/${file}"
+               rm 
"${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/${file}"
+       done
+
+       default_src_prepare
+}
+
+src_compile() {
+       local dest="${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/"
+
+       cd "${COREFX_1_0_S}" || die
+       ./build.sh native x64 release || die
+
+       for file in "${COREFX_FILES[@]}"; do
+               cp -pP "${COREFX_1_0_S}/bin/Linux.x64.Release/Native/${file}" 
"${dest}" || die
+       done
+
+       for file in "${CRYPTO_V1_0_FILES[@]}"; do
+               cp -pP "${COREFX_1_0_S}/bin/Linux.x64.Release/Native/${file}" 
"${dest}" || die
+       done
+
+       cd "${S}" || die
+       rm -rf "${COREFX_1_0_S}" || die
+
+       cd "${CORECLR_1_0_S}" || die
+       ./build.sh x64 release || die
+
+       for file in "${CORECLR_FILES[@]}"; do
+               cp -pP "${CORECLR_1_0_S}/bin/Product/Linux.x64.Release/${file}" 
"${dest}" || die
+       done
+
+       cd "${S}" || die
+       rm -rf "${CORECLR_1_0_S}" || die
+
+       cd "${COREFX_S}" || die
+       ./build-native.sh -release || die
+
+       cd "${CORECLR_S}" || die
+       ./build.sh x64 release || die
+}
+
+src_install() {
+       local dest="/opt/dotnet_cli"
+       local ddest="${D}/${dest}"
+       local ddest_core="${ddest}/shared/Microsoft.NETCore.App"
+
+       dodir "${dest}"
+       cp -pPR "${CLI_S}"/* "${ddest}" || die
+
+       for file in "${CORECLR_FILES[@]}"; do
+               cp -pP "${CORECLR_S}/bin/Product/Linux.x64.Release/${file}" 
"${ddest_core}/${PV}/" || die
+               cp -pP "${CORECLR_S}/bin/Product/Linux.x64.Release/${file}" 
"${ddest_core}/1.0.4/" || die
+       done
+
+       for file in "${COREFX_FILES[@]}"; do
+               cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" 
"${ddest_core}/${PV}/" || die
+               cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" 
"${ddest_core}/1.0.4/" || die
+       done
+
+       for file in "${CRYPTO_FILES[@]}"; do
+               cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" 
"${ddest_core}/${PV}/" || die
+       done
+
+       for file in "${CRYPTO_V1_0_FILES[@]}"; do
+               cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" 
"${ddest_core}/1.0.4/" || die
+       done
+
+       dosym "../../opt/dotnet_cli/dotnet" "/usr/bin/dotnet"
+}

diff --git 
a/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-icu57-commit-352df35.patch 
b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-icu57-commit-352df35.patch
new file mode 100644
index 0000000..9cf81c7
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-icu57-commit-352df35.patch
@@ -0,0 +1,42 @@
+From 352df35c124104586ee4c977556cb50ce720af62 Mon Sep 17 00:00:00 2001
+From: Peter Jas <[email protected]>
+Date: Mon, 30 May 2016 12:54:02 +0300
+Subject: [PATCH] Fix ucol_setMaxVariable detection for Gentoo Linux (#5309)
+
+The issue was the symbol is exported by the ICU lib. Including headers
+was not enough. The linker requires the libraries to succeed.
+
+With this fix, CoreCLR successfully builds on Gentoo Linux 100%.
+Tested with LXC gentoo container on Ubuntu machine.
+
+Steps to configure and build:
+https://gist.github.com/jasonwilliams200OK/1a2e2c0e904ffa95faf6333fcd88d9b8
+
+Fix #5160
+---
+ src/corefx/System.Globalization.Native/configure.cmake | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/corefx/System.Globalization.Native/configure.cmake 
b/src/corefx/System.Globalization.Native/configure.cmake
+index 4250c7c..138127e 100644
+--- a/coreclr-1.0.6/src/corefx/System.Globalization.Native/configure.cmake
++++ b/coreclr-1.0.6/src/corefx/System.Globalization.Native/configure.cmake
+@@ -8,11 +8,18 @@ CHECK_CXX_SOURCE_COMPILES("
+     int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
+ " HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
+ 
++if(NOT CLR_CMAKE_PLATFORM_DARWIN)
++    set(CMAKE_REQUIRED_LIBRARIES ${ICUUC} ${ICUI18N})
++else()
++    set(CMAKE_REQUIRED_LIBRARIES ${ICUCORE})
++endif()
++
+ check_symbol_exists(
+     ucol_setMaxVariable
+     "unicode/ucol.h"
+     HAVE_SET_MAX_VARIABLE)
+ 
++unset(CMAKE_REQUIRED_LIBRARIES)
+ unset(CMAKE_REQUIRED_INCLUDES)
+ 
+ configure_file(

diff --git a/dev-dotnet/dotnet-cli/files/corefx-1.1.1-buildtools.patch 
b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-buildtools.patch
new file mode 100644
index 0000000..a0d5401
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-buildtools.patch
@@ -0,0 +1,13 @@
+--- 
packages/Microsoft.DotNet.BuildTools/1.0.26-prerelease-01121-01/lib/init-tools.sh.orig
     2017-03-11 18:38:23.022702000 -0600
++++ 
packages/Microsoft.DotNet.BuildTools/1.0.26-prerelease-01121-01/lib/init-tools.sh
  2017-03-11 18:43:47.093702000 -0600
+@@ -47,7 +47,9 @@
+                 if [[ "$ID" == "ubuntu" && "$VERSION_ID" != "14.04" && 
"$VERSION_ID" != "16.04" ]]; then
+                 echo "Unsupported Ubuntu version, falling back to Ubuntu 
14.04"
+                 __PUBLISH_RID=ubuntu.14.04-x64
+-                else
++              elif [[ "$ID" == "gentoo" ]]; then
++              __PUBLISH_RID=debian.8-x64
++              else
+                 __PUBLISH_RID=$ID.$VERSION_ID-x64
+                 fi
+             fi

diff --git a/dev-dotnet/dotnet-cli/files/corefx-1.1.1-init-tools-script.patch 
b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-init-tools-script.patch
new file mode 100644
index 0000000..5aa483c
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-init-tools-script.patch
@@ -0,0 +1,38 @@
+--- a/corefx-1.1.1/init-tools.sh       2017-03-11 23:35:22.604691000 -0600
++++ b/corefx-1.1.1/init-tools.sh       2017-03-11 23:39:11.945691000 -0600
+@@ -4,7 +4,7 @@
+ __init_tools_log=$__scriptpath/init-tools.log
+ __PACKAGES_DIR=$__scriptpath/packages
+ __TOOLRUNTIME_DIR=$__scriptpath/Tools
+-__DOTNET_PATH=$__TOOLRUNTIME_DIR/dotnetcli
++__DOTNET_PATH=$__scriptpath/../tools-dotnet
+ __DOTNET_CMD=$__DOTNET_PATH/dotnet
+ if [ -z "$__BUILDTOOLS_SOURCE" ]; then 
__BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json;
 fi
+ __BUILD_TOOLS_PACKAGE_VERSION=$(cat $__scriptpath/BuildToolsVersion.txt)
+@@ -59,8 +59,7 @@
+         fi
+     fi
+ 
+-    # Cannot determine Linux distribution, assuming Ubuntu 14.04.
+-    echo "ubuntu"
++    echo "debian"
+     return 0
+ }
+ 
+@@ -87,6 +86,7 @@
+ fi
+ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
+     if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi
++    mkdir -p $__TOOLRUNTIME_DIR
+     echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log
+     if [ ! -e $__DOTNET_PATH ]; then
+         echo "Installing dotnet cli..."
+@@ -116,6 +116,8 @@
+         if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: 
Could not restore build tools correctly. See '$__init_tools_log' for more 
details."1>&2; fi
+     fi
+ 
++    patch -p0 < buildtools.patch
++
+     echo "Initializing BuildTools..."
+     echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath 
$__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
+     $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD 
$__TOOLRUNTIME_DIR >> $__init_tools_log

diff --git a/dev-dotnet/dotnet-cli/files/corefx-1.1.1-run-script.patch 
b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-run-script.patch
new file mode 100644
index 0000000..3ad2d06
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-run-script.patch
@@ -0,0 +1,11 @@
+--- a/corefx-1.1.1/run.sh      2017-03-11 23:35:39.378691000 -0600
++++ b/corefx-1.1.1/run.sh      2017-03-11 23:39:52.885691000 -0600
+@@ -7,7 +7,7 @@
+ fi
+ 
+ __toolRuntime=$__scriptpath/Tools
+-__dotnet=$__toolRuntime/dotnetcli/dotnet
++__dotnet=$__scriptpath/../tools-dotnet/dotnet
+ 
+ $__dotnet $__toolRuntime/run.exe $*
+ exit $?

Reply via email to