Clone in a terminal:
Commit 50922f6
Johan Mattsson - 2014-09-03T13:45:08+00:00
50922f61d274611c0632bfd336dc0a3ce293cb9ejohan.mattsson.m@gmail.com

Compile with libgit2

Changed files (3)

Diff

diff --git a/libbirdfont/BackgroundTool.vala b/libbirdfont/BackgroundTool.valaindex 35005c7..684cec6 100644--- a/libbirdfont/BackgroundTool.vala+++ b/libbirdfont/BackgroundTool.vala@@ -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); 	} } diff --git a/libbirdfont/BirdFontPart.vala b/libbirdfont/BirdFontPart.valaindex 2502c51..13ea6e2 100644--- a/libbirdfont/BirdFontPart.vala+++ b/libbirdfont/BirdFontPart.vala@@ -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; 	}diff --git a/scripts/build.py b/scripts/build.pyindex 5c8ed07..a7a234a 100644--- a/scripts/build.py+++ b/scripts/build.py@@ -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/") 		

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112