configuration/packages/gpx-reduce.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2022-08-11 01:40:19 +00:00
{ fetchFromGitHub
, lib
, stdenv
# Dependencies
, python3
}:
stdenv.mkDerivation {
pname = "gpx-reduce";
version = "unstable-2021-05-04";
src = fetchFromGitHub {
owner = "Alezy80";
repo = "gpx_reduce";
rev = "ce03b057ecf7072a36479cd93a82a3add83cb6c7";
hash = "sha256-/LvGhGJaHGsGaYVFAdvuvWvSlFF2E8hTVL+xXwAG7SA=";
};
patches = [ (builtins.toFile "2to3.patch" ''
--- a/gpx_reduce.py
+++ b/gpx_reduce.py
@@ -1 +1 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
@@ -37 +36,0 @@
-from __future__ import print_function
@@ -222 +221 @@
- progress = None
+ progress = 0
'') ];
buildInputs = [ (python3.withPackages (p: with p; [ iso8601 lxml matplotlib scipy ])) ];
doCheck = true;
checkPhase = "python3 gpx_reduce.py --help > /dev/null";
installPhase = ''
install -D gpx_reduce.py $out/bin/gpx_reduce
'';
meta = {
description = "Script that removes unnecessary points from GPX files";
homepage = "https://github.com/Alezy80/gpx_reduce";
license = lib.licenses.gpl3Plus;
};
}