Any interest in libgit bindings?

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Oct 10 18:15:29 PDT 2012


On 10/10/12, Jacob Carlborg <doob at me.com> wrote:
> I would absolutely have interest in this.

https://github.com/AndrejMitrovic/dgen_libgit

Well it's mostly done (can't tell if anything is missing, except the
docs). I had to reimplement inline functions in D since they're not
exported on the C side (maybe -fkeep-inline-functions could work on
Posix but it doesn't on Windows). I don't know of a non-intrusive way
to work around this so I copy-pasted the functions to D and made them
compilable.

I'll put an extern(C) at the top later to replace all the extern(C)
declarations, but that's just a styling issue that's easily fixed.

But I can't get it to link with libgit on Linux though. After
compiling and installing libgit (which copied the shared lib to
/usr/local/lib), I've tried:

$ cd samples/diff
$ rdmd --force -L-L/usr/local/lib -L-lgit2 -I../../src diff.d

/tmp/.rdmd-1000/rdmd-diff.d-572543621CF312EC72273F3DB4C6B8BE/diff:
error while loading shared libraries: libgit2.so.0: cannot open shared
object file: No such file or directory

I never have luck with Posix. :)

This is from branch 'development', commit
acd1700630ea1159a55dc5e8cee12e4a725afe18 from
https://github.com/libgit2/libgit2/

Instructions on building libgit2 are here: http://libgit2.github.com/#install


More information about the Digitalmars-d mailing list