1{ stdenv, fetchFromGitHub, buildPerlPackage, makeWrapper, gawk
2, makeFontsConf, freefont_ttf, gnuplot, perl, perlPackages
3}:
4
5let
6
7 fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
8
9in
10
11buildPerlPackage rec {
12 name = "feedgnuplot-${version}";
13 version = "1.49";
14
15 src = fetchFromGitHub {
16 owner = "dkogan";
17 repo = "feedgnuplot";
18 rev = "v${version}";
19 sha256 = "1bjnx36rsxlj845w9apvdjpza8vd9rbs3dlmgvky6yznrwa6sm02";
20 };
21
22 outputs = [ "out" ];
23
24 nativeBuildInputs = [ makeWrapper gawk ];
25
26 buildInputs = [ gnuplot perl ]
27 ++ (with perlPackages; [ ListMoreUtils IPCRun StringShellQuote ]);
28
29 # Fontconfig error: Cannot load default config file
30 FONTCONFIG_FILE = fontsConf;
31
32 postPatch = ''
33 patchShebangs .
34 '';
35
36 # Tests require gnuplot 4.6.4 and are completely skipped with gnuplot 5.
37 doCheck = false;
38
39 postInstall = ''
40 wrapProgram $out/bin/feedgnuplot \
41 --prefix "PATH" ":" "$PATH" \
42 --prefix "PERL5LIB" ":" "$PERL5LIB"
43 install -D -m 444 -t $out/share/bash-completion/completions \
44 completions/bash/feedgnuplot
45 install -D -m 444 -t $out/share/zsh/site-functions \
46 completions/zsh/_feedgnuplot
47 '';
48
49 meta = with stdenv.lib; {
50 description = "General purpose pipe-oriented plotting tool";
51 homepage = https://github.com/dkogan/feedgnuplot/;
52 license = with licenses; [ artistic1 gpl1Plus ];
53 platforms = platforms.unix;
54 maintainers = with maintainers; [ mnacamura ];
55 };
56}