Commit 50922f6
Compile with libgit2
Changed files (3)
modifiedlibbirdfont/BackgroundTool.valamodifiedlibbirdfont/BirdFontPart.valamodifiedscripts/build.py
Diff
@@ -194,7 +194,7 @@ public class BackgroundTool : Tool { } }); - MainWindow.file_chooser (_("Select background image"), fc, FileChooser.LOAD);+ MainWindow.file_chooser (t_("Select background image"), fc, FileChooser.LOAD); } } @@ -23,7 +23,7 @@ namespace BirdFont { * of a .bfp tree must have a file with the name "description.bfp", this file * tells the parser that bfp files in parent directories should be excluded. */-class BirdFontPart : GLib.Object{+public class BirdFontPart : GLib.Object{ Font font; List<string> parts; string root_directory;@@ -32,12 +32,30 @@ class BirdFontPart : GLib.Object{ static string FILE_ATTRIBUTES = "standard::*"; + static bool running_git = false;+ public BirdFontPart (Font font) { this.font = font; parts = new List<string> (); root_directory = ""; } + public static void git_init () {+ if (!running_git) {+ Git.Threads.init ();+ }+ + running_git = true;+ }++ public static void git_shutdown () {+ if (running_git) {+ Git.Threads.shutdown ();+ }+ + running_git = false;+ }+ public bool load (string bfp_file) { BirdFontFile bf = new BirdFontFile (font); File bfp_dir;@@ -109,13 +127,14 @@ class BirdFontPart : GLib.Object{ object_id id; Git.Tree tree; int nparents;+ Git.Commit[] parents; if (root_directory == "") { warning ("No directory is created for this birdfont part."); return false; } - Git.Threads.init ();+ git_init (); if (!create_git_repository ()) { return false;@@ -225,13 +244,14 @@ class BirdFontPart : GLib.Object{ nparents = 0; } - if (((!) git_repository).create_commit_v (id, "HEAD", (!) sig, (!) sig, - "utf-8", "Improved typeface", tree, nparents) != Git.Error.OK) {+ parents = new Git.Commit[0];+ if (((!) git_repository).create_commit (id, "HEAD", (!) sig, (!) sig, + "utf-8", "Improved typeface", tree, parents) != Git.Error.OK) { warning ("Can't commit"); error = true; } - Git.Threads.shutdown ();+ git_shutdown (); return !error; }@@ -35,6 +35,7 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull run(valac + """\ -C \ """ + valaflags + """ \+ --vapidir=./ \ --basedir build/libbirdfont/ \ """ + experimentalNonNull + """ \ --enable-experimental \@@ -46,7 +47,8 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull --pkg libxml-2.0 \ --pkg gio-2.0 \ --pkg cairo \- --pkg gdk-pixbuf-2.0""")+ --pkg gdk-pixbuf-2.0 \+ --pkg libgit2""") #copy c sources run("cp libbirdfont/OpenFontFormat/*.c build/libbirdfont/")@@ -64,6 +66,7 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull $(pkg-config --cflags cairo) \ $(pkg-config --cflags glib-2.0) \ $(pkg-config --cflags gdk-pixbuf-2.0) \+ $(pkg-config --cflags libgit2) \ -I ./build/mac/birdfont""") run("mv ./*.o build/libbirdfont/ ") @@ -83,6 +86,7 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull $(pkg-config --libs cairo) \ $(pkg-config --libs glib-2.0) \ $(pkg-config --libs gdk-pixbuf-2.0) \+ $(pkg-config --libs libgit2) \ -o """ + library) run("mv " + library + " build/bin/")