571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
68 lines
1.6 KiB
Nix
68 lines
1.6 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, makeWrapper
|
|
, makeFontsConf
|
|
, freefont_ttf
|
|
, gnuplot
|
|
, perl
|
|
, perlPackages
|
|
, stdenv
|
|
, shortenPerlShebang
|
|
, installShellFiles
|
|
}:
|
|
|
|
let
|
|
|
|
fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
|
|
|
|
in
|
|
|
|
perlPackages.buildPerlPackage rec {
|
|
pname = "feedgnuplot";
|
|
version = "1.61";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "dkogan";
|
|
repo = "feedgnuplot";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-r5rszxr65lSozkUNaqfBn4I4XjLtvQ6T/BG366JXLRM=";
|
|
};
|
|
|
|
outputs = [ "out" ];
|
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;
|
|
|
|
buildInputs = [ gnuplot perl ]
|
|
++ (with perlPackages; [ ListMoreUtils IPCRun StringShellQuote ]);
|
|
|
|
# Fontconfig error: Cannot load default config file
|
|
FONTCONFIG_FILE = fontsConf;
|
|
|
|
postPatch = ''
|
|
patchShebangs .
|
|
'';
|
|
|
|
# Tests require gnuplot 4.6.4 and are completely skipped with gnuplot 5.
|
|
doCheck = false;
|
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
shortenPerlShebang $out/bin/feedgnuplot
|
|
'' + ''
|
|
wrapProgram $out/bin/feedgnuplot \
|
|
--prefix "PATH" ":" "$PATH" \
|
|
--prefix "PERL5LIB" ":" "$PERL5LIB"
|
|
|
|
installShellCompletion --bash --name feedgnuplot.bash completions/bash/feedgnuplot
|
|
installShellCompletion --zsh completions/zsh/_feedgnuplot
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "General purpose pipe-oriented plotting tool";
|
|
homepage = "https://github.com/dkogan/feedgnuplot/";
|
|
license = with licenses; [ artistic1 gpl1Plus ];
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ mnacamura ];
|
|
mainProgram = "feedgnuplot";
|
|
};
|
|
}
|