botan
botan copied to clipboard
Add instructions on howto easily use it on Windows
Add instructions on howto easily use it on Windows
The easy way to build on Windows is to install libbotan package using MSYS2/MinGW and add some information to project.cabal. MSYS2/MinGW64 is installed by GHCUP/GHC on Windows.
Here are the instructions (Paths might be different on your machine)
Install libbotan and dependencies in MSYS2. Start a MSYS2 shell by executing C:\ghcup\msys64\msys2.exe or C:\ghcup\msys64\msys2_shell.cmd -msys
# If needed update the package database and ugrade all installed packages
pacman -Syu
pacman -Su
# Install libbotan and it's dependencies
pacman -S mingw-w64-x86_64-libbotan
Add the botan-low dependency to the projects cabal file
build-depends: base ^>=4.17.2.1
, botan-low
Add this to cabal.project so that the needed parts of the Botan C++ library can be found when building.
packages: .
package botan-bindings
extra-include-dirs: C:\ghcup\msys64\mingw64\include\botan-3
extra-lib-dirs: C:\ghcup\msys64\mingw64\bin, C:\ghcup\msys64\mingw64\lib
Build and run from PowerShell
# Add libbotan-3.dll location to Path for this session
# so that the executable can find the dll.
$env:Path += ";C:\ghcup\msys64\mingw64\bin"
cabal build
cabal run