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";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "5.0.0";
|
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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-VhaGgtSU6+7eMY7ksQMpybmt2JBI80Nwgu7PCKrTorA=";
|
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
|
|
|
})
|