about summary refs log tree commit diff
path: root/pkgs/tools/misc/fontforge
diff options
context:
space:
mode:
authorVolth <volth@webmaster.ms>2017-08-12 14:22:45 +0000
committerVolth <volth@webmaster.ms>2017-08-12 22:38:57 +0000
commit038507969699230fdc0b3086ad9cfaad7058f389 (patch)
tree3c1040f1071658a5820fe62e987eb4a40495d92c /pkgs/tools/misc/fontforge
parentf0f55ac6cdad02d4d2682148994ef9456458bba4 (diff)
fontforge: 20160404 -> 20170730 + support reproducible builds
Diffstat (limited to 'pkgs/tools/misc/fontforge')
-rw-r--r--pkgs/tools/misc/fontforge/default.nix28
-rw-r--r--pkgs/tools/misc/fontforge/fontforge-20140813-use-system-uthash.patch30
-rw-r--r--pkgs/tools/misc/fontforge/fontforge-fonttools.nix14
3 files changed, 59 insertions, 13 deletions
diff --git a/pkgs/tools/misc/fontforge/default.nix b/pkgs/tools/misc/fontforge/default.nix
index ca636420854ac..f79bb123b34e1 100644
--- a/pkgs/tools/misc/fontforge/default.nix
+++ b/pkgs/tools/misc/fontforge/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, lib
+{ stdenv, fetchFromGitHub, fetchpatch, lib, runCommand
 , autoconf, automake, gnum4, libtool, perl, gnulib, uthash, pkgconfig, gettext
 , python, freetype, zlib, glib, libungif, libpng, libjpeg, libtiff, libxml2, pango
 , withSpiro ? false, libspiro
@@ -9,22 +9,30 @@
 
 stdenv.mkDerivation rec {
   name = "fontforge-${version}";
-  version = "20160404";
+  version = "20170730";
+
+  # The way $version propagates to $version of .pe-scripts (https://github.com/dejavu-fonts/dejavu-fonts/blob/358190f/scripts/generate.pe#L19)
+  SOURCE_DATE_EPOCH = lib.fileContents (runCommand "unixtime-of-${version}" {} "date -d ${version} +%s > $out");
 
   src = fetchFromGitHub {
     owner = "fontforge";
     repo = "fontforge";
     rev = version;
-    sha256 = "15nacq84n9gvlzp3slpmfrrbh57kfb6lbdlc46i7aqgci4qv6fg0";
+    sha256 = "15k6x97383p8l40jvcivalhwgbbcdg5vciyjz6m9r0lrlnjqkv99";
   };
 
-  patches = [(fetchpatch {
-    name = "use-system-uthash.patch";
-    url = "http://pkgs.fedoraproject.org/cgit/fontforge.git/plain/"
-      + "fontforge-20140813-use-system-uthash.patch?id=8bdf933";
-    sha256 = "0n8i62qv2ygfii535rzp09vvjx4qf9zp5qq7qirrbzm1l9gykcjy";
-  })];
-  patchFlags = "-p0";
+  patches = [
+    ./fontforge-20140813-use-system-uthash.patch
+
+    (fetchpatch {
+       url = "https://github.com/fontforge/fontforge/compare/${version}...volth:rb-${version}.patch";
+       name = "fontforge-${version}-reproducible-build.patch";
+       sha256 = "089w94xnc0ik3rfx9b7q124x9n1nzbyzzcyynl1x31d22byxgl34";
+     })
+  ];
+
+  # do not use x87's 80-bit arithmetic, rouding errors result in very different font binaries
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.isi686 [ "-msse2" "-mfpmath=sse" ];
 
   buildInputs = [
     autoconf automake gnum4 libtool perl pkgconfig gettext uthash
diff --git a/pkgs/tools/misc/fontforge/fontforge-20140813-use-system-uthash.patch b/pkgs/tools/misc/fontforge/fontforge-20140813-use-system-uthash.patch
new file mode 100644
index 0000000000000..27c8274c1d211
--- /dev/null
+++ b/pkgs/tools/misc/fontforge/fontforge-20140813-use-system-uthash.patch
@@ -0,0 +1,30 @@
+--- a/Makefile.am.old	2014-08-12 10:07:32.000000000 +0530
++++ b/Makefile.am	2014-09-08 16:23:56.046996941 +0530
+@@ -43,7 +43,6 @@
+ AM_CPPFLAGS =
+ AM_LDFLAGS =
+ 
+-BUILT_SOURCES = uthash/src
+ EXTRA_DIST =
+ CLEANFILES =
+ MOSTLYCLEANFILES =
+@@ -113,7 +112,6 @@
+ 	Packaging/FontForge-doc.spec \
+ 	Packaging/FontForge.spec \
+ 	Packaging/FontForge.static.spec \
+-	uthash/src \
+ 	$(NULL)
+ 
+ #--------------------------------------------------------------------------
+@@ -129,11 +127,6 @@
+ 
+ 
+ #--------------------------------------------------------------------------
+-uthash/src:
+-	if [ ! -e uthash/src ]; then \
+-	if [ -e uthash ] ; then rm -r uthash ; fi ; \
+-	git clone https://github.com/troydhanson/uthash ; \
+-	fi ;
+ 
+ # We import a selection of targets from Frank's standard packaging Makefile.
+ 
diff --git a/pkgs/tools/misc/fontforge/fontforge-fonttools.nix b/pkgs/tools/misc/fontforge/fontforge-fonttools.nix
index 046c1d4492014..0f82f4ad6389b 100644
--- a/pkgs/tools/misc/fontforge/fontforge-fonttools.nix
+++ b/pkgs/tools/misc/fontforge/fontforge-fonttools.nix
@@ -1,7 +1,15 @@
-{stdenv, fontforge, zlib}:
+{stdenv, fetchFromGitHub, zlib}:
+
 stdenv.mkDerivation rec {
-  name = "fontforge-fonttools-${fontforge.version}";
-  src = fontforge.src;
+  version = "20160404";
+  name = "fontforge-fonttools-${version}";
+
+  src = fetchFromGitHub {
+    owner = "fontforge";
+    repo = "fontforge";
+    rev = version;
+    sha256 = "15nacq84n9gvlzp3slpmfrrbh57kfb6lbdlc46i7aqgci4qv6fg0";
+  };
 
   buildInputs = [zlib];