forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotnet.rb
36 lines (30 loc) · 1.48 KB
/
dotnet.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cask 'dotnet' do
version '1.0.0-preview2-1-003177,1.1.0'
sha256 'be009582107b6eb58196a1e417e02c11d7da182669cd47a4c2a42f512e112fea'
url "https://download.microsoft.com/download/1/4/1/141760B3-805B-4583-B17C-8C5BC5A876AB/Installers/dotnet-dev-osx-x64.#{version.before_comma}.pkg"
name '.Net Core'
homepage 'https://www.microsoft.com/net/core#macos'
depends_on formula: 'openssl'
pkg "dotnet-dev-osx-x64.#{version.before_comma}.pkg"
# Patch .NET Core to use the latest version of OpenSSL installed via Homebrew.
# https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#openssl
postflight do
dotnet_core = "/usr/local/share/dotnet/shared/Microsoft.NETCore.App/#{version.after_comma}"
system_command '/usr/bin/install_name_tool',
args: [
"#{dotnet_core}/System.Security.Cryptography.Native.OpenSsl.dylib",
'-add_rpath', "#{HOMEBREW_PREFIX}/opt/openssl/lib"
],
sudo: true
system_command '/usr/bin/install_name_tool',
args: [
"#{dotnet_core}/System.Net.Http.Native.dylib",
'-change', '/usr/lib/libcurl.4.dylib',
"#{HOMEBREW_PREFIX}/opt/curl/lib/libcurl.4.dylib"
],
sudo: true
end
uninstall pkgutil: 'com.microsoft.dotnet.*',
delete: '/etc/paths.d/dotnet'
zap delete: '~/.nuget'
end