Skip to content

Commit bb10906

Browse files
author
John Haley
committed
Move install from source from main readme to guide
1 parent 496c335 commit bb10906

2 files changed

Lines changed: 77 additions & 76 deletions

File tree

README.md

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -63,82 +63,6 @@ npm install nodegit
6363
If you encounter problems while installing, you should try the Building from
6464
source instructions below.
6565

66-
## Building from source. ##
67-
68-
If you wish to help contribute to NodeGit it is useful to build locally.
69-
70-
``` bash
71-
# Fetch this project.
72-
git clone git://github.com/nodegit/nodegit.git
73-
74-
# Enter the repository.
75-
cd nodegit
76-
77-
# Install all dependencies, run the code generation scripts, and build.
78-
npm install
79-
```
80-
81-
If you encounter errors, you most likely have not configured the dependencies correctly.
82-
83-
### Installing dependencies: ###
84-
85-
#### Mac OS X ####
86-
87-
- [Install XCode Command Line Tools](http://railsapps.github.io/xcode-command-line-tools.html)
88-
89-
#### Linux ####
90-
91-
Using APT in Ubuntu:
92-
93-
``` bash
94-
sudo apt-get install build-essential
95-
```
96-
97-
Using Pacman in Arch Linux:
98-
99-
``` bash
100-
sudo pacman -S base-devel
101-
```
102-
103-
Note that GCC/G++ 4.7+ are required, as the library makes use of some c++11 std calls.
104-
105-
#### Windows ####
106-
107-
- [Download and install Python](https://www.python.org/download/windows).
108-
- [Download and install VS Express](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop).
109-
110-
You may have to add a build flag to the installation process to successfully install.
111-
Try first without, if the build fails, try again with the flag.
112-
113-
*Allegedly the order in which you install Visual Studio could trigger this error.*
114-
115-
``` bash
116-
npm install nodegit --msvs_version=2013
117-
# Or whatever version you've installed.
118-
```
119-
120-
##### A note on environment variables in Windows #####
121-
In many of the npm scripts (and examples above), things are run like
122-
`BUILD_ONLY=true npm install`. This sets the `BUILD_ONLY` environment variable
123-
to true for the duration of that command. This doesn't work in windows, however
124-
there is a solution. You can use cmd to call a command inside of cmd (very meta)
125-
with the variable set, and it only lasts for the duration of the inner call to cmd.
126-
So for the above example, you would run `cmd /C "set BUILD_ONLY=true && npm install"`.
127-
See here for more details:
128-
[SuperUser](http://superuser.com/questions/223104/setting-environment-variable-for-just-one-command-in-windows-cmd-exe).
129-
130-
### Debug build: ###
131-
132-
In order to track down possible bugs, you will need a debug buid so you
133-
can get a backtrace with [gdb](http://www.gnu.org/software/gdb/) or
134-
[lldb](http://lldb.llvm.org/).
135-
136-
If you're building for the first time, run `npm run installDebug` (or `BUILD_ONLY=true npm link`)
137-
138-
Note that you should run `rm -rf build/Release` (or `rd /s /q build/Release` in Windows) to make sure a release build doesn't get loaded instead of the debug build.
139-
140-
If you're doing a subsequent rebuild of NodeGit in debug, the clean function will cause a lot of extraneous recompilation of things you probably didn't change (like the vendor dependencies). If you need to regenerate the C++ files and recompile you can run `npm run rebuildDebug`, or `npm run recompileDebug` if you've manually updated the C++ files and don't want them to regenerate.
141-
14266
## API examples. ##
14367

14468
### Cloning a repository and reading a file: ###

guides/install/from-source/README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,80 @@ description: How to build NodeGit from source
88
[Return to install guides](../)
99

1010
* * *
11+
12+
Building from source
13+
----------------------
14+
15+
If you wish to help contribute to NodeGit it is useful to build locally.
16+
17+
``` bash
18+
# Fetch this project.
19+
git clone git://github.com/nodegit/nodegit.git
20+
21+
# Enter the repository.
22+
cd nodegit
23+
24+
# Install all dependencies, run the code generation scripts, and build.
25+
npm install
26+
```
27+
28+
If you encounter errors, you most likely have not configured the dependencies correctly.
29+
30+
### Installing dependencies: ###
31+
32+
#### Mac OS X ####
33+
34+
- [Install XCode Command Line Tools](http://railsapps.github.io/xcode-command-line-tools.html)
35+
36+
#### Linux ####
37+
38+
Using APT in Ubuntu:
39+
40+
``` bash
41+
sudo apt-get install build-essential
42+
```
43+
44+
Using Pacman in Arch Linux:
45+
46+
``` bash
47+
sudo pacman -S base-devel
48+
```
49+
50+
Note that GCC/G++ 4.7+ are required, as the library makes use of some c++11 std calls.
51+
52+
#### Windows ####
53+
54+
- [Download and install Python 2](https://www.python.org/download/windows).
55+
- [Download and install VS Community](https://www.visualstudio.com/products/visual-studio-community-vs).
56+
57+
You may have to add a build flag to the installation process to successfully install.
58+
Try first without, if the build fails, try again with the flag.
59+
60+
*Allegedly the order in which you install Visual Studio could trigger this error.*
61+
62+
``` bash
63+
npm install nodegit --msvs_version=2013
64+
# Or whatever version you've installed.
65+
```
66+
67+
##### A note on environment variables in Windows #####
68+
In many of the npm scripts (and examples above), things are run like
69+
`BUILD_ONLY=true npm install`. This sets the `BUILD_ONLY` environment variable
70+
to true for the duration of that command. This doesn't work in windows, however
71+
there is a solution. You can use cmd to call a command inside of cmd (very meta)
72+
with the variable set, and it only lasts for the duration of the inner call to cmd.
73+
So for the above example, you would run `cmd /C "set BUILD_ONLY=true && npm install"`.
74+
See here for more details:
75+
[SuperUser](http://superuser.com/questions/223104/setting-environment-variable-for-just-one-command-in-windows-cmd-exe).
76+
77+
### Debug build: ###
78+
79+
In order to track down possible bugs, you will need a debug buid so you
80+
can get a backtrace with [gdb](http://www.gnu.org/software/gdb/) or
81+
[lldb](http://lldb.llvm.org/).
82+
83+
If you're building for the first time, run `npm run installDebug` (or `BUILD_ONLY=true npm link`)
84+
85+
Note that you should run `rm -rf build/Release` (or `rd /s /q build/Release` in Windows) to make sure a release build doesn't get loaded instead of the debug build.
86+
87+
If you're doing a subsequent rebuild of NodeGit in debug, the clean function will cause a lot of extraneous recompilation of things you probably didn't change (like the vendor dependencies). If you need to regenerate the C++ files and recompile you can run `npm run rebuildDebug`, or `npm run recompileDebug` if you've manually updated the C++ files and don't want them to regenerate.

0 commit comments

Comments
 (0)