Skip to content

Commit

Permalink
Add explicit package synchronization and run -Su twice.
Browse files Browse the repository at this point in the history
This fixes #7

Change file paths to match download for ghc 8.0.2.
Fixes 6#6

The additional python packes are now properly recorded as
dependency in MSYS and will be automatically installed.
  • Loading branch information
AndreasPK authored and Mistuke committed Sep 21, 2017
1 parent eef539d commit 6643b07
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions templates/chocolateyInstall-Template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,39 @@ execute "Setting default MSYSTEM" `
('echo "export MSYSTEM=' + ("MINGW" + $osBitness) + '" >>~/.bash_profile')

# Now perform commands to set up MSYS2 for GHC Developments
execute "Update pacman package DB" `
"pacman -Syy"

execute "Updating system packages" `
"pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime"
rebase
execute "Upgrading full system" `
"pacman --noconfirm -Su"

# It seems some parts of the system have to be update for others to be updateable. So just run this twice.
execute "Upgrading full system twice" `
"pacman --noconfirm -Su"

rebase
execute "Installing GHC Build Dependencies" `
"pacman --noconfirm -S --needed git tar binutils autoconf make libtool automake python python2 p7zip patch unzip mingw-w64-`$(uname -m)-gcc mingw-w64-`$(uname -m)-gdb mingw-w64-`$(uname -m)-python3-sphinx"

#Force reinstall in order to install ca-certificates with the updated pk11 tools
execute "Updating SSL root certificate authorities" `
"pacman --noconfirm -S --needed ca-certificates"
"pacman --noconfirm -S ca-certificates"

execute "Ensuring /mingw folder exists" `
('test -d /mingw' + $osBitness + ' || mkdir /mingw' + $osBitness)

execute "Installing bootstrapping GHC 7.10.3 version" `
('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-7.10.3-' + $ghcArch + '-unknown-mingw32-win10.tar.xz && rm -f ghc-7.10.3-' + $ghcArch + '-unknown-mingw32-win10.tar.xz')
execute "Installing bootstrapping GHC 8.0.2 version" `
('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')

execute "Installing alex, happy and cabal" `
('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')

execute "Re-installing HsColour" `
'cabal install -j --prefix=/usr/local HsColour --reinstall'

# Install some sphinx dependencies
execute "Installing python3 pip" `
'pacman -S --needed --noconfirm mingw-w64-$(uname -m)-python3-pip'

execute "Installing python3 request package" `
'pip3 install requests'

# Create files to access msys
Write-Host "Creating msys2 wrapper..."
Expand Down

0 comments on commit 6643b07

Please sign in to comment.