]> git.proxmox.com Git - libgit2.git/blame - README.txt
Update the README with info about the new buildsys
[libgit2.git] / README.txt
CommitLineData
4b7483a2
SC
1libgit2 - the Git linkable library
2==================================
3
4libgit2 is a portable, pure C implementation of the Git core methods provided as a
5re-entrant linkable library with a solid API, allowing you to write native
6speed custom Git applications in any language with bindings.
7
4b7483a2
SC
8Why Do We Need It
9==================================
10
11In the current Git project, though a libgit.a file is produced it is
12not re-entrant (it will call <code>die()</code> on basically any error)
13and it has no stable or well-designed public API. As there is no good
14way to link to this effectively, a new library was needed that fulfilled
15these requirements. Thus libgit2.
16
17Though it would be nice to use the same library that Git itself uses,
18Git actually has a pretty simple storage format and just having native
19access to that is pretty useful. Eventually we would like to have most
20of the functionality of the core Git tools or even get the library
21integrated into Git itself, but in the meantime having a cleanly designed
22and maintained linkable Git library with a public API will likely be helpful
23to lots of people.
24
25What It Can Do
26==================================
27
28libgit2 is already very usable.
29* raw <-> hex SHA conversions
30* raw object reading (loose and packed)
31* raw object writing (loose)
32* revlist walker
33* commit, tag and tree object parsing and write-back
34* tree traversal
35* basic index file (staging area) operations
36
b97b386d
VM
37Building libgit2 - Unix systems
38==================================
39
40In Unix-like systems, like Linux, *BSD and Mac OS X, libgit2 has
41the following dependencies:
4b7483a2 42
b97b386d
VM
43 - Python 2.5-3.1 <http://www.python.org>
44 Used by run the build system; no extra libraries required.
45 Should probably ship installed with your OS.
46
47 - zlib 1.2+ <http://www.zlib.net/>
48
49 - LibSSL <http://www.openssl.org/>
50 Only needed if you want to re-use OpenSSL's SHA1 routines;
51 libgit2 compiles its own routines by default.
52
53To build it, first configure the build system by running:
54
55 $ ./waf configure
56
57Then build the library, either in its shared (libgit2.so) or static form (libgit2.a)
58
59 $ ./waf build-static
60 $ ./waf build-shared
61
62You can then test the library with:
63
64 $ ./waf test
65
66And finally you can install it with (you may need to sudo):
67
68 $ ./waf install
69
70Building libgit2 - Windows MSVC++
4b7483a2
SC
71==================================
72
b97b386d
VM
73When building under Windows using the MSVC compiler, libgit2 has
74the following dependencies:
75
76 - Python 2.5-3.1 <http://www.python.org>
77 Used by run the build system; no extra libraries required.
78
79 - zlib 1.2+ (Windows API Version) <http://www.zlib.net/>
80 Make sure you compile the ZLib library using the MSVC solution
81 that ships in its source distribution.
82 Alternatively, you may download precompiled binaries from:
83 http://www.winimage.com/zLibDll/
84
85 - LibSSL <http://www.openssl.org/>
86 Only needed if you want to re-use OpenSSL's SHA1 routines;
87 libgit2 compiles its own routines by default.
88
89To build it, first configure the build system by running:
90
91 $ ./waf configure
92
93Then build the library, either in its shared (libgit2.dll) or static form (libgit2.lib)
94
95 $ ./waf build-static
96 $ ./waf build-shared
97
98You can then test the library with:
99
100 $ ./waf test
101
102Lastly, you can manually install the generated *.lib and *.dll files, depending on
103your preferences.
104
105Building libgit2 - Windows MinGW
106==================================
107
108When building under Windows using the GCC compiler that ships with MinGW,
109libgit2 has the following dependencies:
110
111 - Python 2.5-3.1 <http://www.python.org>
112 Used by run the build system; no extra libraries required.
113
114 - zlib 1.2+ <http://www.zlib.net/>
115
116 - pthreads-w32 <http://sourceware.org/pthreads-win32/>
117 Or an equivalent pthreads implementation for non-POSIX systems
118
119 - LibSSL <http://www.openssl.org/>
120 Only needed if you want to re-use OpenSSL's SHA1 routines;
121 libgit2 compiles its own routines by default.
122
123To build it, first configure the build system and force GCC as the compiler,
124instead of the default MSVC:
125
126 $ ./waf configure --check-c-compiler=gcc
127
128Then build the library, either in its shared (libgit2.so) or static form (libgit2.a)
129
130 $ ./waf build-static
131 $ ./waf build-shared
132
133You can then test the library with:
134
135 $ ./waf test
136
137And finally you can install it with:
138
139 $ ./waf install
140
141
142Configuration settings
143==================================
144
145The waf build system for libgit2 accepts the following flags:
146
147 --debug
148 build the library with debug symbols.
149 Defaults to off.
150
151 --sha1=[builtin|ppc|openssl]
152 use the builtin SHA1 functions, the optimized PPC versions
153 or the SHA1 functions from LibCrypto (OpenSSL).
154 Defaults to 'builtin'.
4b7483a2 155
b97b386d
VM
156You can run `./waf --help` to see a full list of install options and
157targets.
4b7483a2
SC
158
159Language Bindings
160==================================
161
162So you want to use Git from your favorite programming language. Here are
163the bindings to libgit2 that are currently available:
164
165== Ruby ==
166
167Ribbit is the reference library used to make sure the
168libgit2 API is sane. This should be mostly up to date.
169
170http://github.com/libgit2/ribbit
171
172
173== Erlang ==
174
175Geef is an example of an Erlang NIF binding to libgit2. A bit out of
176date, but basically works. Best as a proof of concept of what you could
177do with Erlang and NIFs with libgit2.
178
179http://github.com/schacon/geef
180
181
182If you start another language binding to libgit2, please let us know so
183we can add it to the list.
184
185License
186==================================
187libgit2 is under GPL2 with linking exemption, which basically means you
188can link to the library with any program, commercial, open source or
189other. However, you cannot modify libgit2 and distribute it without
190supplying the source.
191
192See the COPYING file for the full license text.