2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, autoreconfHook, buildPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl, flex, readline, ed, texinfo
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "bc";
|
|
|
|
version = "1.07.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "mirror://gnu/bc/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a";
|
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [ "--with-readline" ];
|
|
|
|
|
|
|
|
# As of 1.07 cross-compilation is quite complicated as the build system wants
|
|
|
|
# to build a code generator, bc/fbc, on the build machine.
|
|
|
|
patches = [ ./cross-bc.patch ];
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
# Tools
|
|
|
|
autoreconfHook ed flex texinfo
|
|
|
|
# Libraries for build
|
|
|
|
buildPackages.readline buildPackages.ncurses
|
|
|
|
];
|
|
|
|
buildInputs = [ readline flex ];
|
|
|
|
|
|
|
|
doCheck = true; # not cross
|
|
|
|
|
|
|
|
# Hack to make sure we never to the relaxation `$PATH` and hooks support for
|
2023-05-24 13:37:59 +00:00
|
|
|
# compatibility. This will be replaced with something clearer in a future
|
2020-04-24 23:36:52 +00:00
|
|
|
# masss-rebuild.
|
|
|
|
strictDeps = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "GNU software calculator";
|
|
|
|
homepage = "https://www.gnu.org/software/bc/";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|