diff -pruN 1.19-1/debian/changelog 1.19-1ubuntu1/debian/changelog
--- 1.19-1/debian/changelog	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/debian/changelog	2021-10-27 17:51:17.000000000 +0000
@@ -1,3 +1,11 @@
+chroma (1.19-1ubuntu1) unstable; urgency=low
+
+  * Fix build process to isolate inkscape from $HOME and the GUI.
+    (Closes: #997904)
+  * Fix generation of images using Inkscape >= 1.0.
+
+ -- Simon Tatham <anakin@pobox.com>  Wed, 27 Oct 2021 18:51:17 +0100
+
 chroma (1.19-1) unstable; urgency=low
 
   * New upstream release. (Closes: #997147)
diff -pruN 1.19-1/debian/rules 1.19-1ubuntu1/debian/rules
--- 1.19-1/debian/rules	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/debian/rules	2021-10-27 17:51:17.000000000 +0000
@@ -8,5 +8,5 @@ override_dh_auto_configure:
 
 override_dh_auto_build-arch:
 	dh_auto_build
-	cd resources && ./make-graphics.sh
+	cd resources && env HOME=$$PWD GDK_BACKEND= ./make-graphics.sh
 	cd resources && ../debian/make-debian-icons.py
diff -pruN 1.19-1/resources/inkscape_export.pm 1.19-1ubuntu1/resources/inkscape_export.pm
--- 1.19-1/resources/inkscape_export.pm	1970-01-01 00:00:00.000000000 +0000
+++ 1.19-1ubuntu1/resources/inkscape_export.pm	2021-10-27 17:51:17.000000000 +0000
@@ -0,0 +1,13 @@
+our $inkscape_export_option = undef;
+
+sub inkscape_export {
+    my ($opts, $width, $height, $outfile, $infile) = @_;
+    unless (defined $inkscape_export_option) {
+        my $ver = `inkscape --version`;
+        $inkscape_export_option = ($ver =~ /Inkscape 0\./) ? "-e" : "-o";
+    }
+
+    system "inkscape $opts -w $width -h $height $inkscape_export_option $outfile $infile";
+}
+
+1;
diff -pruN 1.19-1/resources/make-base-marble.pl 1.19-1ubuntu1/resources/make-base-marble.pl
--- 1.19-1/resources/make-base-marble.pl	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/resources/make-base-marble.pl	2021-10-27 17:51:17.000000000 +0000
@@ -21,6 +21,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+require './inkscape_export.pm';
+
 if($#ARGV != 1)
 {
     print STDERR "Usage: make-base-marble.pl <file.svg> <directory>\n";
@@ -69,5 +71,5 @@ sub make_pieces
     $background = "";
 
     # Use Inkscape to convert the SVG to a PNG
-    system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+    inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
 }
diff -pruN 1.19-1/resources/make-pieces-marble.pl 1.19-1ubuntu1/resources/make-pieces-marble.pl
--- 1.19-1/resources/make-pieces-marble.pl	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/resources/make-pieces-marble.pl	2021-10-27 17:51:17.000000000 +0000
@@ -21,6 +21,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+require './inkscape_export.pm';
+
 if($#ARGV != 1)
 {
     print STDERR "Usage: make-pieces-marble.pl <pieces.svg> <directory>\n";
@@ -88,7 +90,7 @@ sub make_pieces
     $background = "-b \"#000000\"" if($partial);
 
     # Use Inkscape to convert the SVG to a PNG
-    system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+    inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
 
     for($piece = 0; $piece < $rows * $columns; $piece ++)
     {
diff -pruN 1.19-1/resources/make-pieces-neon.pl 1.19-1ubuntu1/resources/make-pieces-neon.pl
--- 1.19-1/resources/make-pieces-neon.pl	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/resources/make-pieces-neon.pl	2021-10-27 17:51:17.000000000 +0000
@@ -34,6 +34,8 @@
 # Use blur-full for most pieces, blur-half for earth and earth_double, and
 # blur-quarter for earth_directional, maps and teleport.
 
+require './inkscape_export.pm';
+
 if($#ARGV != 0)
 {
     print STDERR "Usage: make-pieces-neon.pl <directory>\n";
@@ -96,13 +98,13 @@ sub make_pieces
     $height_png = $height * ($columns * 2 + 1);
 
     $file_png_base = "/tmp/chroma-pieces-base-$$.png";
-    system("inkscape -w $width_png -h $height_png -e $file_png_base $file_svg_base");
+    inkscape_export("", $width_png, $height_png, $file_png_base, $file_svg_base);
 
     $file_png_overlay = "/tmp/chroma-pieces-overlay-$$.png";
-    system("inkscape -w $width_png -h $height_png -e $file_png_overlay $file_svg_overlay");
+    inkscape_export("", $width_png, $height_png, $file_png_overlay, $file_svg_overlay);
 
     $file_png_overlay_double = "/tmp/chroma-pieces-double-$$.png";
-    system("inkscape -w $width_png -h $height_png -e $file_png_overlay_double $file_svg_overlay_double");
+    inkscape_export("", $width_png, $height_png, $file_png_overlay_double, $file_svg_overlay_double);
 
     $file_png_partial = "/tmp/chroma-pieces-partial-$$.png";
     system("convert -compose overlay -composite $file_png_base $file_png_overlay $file_png_partial");
diff -pruN 1.19-1/resources/make-pieces-zen.pl 1.19-1ubuntu1/resources/make-pieces-zen.pl
--- 1.19-1/resources/make-pieces-zen.pl	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/resources/make-pieces-zen.pl	2021-10-27 17:51:17.000000000 +0000
@@ -21,6 +21,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+require './inkscape_export.pm';
 
 if($#ARGV != 1)
 {
@@ -85,7 +86,7 @@ sub make_pieces
     $background = "-b \"#000000\"" if($partial);
 
     # Use Inkscape to convert the SVG to a PNG
-    system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+    inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
 
     for($piece = 0; $piece < $rows * $columns; $piece ++)
     {
diff -pruN 1.19-1/resources/make-wall-marble.pl 1.19-1ubuntu1/resources/make-wall-marble.pl
--- 1.19-1/resources/make-wall-marble.pl	2021-10-26 16:43:34.000000000 +0000
+++ 1.19-1ubuntu1/resources/make-wall-marble.pl	2021-10-27 17:51:17.000000000 +0000
@@ -21,6 +21,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+require './inkscape_export.pm';
+
 if($#ARGV != 1)
 {
     print STDERR "Usage: make-wall-marble.pl <pieces.svg> <directory>\n";
@@ -69,5 +71,5 @@ sub make_pieces
     $background = "";
 
     # Use Inkscape to convert the SVG to a PNG
-    system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+    inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
 }
