diff --git a/Bustle/UI/FilterDialog.hs b/Bustle/UI/FilterDialog.hs
--- a/Bustle/UI/FilterDialog.hs
+++ b/Bustle/UI/FilterDialog.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-
 Bustle.UI.FilterDialog: allows the user to filter the displayed log
 Copyright © 2011 Collabora Ltd.
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -43,11 +43,14 @@
 		-o $@ $(BUSTLE_PCAP_SOURCES) \
 		$(GIO_FLAGS) $(PCAP_FLAGS)
 
-dist/build/autogen/version.h: bustle.cabal
+dist/build/autogen/version.txt: bustle.cabal
 	@mkdir -p `dirname $@`
-	perl -nle 'm/^Version:\s+(.*)$$/ and print qq(#define BUSTLE_VERSION "$$1")' \
+	perl -nle 'm/^Version:\s+(.*)$$/ and print $$1' \
 		$< > $@
 
+dist/build/autogen/version.h: dist/build/autogen/version.txt
+	echo '#define BUSTLE_VERSION "'`cat $<`'"' > $@
+
 install: all
 	mkdir -p $(BINDIR)
 	cp $(BINARIES) $(BINDIR)
@@ -113,9 +116,9 @@
 maintainer-update-messages-pot:
 	find Bustle -name '*.hs' -print0 | xargs -0 hgettext -k __ -o po/messages.pot
 
-maintainer-make-release: bustle.cabal
+maintainer-make-release: bustle.cabal dist/build/autogen/version.txt
 	cabal test
 	cabal sdist
-	git tag -s -m 'Bustle '`perl -nle 'm/^Version:\s+(.*)$$/ and print qq($$1)' bustle.cabal` \
-		bustle-`perl -nle 'm/^Version:\s+(.*)$$/ and print qq($$1)' bustle.cabal`
+	git tag -s -m 'Bustle '`cat dist/build/autogen/version.txt` \
+		bustle-`cat dist/build/autogen/version.txt`
 	make maintainer-binary-tarball
diff --git a/NEWS.md b/NEWS.md
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,8 @@
+Bustle 0.5.1 (2015-06-28)
+-------------------------
+
+* Build fixes for GHC 7.10 (Sergei Trofimovich)
+
 Bustle 0.5.0 (2015-06-04)
 -------------------------
 
diff --git a/Test/Renderer.hs b/Test/Renderer.hs
--- a/Test/Renderer.hs
+++ b/Test/Renderer.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE FlexibleContexts #-}
 module Main where
 
 import Test.Framework (defaultMain, testGroup)
diff --git a/bustle.cabal b/bustle.cabal
--- a/bustle.cabal
+++ b/bustle.cabal
@@ -1,6 +1,6 @@
 Name:           bustle
 Category:       Network, Desktop
-Version:        0.5.0
+Version:        0.5.1
 Cabal-Version:  >= 1.8
 Synopsis:       Draw sequence diagrams of D-Bus traffic
 Description:    Draw sequence diagrams of D-Bus traffic
