2020-07-15 13:07:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-01-07 13:47:47 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
2020-07-15 13:07:19 +00:00
|
|
|
, gmp
|
|
|
|
, halibut
|
2022-01-07 13:47:47 +00:00
|
|
|
, ncurses
|
2020-07-15 13:07:19 +00:00
|
|
|
, perl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "spigot";
|
2022-01-07 13:47:47 +00:00
|
|
|
version = "20210527";
|
|
|
|
srcVersion = "20210527.7dd3cfd";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.chiark.greenend.org.uk/~sgtatham/spigot/${pname}-${srcVersion}.tar.gz";
|
|
|
|
hash = "sha256-EBS3lgfLtsyBQ8mzoJPyZhRBJNmkVSeF5XecGgcvqtw=";
|
2020-07-15 13:07:19 +00:00
|
|
|
};
|
|
|
|
|
2022-01-07 13:47:47 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
halibut
|
|
|
|
perl
|
|
|
|
];
|
2020-07-15 13:07:19 +00:00
|
|
|
|
2022-01-07 13:47:47 +00:00
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
ncurses
|
|
|
|
];
|
2020-07-15 13:07:19 +00:00
|
|
|
|
2022-01-07 13:47:47 +00:00
|
|
|
outputs = [ "out" "man" ];
|
2020-07-15 13:07:19 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2022-01-08 02:46:34 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
[ `$out/bin/spigot -b 10 -d 10 e` == "2.7182818284" ] || exit 1
|
|
|
|
[ `$out/bin/spigot -b 10 -d 10 pi` == "3.1415926535" ] || exit 1
|
|
|
|
[ `$out/bin/spigot -b 10 -d 10 sqrt\(2\)` == "1.4142135623" ] || exit 1
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2020-07-15 13:07:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.chiark.greenend.org.uk/~sgtatham/spigot/";
|
2022-01-07 13:47:47 +00:00
|
|
|
description = "A command-line exact real calculator";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ AndersonTorres mcbeth ];
|
|
|
|
platforms = platforms.unix;
|
2020-07-15 13:07:19 +00:00
|
|
|
};
|
|
|
|
}
|