doc: complete windows.md
This adds more explanations and explain how to properly build with and without Cygwin. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Feb 14, 2016 at 11:17 UTC
02bc5c02c2f8d08d61f9ece834308ddd953e181f
1 file changed
+101
-17
docs/windows.md
+101
-17
@@ -16,6 +16,13 @@ the Path environment variable.
16
Please install the Go language as explained on
17
https://golang.org/doc/install.
18
19
+To properly install Go, you will need to set some environment
20
+variables. We recommend you to set them globally using the Control
21
+Panel, as explained in the documentation above, so that these
22
+environment variables are automatically available in all the possible
23
+environments that you might want to use like Git Bash, Windows's cmd,
24
+Cygwin's terminal, Windows' PowerShell and so on.
25
+
26
You must make sure that the GOROOT environment variable is set and
27
that the %GOROOT%/bin directory is in the Path environment variable.
28
@@ -23,36 +30,113 @@ The GOPATH environment variable should also be set to a directory that
30
you have created, and the %GOPATH/bin directory should also be in the
31
Path environment variable.
32
26
-## Download go-ipfs and its dependencies
33
+## Download go-ipfs and fix Git authentication
34
28
-The following commands should download or update go-ipfs and its
29
-dependencies:
35
+Use the following command to download go-ipfs source code:
36
31
-```sh
32
-go get -u github.com/whyrusleeping/gx
33
-go get -u github.com/whyrusleeping/gx-go
37
+```
38
go get -u github.com/ipfs/go-ipfs
35
-cd %GOPATH%/src/github.com/ipfs/go-ipfs
36
-gx --verbose install --global
39
```
40
39
-If you get authentication problems with Git, you might want to take a
40
-look at
41
+The above command uses Git to download go-ipfs from its GitHub
42
+repository. If you get authentication problems with Git, you might
43
+want to take a look at
44
https://help.github.com/articles/caching-your-github-password-in-git/
45
and use the suggested solution:
46
44
-```sh
47
+```
48
git config --global credential.helper wincred
49
```
50
48
-## Build
51
+## Choose the way you want to proceed
52
+
53
+Now there are two ways to download, install the dependencies and to
54
+build go-ipfs:
55
+
56
+1) There is the "Manual Way", where you don't need to install anymore
57
+software except the dependencies, but you have a number of commands to
58
+type.
59
+
60
+2) There is a way by installing 'make' through Cygwin and using it to
61
+do nearly everything. We call this way the "Cygwin Way". It may take
62
+much more time, because installing Cygwin can take a lot of time, but
63
+after that it might be easier as many procedures are just a 'make'
64
+command away.
65
+
66
+So use the next steps below that start with "Manual Way" if that's the
67
+way you want, otherwise scroll down a bit and use the "Cygwin Way"
68
+steps below.
69
+
70
+## Manual Way: download and install dependencies
71
+
72
+The following commands should download or update go-ipfs dependencies
73
+and then install them:
74
+
75
+```
76
+go get -u github.com/whyrusleeping/gx
77
+go get -u github.com/whyrusleeping/gx-go
78
+cd %GOPATH%/src/github.com/ipfs/go-ipfs
79
+gx --verbose install --global
80
+```
81
+
82
+## Manual Way: build go-ipfs
83
+
84
+To actually build go-ipfs, first go to the cmd/ipfs directory:
85
+
86
+```
87
+cd cmd\ipfs
88
+```
89
+
90
+Then get the current Git commit:
91
+
92
+```
93
+git rev-parse --short HEAD
94
+```
95
+
96
+It will output a small number of hex characters that you must pass to
97
+the actual build command (replace XXXXXXX with these characters):
98
+
99
+```
100
+go install -ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=XXXXXXX"
101
+```
102
+
103
+After that ipfs should have been built and should be available in
104
+"%GOPATH%\bin".
105
+
106
+You can check that the ipfs you built has the right version using:
107
+
108
+```
109
+ipfs version --commit
110
+```
111
+
112
+It should output something like "ipfs version 0.4.0-dev-XXXXXXX" where
113
+XXXXXXX is the current commit that you passed to the build command.
114
+
115
+## Cygwin way: install Cygwin
116
+
117
+Install Cygwin as explained in the Cygwin documentation:
118
+
119
+http://cygwin.com/install.html
120
50
-Fuse is not supported for Windows, so you need to build IPFS without Fuse:
121
+By default Cygwin will not install 'make', so you should click on the
122
+"Devel" category during the Cygwin installation process and then check
123
+the 'make' package.
124
52
-```sh
53
-go build -tags nofuse ./cmd/ipfs
125
+## Cygwin way: build go-ipfs
126
+
127
+To build go-ipfs using Cygwin you just need to open a Cygwin Terminal
128
+and then type the following commands:
129
+
130
+```
131
+cd $GOPATH/src/github.com/ipfs/go-ipfs
132
+make install
133
```
134
56
-## TODO
135
+After that ipfs should have been built and should be available in
136
+"%GOPATH%\bin".
137
58
-Fix the "Build" section to pass the current commit as the Makefile does.
138
+You can check that the ipfs you built has the right version using:
139
+
140
+```
141
+ipfs version --commit
142
+```