There is probably a way to have it work with substituteInPlace, but
using sed is a cheap solution to not having to figure out how to escape
"'$'" in Nix that works in both versions.
Issue #31179.
Fixes#33833.
Before executing the gnuplot executable the environment variable `GDFONTPATH`
is populated with a list of font directories, which is obtained from `fc-list`.
In that process we iterated over each line and called `dirname` on it, which
introduces a performance hit for loading and executing the external executable
`dirname` every time.
The new version avoids the loop.
The author of this patch measured a 42 fold performance improvement:
old version:
$ time ./gnuplot_old/bin/gnuplot -e ''
real 0m3.828s
user 0m0.392s
sys 0m0.465s
new version:
$ time ./gnuplot_new2/bin/gnuplot -e ''
real 0m0.091s
user 0m0.112s
sys 0m0.014s
The correctness of the value of `GDFONTPATH` was confirmed with the following
command and comparing its output between versions:
$ gnuplot -e 'print system("echo $GDFONTPATH")'
This variant uses the more Mac-friendly aqua driver, but it requires
that you separately install the AquaTerm package.
Note that AquaTerm is open source and could perhaps be later included
as a nix derivation. If that happens, it would be nice to remove the
gnuplot_aquaterm top-level attribute and just make it the default.
This patch adds a wrapper script around gnuplot that uses fontconfig's
fc-list(1) utility to determine the set of available fonts and makes that list
available to Gnuplot in the $GDFONTPATH variable.
Changed 'gnuplot' expression to allow for argument overriding instead of
relying on getPkgConfig. While I was at it, I also simplified the actual build
expression a bit.
svn path=/nixpkgs/trunk/; revision=21864
* Merged 'gnuplot' and 'gnuplotX' attributes into one that uses (getPkgConfig
"gnuplot" "x11" false) to determine whether X11 support is desired or not.
* Added Emacs as a build-time dependency to ensure that Gnuplot's lisp code is
installed, too.
* Added optional support for the wxt terminal by means of (getPkgConfig
"gnuplot" "wxGtk" false).
* Removed the '-nix' suffix to the package name. The Gnuplot license requires
a vendor-specific version suffix only in case of modified binary
distributions. That is not the case here.
svn path=/nixpkgs/trunk/; revision=16992
URLs to http://nix.cs.uu.nl/dist/tarballs. With content-addressable
mirror support (r9190, NIXPKGS-70) this is no longer necessary:
fetchurl will try to download from that location automatically. So
we can keep the original URLs.
svn path=/nixpkgs/trunk/; revision=9192