nixpkgs/pkgs/applications/science/math/nasc/default.nix

99 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, stdenv
2018-03-10 11:21:36 +00:00
, fetchFromGitHub
, pkg-config
2021-01-09 20:59:35 +00:00
, fetchpatch
, python3
, meson
, ninja
, vala
2018-03-10 11:21:36 +00:00
, gtk3
, glib
2018-08-20 21:31:18 +01:00
, pantheon
, libsoup
2019-02-13 21:47:50 +00:00
, gtksourceview
, libgee
, nix-update-script
, webkitgtk
2018-03-10 11:21:36 +00:00
, libqalculate
, intltool
, gnuplot
, wrapGAppsHook
}:
2018-03-10 11:21:36 +00:00
stdenv.mkDerivation rec {
pname = "nasc";
version = "0.7.5";
2018-03-10 11:21:36 +00:00
src = fetchFromGitHub {
owner = "parnold-x";
repo = pname;
2018-03-10 11:21:36 +00:00
rev = version;
sha256 = "kSRc5RLkI6SBJirUYw6swZi8IJhaL3y74b2Zw8kh2XA=";
fetchSubmodules = true;
2018-03-10 11:21:36 +00:00
};
2021-01-09 20:59:35 +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";
})
];
2018-03-10 11:21:36 +00:00
nativeBuildInputs = [
glib # post_install.py
gtk3 # post_install.py
intltool # for libqalculate
meson
ninja
pkg-config
python3
vala
2018-08-20 21:31:18 +01:00
wrapGAppsHook
2018-03-10 11:21:36 +00:00
];
2018-11-10 13:15:27 +00:00
2018-03-10 11:21:36 +00:00
buildInputs = [
glib
gtk3
2019-02-13 21:47:50 +00:00
gtksourceview
libgee
pantheon.elementary-icon-theme
pantheon.granite
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 = {
2020-08-31 18:53:25 +01:00
updateScript = nix-update-script {
attrPath = pname;
};
};
2018-03-10 11:21:36 +00:00
meta = with lib; {
description = "Do maths like a normal person, designed for elementary OS";
2018-03-10 11:21:36 +00:00
longDescription = ''
Its 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 its used in.
'';
homepage = "https://github.com/parnold-x/nasc";
maintainers = pantheon.maintainers;
2018-03-10 11:21:36 +00:00
platforms = platforms.linux;
license = licenses.gpl3Plus;
};
}