2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
|
, pkg-config
|
2021-01-15 22:18:51 +00:00
|
|
|
|
, fetchpatch
|
2020-09-25 04:45:31 +00:00
|
|
|
|
, python3
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, vala
|
|
|
|
|
, gtk3
|
|
|
|
|
, glib
|
|
|
|
|
, pantheon
|
|
|
|
|
, gtksourceview
|
|
|
|
|
, libgee
|
2020-09-25 04:45:31 +00:00
|
|
|
|
, nix-update-script
|
|
|
|
|
, webkitgtk
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, libqalculate
|
2020-09-25 04:45:31 +00:00
|
|
|
|
, intltool
|
|
|
|
|
, gnuplot
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "nasc";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
version = "0.7.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "parnold-x";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = version;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
sha256 = "kSRc5RLkI6SBJirUYw6swZi8IJhaL3y74b2Zw8kh2XA=";
|
|
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
patches = [
|
|
|
|
|
# fix compilation with gcc10
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
url = "https://github.com/parnold-x/libqalculate/commit/4fa8f2cceada128ef19f82407226b2c230b780d5.patch";
|
|
|
|
|
extraPrefix = "subprojects/libqalculate/";
|
|
|
|
|
stripLen = "1";
|
|
|
|
|
sha256 = "0kbff623zl0s6yx5avx068f2apwzxzvihjahja4qhlkqkhhzj9dm";
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
nativeBuildInputs = [
|
2020-09-25 04:45:31 +00:00
|
|
|
|
glib # post_install.py
|
|
|
|
|
gtk3 # post_install.py
|
|
|
|
|
intltool # for libqalculate
|
|
|
|
|
meson
|
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
|
pkg-config
|
2020-09-25 04:45:31 +00:00
|
|
|
|
python3
|
|
|
|
|
vala
|
2020-04-24 23:36:52 +00:00
|
|
|
|
wrapGAppsHook
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
glib
|
2020-09-25 04:45:31 +00:00
|
|
|
|
gtk3
|
2020-04-24 23:36:52 +00:00
|
|
|
|
gtksourceview
|
|
|
|
|
libgee
|
|
|
|
|
pantheon.elementary-icon-theme
|
|
|
|
|
pantheon.granite
|
2020-09-25 04:45:31 +00:00
|
|
|
|
webkitgtk
|
|
|
|
|
# We add libqalculate's runtime dependencies because nasc has it as a modified subproject.
|
|
|
|
|
] ++ libqalculate.buildInputs ++ libqalculate.propagatedBuildInputs;
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
chmod +x meson/post_install.py
|
|
|
|
|
patchShebangs meson/post_install.py
|
|
|
|
|
|
|
|
|
|
# patch subproject. same code in libqalculate expression
|
|
|
|
|
substituteInPlace subprojects/libqalculate/libqalculate/Calculator-plot.cc \
|
|
|
|
|
--replace 'commandline = "gnuplot"' 'commandline = "${gnuplot}/bin/gnuplot"' \
|
|
|
|
|
--replace '"gnuplot - ' '"${gnuplot}/bin/gnuplot - '
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
|
attrPath = pname;
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
|
description = "Do maths like a normal person, designed for elementary OS";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
longDescription = ''
|
|
|
|
|
It’s an app where you do maths like a normal person. It lets you
|
|
|
|
|
type whatever you want and smartly figures out what is math and
|
|
|
|
|
spits out an answer on the right pane. Then you can plug those
|
|
|
|
|
answers in to future equations and if that answer changes, so does
|
|
|
|
|
the equations it’s used in.
|
|
|
|
|
'';
|
|
|
|
|
homepage = "https://github.com/parnold-x/nasc";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
maintainers = pantheon.maintainers;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
|
};
|
|
|
|
|
}
|