2016-06-10 22:41:44 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, lib
|
2016-10-05 17:04:03 +00:00
|
|
|
, autoconf, automake, gnum4, libtool, perl, gnulib, uthash, pkgconfig, gettext
|
2015-04-01 01:49:45 +00:00
|
|
|
, python, freetype, zlib, glib, libungif, libpng, libjpeg, libtiff, libxml2, pango
|
2015-01-12 12:17:28 +00:00
|
|
|
, withGTK ? false, gtk2
|
2016-06-10 22:41:44 +00:00
|
|
|
, withPython ? true
|
2016-08-12 03:19:25 +00:00
|
|
|
, Carbon ? null, Cocoa ? null
|
2007-08-21 12:31:33 +00:00
|
|
|
}:
|
|
|
|
|
2016-06-10 22:41:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-01-12 12:17:28 +00:00
|
|
|
name = "fontforge-${version}";
|
2016-06-10 22:41:44 +00:00
|
|
|
version = "20160404";
|
2015-01-12 12:17:28 +00:00
|
|
|
|
2016-06-10 22:41:44 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fontforge";
|
|
|
|
repo = "fontforge";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "15nacq84n9gvlzp3slpmfrrbh57kfb6lbdlc46i7aqgci4qv6fg0";
|
2007-08-21 12:31:33 +00:00
|
|
|
};
|
2012-02-06 05:49:27 +00:00
|
|
|
|
2015-01-12 12:17:28 +00:00
|
|
|
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";
|
|
|
|
|
|
|
|
buildInputs = [
|
2016-10-05 17:04:03 +00:00
|
|
|
autoconf automake gnum4 libtool perl pkgconfig gettext uthash
|
2015-01-12 12:17:28 +00:00
|
|
|
python freetype zlib glib libungif libpng libjpeg libtiff libxml2
|
|
|
|
]
|
2016-08-29 20:27:34 +00:00
|
|
|
++ lib.optionals withGTK [ gtk2 pango ]
|
2016-09-04 03:38:23 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
|
2015-01-12 12:17:28 +00:00
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
lib.optionals (!withPython) [ "--disable-python-scripting" "--disable-python-extension" ]
|
2016-09-04 03:39:43 +00:00
|
|
|
++ lib.optional withGTK "--enable-gtk2-use"
|
|
|
|
++ lib.optional (!withGTK) "--without-x";
|
2012-02-06 05:49:27 +00:00
|
|
|
|
2016-10-05 17:04:03 +00:00
|
|
|
# work-around: git isn't really used, but configuration fails without it
|
2015-01-12 12:17:28 +00:00
|
|
|
preConfigure = ''
|
2016-10-05 17:04:03 +00:00
|
|
|
export GIT="$(type -P true)"
|
2015-01-12 12:17:28 +00:00
|
|
|
cp -r "${gnulib}" ./gnulib
|
|
|
|
chmod +w -R ./gnulib
|
|
|
|
./bootstrap --skip-git --gnulib-srcdir=./gnulib
|
2008-03-26 12:57:30 +00:00
|
|
|
'';
|
2007-08-21 12:31:33 +00:00
|
|
|
|
2015-01-12 12:17:28 +00:00
|
|
|
postInstall =
|
|
|
|
# get rid of the runtime dependency on python
|
|
|
|
lib.optionalString (!withPython) ''
|
|
|
|
rm -r "$out/share/fontforge/python"
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A font editor";
|
|
|
|
homepage = http://fontforge.github.io;
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
};
|
2007-08-21 12:31:33 +00:00
|
|
|
}
|
2015-01-12 12:17:28 +00:00
|
|
|
|