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-10-21 18:38:19 +00:00
|
|
|
version = "4.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qalculate";
|
|
|
|
repo = "libqalculate";
|
|
|
|
rev = "v${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-/TgsGlO8RJ3L+2425odye365QqBzCHrr1Z4zUj+Ld8I=";
|
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-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ gebner doronbehar alyaeanyx ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "qalc";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|