Skip to content

Commit 6ed48ed

Browse files
committed
Initial fix
1 parent 6643b07 commit 6ed48ed

File tree

2 files changed

+29
-43
lines changed

2 files changed

+29
-43
lines changed

templates/chocolateyInstall-Template.ps1

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Chocolatey GHC Dev
22
#
33
# Licensed under the MIT License
4-
#
4+
#
55
# Copyright (C) 2016 Tamar Christina <tamar@zhox.com>
66

77
# Include the shared scripts
@@ -18,11 +18,11 @@ if ($arch -eq 'x86') {
1818
$checksumType = 'SHA1'
1919
}
2020

21-
# Continue with package
21+
# Continue with package
2222
Write-Host "Installing to '$packageDir'"
2323
Install-ChocolateyZipPackage $packageName $url $packageDir `
2424
-checksum $checksum -checksumType $checksumType
25-
25+
2626
# check if .tar.xz was only unzipped to tar file
2727
# (shall work better with newer choco versions)
2828
$tarFile = Join-Path $packageDir ($packageName + 'Install')
@@ -39,13 +39,16 @@ execute "Processing MSYS2 bash for first time use" `
3939

4040
execute "Appending profile with path information" `
4141
('echo "export PATH=/mingw' + $osBitness + '/bin:\$PATH" >>~/.bash_profile')
42-
42+
4343
execute "Setting default MSYSTEM" `
4444
('echo "export MSYSTEM=' + ("MINGW" + $osBitness) + '" >>~/.bash_profile')
4545

4646
# Now perform commands to set up MSYS2 for GHC Developments
4747
execute "Update pacman package DB" `
4848
"pacman -Syy"
49+
# Workaround for a stupid msys2 cycle they introduced
50+
execute "Removing catgets libcatgets" `
51+
"pacman --noconfirm -R catgets libcatgets"
4952

5053
execute "Updating system packages" `
5154
"pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime"
@@ -68,11 +71,11 @@ execute "Updating SSL root certificate authorities" `
6871
execute "Ensuring /mingw folder exists" `
6972
('test -d /mingw' + $osBitness + ' || mkdir /mingw' + $osBitness)
7073

71-
execute "Installing bootstrapping GHC 8.0.2 version" `
72-
('curl --stderr - -LO https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-' + $ghcArch + '-unknown-mingw32-win10.tar.xz && tar -xJ -C /mingw' + $osBitness + ' --strip-components=1 -f ghc-8.0.2-' + $ghcArch + '-unknown-mingw32-win10.tar.xz && rm -f ghc-8.0.2-' + $ghcArch + '-unknown-mingw32-win10.tar.xz')
74+
execute "Installing bootstrapping GHC 8.2.2 version" `
75+
('curl --stderr - -LO https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-' + $ghcArch + '-unknown-mingw32.tar.xz && tar -xJ -C /mingw' + $osBitness + ' --strip-components=1 -f ghc-8.2.2-' + $ghcArch + '-unknown-mingw32.tar.xz && rm -f ghc-8.2.2-' + $ghcArch + '-unknown-mingw32.tar.xz')
7376

7477
execute "Installing alex, happy and cabal" `
75-
('mkdir -p /usr/local/bin && curl --stderr - -LO https://www.haskell.org/cabal/release/cabal-install-1.24.0.0/cabal-install-1.24.0.0-i386-unknown-mingw32.zip && unzip cabal-install-1.24.0.0-i386-unknown-mingw32.zip -d /usr/local/bin && rm -f cabal-install-1.24.0.0-i386-unknown-mingw32.zip && cabal update && cabal install -j --prefix=/usr/local alex happy')
78+
('mkdir -p /usr/local/bin && curl --stderr - -LO https://www.haskell.org/cabal/release/cabal-install-2.0.0.1/cabal-install-2.0.0.1-i386-unknown-mingw32.zip && unzip cabal-install-2.0.0.1-i386-unknown-mingw32.zip -d /usr/local/bin && rm -f cabal-install-2.0.0.1-i386-unknown-mingw32.zip && cabal update && cabal install -j --prefix=/usr/local alex happy')
7679

7780
execute "Re-installing HsColour" `
7881
'cabal install -j --prefix=/usr/local HsColour --reinstall'
@@ -86,7 +89,7 @@ echo "$cmd" | Out-File -Encoding ascii (Join-Path $packageDir ($packageName + ".
8689
execute "Copying GHC gdb configuration..." `
8790
('cp "' + (Join-Path $toolsDir ".gdbinit") + '" ~/.gdbinit')
8891

89-
# Install Arcanist
92+
# Install Arcanist
9093
if ($useArc -eq $true) {
9194
Write-Host "Setting up Arcanist as requested."
9295

@@ -98,7 +101,7 @@ if ($useArc -eq $true) {
98101

99102
execute "Adding arcanist to path information" `
100103
'echo "export PATH=$(pwd)/arcanist/bin:\$PATH" >>~/.bash_profile'
101-
104+
102105
execute "Copying PHP configuration..." `
103106
('cp "' + (Join-Path $toolsDir "php.ini") + '" /usr/local/bin/php.ini')
104107
}
@@ -108,7 +111,7 @@ if ($getSource -eq $true) {
108111
Write-Host "Getting a checkout of GHC for your coding pleasure..."
109112

110113
execute "Fetching sources..." `
111-
"git clone --recursive git://git.haskell.org/ghc.git"
114+
"git clone --recursive git://git.haskell.org/ghc.git"
112115

113116
# Configure Arcanist if it was installed
114117
if ($useArc -eq $true) {
@@ -117,15 +120,7 @@ if ($getSource -eq $true) {
117120
}
118121
}
119122

120-
# Install Hadrian
121-
if ($useHadrian -eq $true) {
122-
Write-Host "Setting up Hadrian as requested."
123-
124-
execute "Fetching sources..." `
125-
"cd ghc && git clone https://github.com/snowleopard/hadrian.git && cd hadrian"
126-
}
127-
128-
# Install SSHd
123+
# Install SSHd
129124
if ($useSsh -eq $true) {
130125
Write-Host "Setting up SSH as requested."
131126

@@ -191,12 +186,11 @@ if ($getSource -eq $true) {
191186
Write-Output "* A checkout of the GHC sources has been made in ~/ghc."
192187
Write-Output "*"
193188
}
194-
if ($useHadrian -eq $true) {
195-
Write-Output "* Hadrian has been installed and configured in ~/ghc."
196-
Write-Output "* This means you can now use shake to build GHC."
197-
Write-Output "* See https://github.com/snowleopard/hadrian for instructions."
198-
Write-Output "*"
199-
}
189+
190+
Write-Output "* Hadrian has been installed and configured in ~/ghc."
191+
Write-Output "* This means you can now use shake to build GHC."
192+
Write-Output "* See https://github.com/snowleopard/hadrian for instructions."
193+
Write-Output "*"
200194

201195
Write-Output "* For other information visit https://ghc.haskell.org/trac/ghc/wiki/Building"
202196
Write-Output "*"

templates/chocolateyShared-Template.ps1

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Chocolatey GHC Dev
22
#
33
# Licensed under the MIT License
4-
#
4+
#
55
# Copyright (C) 2016 Tamar Christina <tamar@zhox.com>
6-
6+
77
$ErrorActionPreference = 'Stop';
8-
8+
99
$packageName = 'ghc-devel-' + $arch
10-
10+
1111
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
1212
$packageDir = Join-Path $toolsDir ".."
1313
$packageFullName = $packageName + '-' + $version
@@ -48,7 +48,6 @@ if ([string]::IsNullOrWhiteSpace($packageParameters))
4848
$useArc = $true
4949
$useSsh = $false
5050
$getSource = $false
51-
$useHadrian = $false
5251
$SSH_PORT = 22
5352

5453
# Now parse the packageParameters using good old regular expression
@@ -82,27 +81,20 @@ if ($packageParameters) {
8281
if ($arguments["ssh"] -gt 0) {
8382
$SSH_PORT=[convert]::ToInt32($arguments["ssh"], 10)
8483
}
85-
84+
8685
Write-Host ("Okay, I will also install and configure an SSH daemon on port " + $SSH_PORT)
8786
$useSsh = $true
8887
}
89-
90-
if ($arguments.ContainsKey("hadrian")) {
91-
Write-Host "Okay, I will also install and configure Hadrian"
92-
$useHadrian = $true
93-
$getSource = $true
94-
}
95-
88+
9689
if ($arguments.ContainsKey("source")) {
9790
Write-Host "Okay, I will also checkout GHC sources in ~/ghc"
9891
$getSource = $true
9992
}
100-
93+
10194
if ($arguments.ContainsKey("all")) {
102-
Write-Host "Okay, I will install and configure an SSH daemon, Hadrian and Arcanist and get the sources"
95+
Write-Host "Okay, I will install and configure an SSH daemon and Arcanist and get the sources"
10396
$useArc = $true
10497
$useSsh = $true
105-
$useHadrian = $true
10698
$getSource = $true
10799
}
108100
} else {
@@ -122,9 +114,9 @@ function execute {
122114
# Set the APPDATA path which does not get inherited during these invokes
123115
# and set MSYSTEM to make sure we're using the right system
124116
$envdata = "export APPDATA=""" + $Env:AppData + """ && export MSYSTEM=MINGW" + $osBitness + " && "
125-
117+
126118
# NOTE: For now, we have to redirect or silence stderr due to
127-
# https://github.com/chocolatey/choco/issues/445
119+
# https://github.com/chocolatey/choco/issues/445
128120
# Instead just check the exit code
129121
Write-Host "$message with '$command'..."
130122
if ($compat -eq 1)

0 commit comments

Comments
 (0)