2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, mpfr, gnuplot
|
|
|
|
, readline
|
|
|
|
, libxml2, curl
|
|
|
|
, intltool, libiconv, icu, gettext
|
|
|
|
, pkg-config, doxygen, autoreconfHook, buildPackages
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libqalculate";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "4.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qalculate";
|
|
|
|
repo = "libqalculate";
|
|
|
|
rev = "v${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-yQJykD6ew8LzYzuVP7ycPv+wGGe7LWWlgdI6Z2N87go=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ intltool pkg-config autoreconfHook doxygen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ curl gettext libiconv readline ];
|
2022-06-16 17:23:12 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ libxml2 mpfr icu ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
intltoolize -f
|
|
|
|
'';
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace libqalculate/Calculator-plot.cc \
|
|
|
|
--replace 'commandline = "gnuplot"' 'commandline = "${gnuplot}/bin/gnuplot"' \
|
|
|
|
--replace '"gnuplot - ' '"${gnuplot}/bin/gnuplot - '
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString stdenv.cc.isClang ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace src/qalc.cc \
|
|
|
|
--replace 'printf(_("aborted"))' 'printf("%s", _("aborted"))'
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
pushd docs/reference
|
|
|
|
doxygen Doxyfile
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An advanced calculator library";
|
|
|
|
homepage = "http://qalculate.github.io";
|
|
|
|
license = licenses.gpl2Plus;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ gebner doronbehar ];
|
|
|
|
mainProgram = "qalc";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|