ploticus: Use gd from Nixpkgs instead of the vendored one

The gd version shipped with ploticus only contains a single font
that does not support anything but ASCII.

In order for the package to be able to render Unicode texts,
we need freetype support:

http://ploticus.sourceforge.net/doc/fonts.html

+43
+9
pkgs/tools/graphics/ploticus/default.nix
··· 4 , zlib 5 , libX11 6 , libpng 7 }: 8 9 stdenv.mkDerivation rec { ··· 21 22 # Set the location of the PREFABS directory. 23 ./set-prefabs-dir.patch 24 ]; 25 26 buildInputs = [ 27 zlib 28 libX11 29 libpng 30 ]; 31 32 hardeningDisable = [ "format" ];
··· 4 , zlib 5 , libX11 6 , libpng 7 + , gd 8 + , freetype 9 }: 10 11 stdenv.mkDerivation rec { ··· 23 24 # Set the location of the PREFABS directory. 25 ./set-prefabs-dir.patch 26 + 27 + # Use gd from Nixpkgs instead of the vendored one. 28 + # This is required for non-ASCII fonts to work: 29 + # http://ploticus.sourceforge.net/doc/fonts.html 30 + ./use-gd-package.patch 31 ]; 32 33 buildInputs = [ 34 zlib 35 libX11 36 libpng 37 + gd 38 + freetype 39 ]; 40 41 hardeningDisable = [ "format" ];
+34
pkgs/tools/graphics/ploticus/use-gd-package.patch
···
··· 1 + --- a/src/Makefile 2 + +++ b/src/Makefile 3 + @@ -91,10 +91,10 @@ 4 + 5 + 6 + ########### Option 1: use bundled GD16 (PNG only). Requires libpng and zlib. 7 + -exetarget: plpng 8 + -GD16LIBS = -lpng -lz 9 + -GD16H = -I/usr/local/include 10 + -ZFLAG = -DWZ 11 + +# exetarget: plpng 12 + +# GD16LIBS = -lpng -lz 13 + +# GD16H = -I/usr/local/include 14 + +# ZFLAG = -DWZ 15 + ### These should remain commented unless your libs are not in usual places, then alter to suit... 16 + ### GD16LIBS = /home/scg/lib/libpng.a /home/scg/lib/libz.a 17 + ### GD16H = -I/home/scg/lib 18 + @@ -111,11 +111,11 @@ 19 + 20 + ########### Option 4: use your own GD resource with FreeType2 (ttf) fonts enabled. 21 + ########### Requires GD 1.84+, libpng, zlib, libjpeg and libfreetype 22 + -# exetarget: plgd18 23 + -# GD18LIBS = -lgd -lpng -lz -ljpeg -lfreetype 24 + -# GD18H = 25 + -# GDFREETYPE = -DGDFREETYPE 26 + -# ZFLAG = -DWZ 27 + +exetarget: plgd18 28 + +GD18LIBS = -lgd -lpng -lz -ljpeg -lfreetype 29 + +GD18H = 30 + +GDFREETYPE = -DGDFREETYPE 31 + +ZFLAG = -DWZ 32 + 33 + ########### Option 5: don't use GD at all. 34 + # exetarget: plnogd