Skip to content

Instantly share code, notes, and snippets.

@bigos
Last active December 3, 2017 05:08
Show Gist options
  • Save bigos/12a77332c702c1c8be1d464f0fe72698 to your computer and use it in GitHub Desktop.
Save bigos/12a77332c702c1c8be1d464f0fe72698 to your computer and use it in GitHub Desktop.
Description of Haskell installation and configuration on Windows 10

New attempt

instaled new test VM

updated the language and found that Power shell responds to

choco version
Chocolatey v0.10.8

installed MSYS2

Used Admin cmd

Missing Instructions

Click on the circle next to windows start button and type cmd. The search result will show Command Prompt icon. Right click on it and select Run as administrator.

set the paths

SET PATH=%APPDATA%\cabal\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin;C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.0.2\bin;C:\ProgramData\chocolatey\lib\cabal\tools;%PATH%
SET PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig
SET XDG_DATA_DIRS=C:\msys64\mingw64\share

installed choco

choco install ghc --version 8.0.2

used MSYS2 terminal

Inatalled required packages

pacman -S -q --noconfirm mingw64/mingw-w64-x86_64-pkg-config mingw64/mingw-w64-x86_64-gobject-introspection mingw64/mingw-w64-x86_64-gtksourceview3 mingw64/mingw-w64-x86_64-webkitgtk3

restarted machine

optional Emacs configuration

installed Emacs

In MSYS2 terminal I ran

pacman -S mingw64/mingw-w64-x86_64-emacs

created emacslauncher.bat

In MSYS2 terminal I ran

cd c:/Users/IEuser
touch ./emacslauncher.bat
emacs ./emacslauncher.bat

In the editor I have pasted the following

set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%

set XDG_DATA_DIRS=c:/msys64/mingw64/share
set PKG_CONFIG_PATH=c:/msys64/mingw64/lib/pkgconfig
set HASKELL_GI_GIR_SEARCH_PATH=c:/msys64/mingw64/share/gir-1.0

saved the file and quit Emacs.

used emacslauncher.bat

Now I clicked on the circle next to Windows start button and searched for emacslauncher.

That has started Emacs editor. I have pressed “Alt+x” keyboard shortcut and typed eshell and pressed Enter. That gave me a shell that is in my opinion more comfortable than MSYS2 shell.

I typed some commands.

c:/Users/IEUser $ pwd
c:/Users/IEUser
c:/Users/IEUser $ echo $PATH
C:\msys64\mingw64\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
c:/Users/IEUser $ printenv
!;=;\
ACLOCAL_PATH=C:\msys64\mingw64\share\aclocal;C:\msys64\usr\share\aclocal
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\IEUser\AppData\Roaming
ChocolateyInstall=C:\ProgramData\chocolatey
ChocolateyLastPathUpdate=Sun Dec  3 02:25:35 2017
COLUMNS=80
COMMONPROGRAMFILES=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=MSEDGEWIN10
COMSPEC=C:\Windows\system32\cmd.exe
CONFIG_SITE=C:/msys64/mingw64/etc/config.site
CONTITLE=MinGW x64
CYGWIN=mintty
DISPLAY=w32
emacs_dir=C:/msys64/mingw64
EM_PARENT_PROCESS_ID=1256
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING=Default
HOME=/home/IEUser
HOMEDRIVE=C:
HOMEPATH=\Users\IEUser
HOSTNAME=MSEDGEWIN10
INFOPATH=C:\msys64\usr\local\info;C:\msys64\usr\share\info;C:\msys64\usr\info;C:\msys64\share\info
LANG=en_US.UTF-8
LINES=35
LOCALAPPDATA=C:\Users\IEUser\AppData\Local
LOGONSERVER=\\MSEDGEWIN10
MANPATH=C:\msys64\mingw64\share\man;C:\msys64\usr\local\man;C:\msys64\usr\share\man;C:\msys64\usr\man;C:\msys64\share\man
MINGW_CHOST=x86_64-w64-mingw32
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
MINGW_PREFIX=C:/msys64/mingw64
MSYSCON=mintty.exe
MSYSTEM=MINGW64
MSYSTEM_CARCH=x86_64
MSYSTEM_CHOST=x86_64-w64-mingw32
MSYSTEM_PREFIX=C:/msys64/mingw64
NUMBER_OF_PROCESSORS=1
OLDPWD=c:/msys64/home/IEUser
OneDrive=C:\Users\IEUser\OneDrive
ORIGINAL_PATH=C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
ORIGINAL_TEMP=C:/Users/IEUser/AppData/Local/Temp
ORIGINAL_TMP=C:/Users/IEUser/AppData/Local/Temp
OS=Windows_NT
PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=2a07
ProgramData=C:\ProgramData
PROGRAMFILES=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
PWD=c:/Users/IEUser
SESSIONNAME=Console
SHELL=C:/msys64/usr/bin/bash
SHLVL=1
SYSTEMDRIVE=C:
SYSTEMROOT=C:\Windows
TEMP=/tmp
TEMP=/c/Users/IEUser/AppData/Local/Temp
TERM=dumb
TMP=/tmp
TMP=/c/Users/IEUser/AppData/Local/Temp
TMPDIR=/tmp
USER=IEUser
USERDOMAIN=MSEDGEWIN10
USERDOMAIN_ROAMINGPROFILE=MSEDGEWIN10
USERNAME=IEUser
USERPROFILE=C:\Users\IEUser
WD=C:\msys64\usr\bin\
WINDIR=C:\Windows
_=C:/msys64/mingw64/bin/runemacs.exe
c:/Users/IEUser $

tried cabal

eshell

In eshell I typed

c:/Users/IEUser $ cabal --help
cabal: command not found

In Powershell and cmd cabal has worked. So I decided to modify the way I launch Emacs.

set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%
set XDG_DATA_DIRS=c:/msys64/mingw64/share
set PKG_CONFIG_PATH=c:/msys64/mingw64/lib/pkgconfig
set HASKELL_GI_GIR_SEARCH_PATH=c:/msys64/mingw64/share/gir-1.0

C:\msys64\mingw64\bin\runemacs

and closed Emacs and started it again pressing left Windows button and searching for enacslaunche.bat. After that my $PATH looked OK, I had nice Unix shell in Emacs and cabal worked.

modified cabal configuration

The command cabal user-config int gave me the location of cabal file. So I modified the extra-*-dirs to point to msys libraries.

-- flags:
extra-include-dirs: c:/msys64/mingw64/include
-- deterministic:
-- cid:
extra-lib-dirs: c:/msys64/mingw64/lib
-- extra-framework-dirs:
extra-prog-path: C:\Users\IEUser\AppData\Roaming\cabal\bin
-- instantiate-with:

tried cabal again

cabal update
cabal install gi-gtk

And got the error

Warning: The package has an extraneous version range for a dependency on an
internal library: pretty-show ==1.6.13. This version range includes the
current package but isn't needed as the current package's library will always
be used.
cabal.exe: The program 'happy' is required but it could not be found.
Failed to install pretty-show-1.6.13
cabal.exe: Error: some packages failed to install:
gi-atk-2.0.14-9XZ26IbMVDJJOptxM3q72d depends on gi-atk-2.0.14 which failed to
install.
cabal install alex
cabal install happy
cabal install gi-gtk

so far so good

Installing library in
C:\Users\IEUser\AppData\Roaming\cabal\x86_64-windows-ghc-8.0.2\gi-gtk-3.0.17-3zy3X54uyX9I32tpgdOrjt
Creating package registration file:
C:\Users\IEUser\AppData\Local\Temp\pkgConf-gi-gtk-3.0.17-2028\pkgConf
Installed gi-gtk-3.0.17
c:/ $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment