2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, intltool
|
|
|
|
, pkg-config
|
|
|
|
, doxygen
|
|
|
|
, autoreconfHook
|
|
|
|
, buildPackages
|
|
|
|
, curl
|
|
|
|
, gettext
|
|
|
|
, libiconv
|
2022-06-16 17:23:12 +00:00
|
|
|
, readline
|
2023-10-09 19:29:22 +00:00
|
|
|
, libxml2
|
|
|
|
, mpfr
|
|
|
|
, icu
|
|
|
|
, gnuplot
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libqalculate";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "4.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qalculate";
|
|
|
|
repo = "libqalculate";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
sha256 = "sha256-4WqKlwVf4/ixVr98lPFVfNL6EOIfHHfL55xLsYqxkhY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
intltool
|
|
|
|
pkg-config
|
|
|
|
autoreconfHook
|
|
|
|
doxygen
|
|
|
|
];
|
|
|
|
depsBuildBuild = [
|
|
|
|
buildPackages.stdenv.cc
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
gettext
|
|
|
|
libiconv
|
|
|
|
readline
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
libxml2
|
|
|
|
mpfr
|
|
|
|
icu
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|