From e8c33415d3ec4bbc679b37aa2cd9e8689331b6ce Mon Sep 17 00:00:00 2001 From: Godhani Harsh <45615666+0xsuid@users.noreply.github.com> Date: Sun, 22 Sep 2019 11:39:38 +0530 Subject: [PATCH] Added Cross Compiling For Windows from source --- Installation.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Installation.md b/Installation.md index 172d6f4..f92c994 100644 --- a/Installation.md +++ b/Installation.md @@ -32,6 +32,34 @@ Shiori uses Go module so make sure you have `go >= 1.11` installed, then run: go get -u -v github.com/go-shiori/shiori ``` +### Cross Compiling For Windows: + +1. You need mousetrap and go-windows-terminal-sequences: + +``` +go get github.com/inconshreveable/mousetrap +go get github.com/konsorten/go-windows-terminal-sequences +``` +2. Now you need to install mingw-w64 for cross compiling: + +``` +$ sudo apt-get install gcc-mingw-w64 +``` + +Now you can build for windows amd64 and i386 arch: + +#### Winodws amd64 Build: + +``` +GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o shiori_windows_amd64.exe github.com/go-shiori/shiori +``` + +#### Winodws i386 Build: + +``` +GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CGO_ENABLED=1 go build -o shiori_windows_i386.exe github.com/go-shiori/shiori +``` + ## Using Docker Image To use Docker image, you can pull the latest automated build from Docker Hub :