2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2023-03-15 16:39:30 +00:00
|
|
|
, python310
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchPypi
|
2021-04-12 18:23:04 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, gdk-pixbuf
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome
|
2021-04-12 18:23:04 +00:00
|
|
|
, gpsbabel
|
2020-04-24 23:36:52 +00:00
|
|
|
, glib-networking
|
|
|
|
, glibcLocales
|
2021-04-12 18:23:04 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, gtk3
|
|
|
|
, perl
|
|
|
|
, sqlite
|
2020-04-24 23:36:52 +00:00
|
|
|
, tzdata
|
2021-04-12 18:23:04 +00:00
|
|
|
, webkitgtk
|
|
|
|
, wrapGAppsHook
|
2021-05-20 23:08:51 +00:00
|
|
|
, xvfb-run
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-03-15 16:39:30 +00:00
|
|
|
python = python310.override {
|
2021-04-12 18:23:04 +00:00
|
|
|
packageOverrides = (self: super: {
|
|
|
|
matplotlib = super.matplotlib.override {
|
|
|
|
enableGtk3 = true;
|
|
|
|
};
|
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-04-12 18:23:04 +00:00
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pytrainer";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "2.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pytrainer";
|
|
|
|
repo = "pytrainer";
|
|
|
|
rev = "v${version}";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-t61vHVTKN5KsjrgbhzljB7UZdRask7qfYISd+++QbV0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2023-08-22 20:05:09 +00:00
|
|
|
sqlalchemy
|
2021-04-12 18:23:04 +00:00
|
|
|
python-dateutil
|
|
|
|
matplotlib
|
|
|
|
lxml
|
2020-04-24 23:36:52 +00:00
|
|
|
setuptools
|
2021-04-12 18:23:04 +00:00
|
|
|
requests
|
|
|
|
gdal
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sqlite
|
|
|
|
gtk3
|
|
|
|
webkitgtk
|
|
|
|
glib-networking
|
2021-05-20 23:08:51 +00:00
|
|
|
gnome.adwaita-icon-theme
|
2021-04-12 18:23:04 +00:00
|
|
|
gdk-pixbuf
|
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix" "PATH" ":" (lib.makeBinPath [ perl gpsbabel ])
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-12 18:23:04 +00:00
|
|
|
glibcLocales
|
|
|
|
perl
|
2021-05-20 23:08:51 +00:00
|
|
|
xvfb-run
|
2021-04-12 18:23:04 +00:00
|
|
|
] ++ (with python.pkgs; [
|
|
|
|
mysqlclient
|
|
|
|
psycopg2
|
|
|
|
]);
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pytrainer/platform.py \
|
|
|
|
--replace 'sys.prefix' "\"$out\""
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
env \
|
|
|
|
HOME=$TEMPDIR \
|
|
|
|
TZDIR=${tzdata}/share/zoneinfo \
|
2020-04-24 23:36:52 +00:00
|
|
|
TZ=Europe/Kaliningrad \
|
2023-08-22 20:05:09 +00:00
|
|
|
LC_TIME=C \
|
2020-04-24 23:36:52 +00:00
|
|
|
xvfb-run -s '-screen 0 800x600x24' \
|
2023-03-15 16:39:30 +00:00
|
|
|
${python.interpreter} setup.py test
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-04-12 18:23:04 +00:00
|
|
|
homepage = "https://github.com/pytrainer/pytrainer";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Application for logging and graphing sporting excursions";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pytrainer";
|
2021-04-12 18:23:04 +00:00
|
|
|
maintainers = with maintainers; [ rycee dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|