commit dc10087ea770602b8bbec62f683cc7a3673a30d1
parent 0362c09432601f8dd3950f6b9fd431721e3878e4
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Thu, 17 Sep 2020 21:35:50 +0300
gpxtrackposter: fix build
Diffstat:
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/pkgs/tools/geo/gpxtrackposter/default.nix b/pkgs/tools/geo/gpxtrackposter/default.nix
@@ -8,15 +8,34 @@ python3Packages.buildPythonApplication {
inherit pname version;
src = sources.gpxtrackposter;
+ patches = [ ./fix-localedir.patch ];
+
postPatch = ''
substituteInPlace gpxtrackposter/poster.py \
- --replace "ATHLETE" ""
+ --replace "self.translate(\"ATHLETE\")" "\"\""
+ substituteInPlace gpxtrackposter/cli.py \
+ --subst-var out
'';
- propagatedBuildInputs = with python3Packages; [ appdirs gpxpy svgwrite colour s2sphere ];
+ propagatedBuildInputs = with python3Packages; [
+ appdirs
+ dateutil
+ gpxpy
+ svgwrite
+ colour
+ s2sphere
+ pint
+ pytz
+ setuptools
+ timezonefinder
+ ];
checkInputs = with python3Packages; [ pytestCheckHook ];
+ postInstall = ''
+ rm -fr $out/requirements*.txt
+ '';
+
meta = with lib; {
inherit (sources.gpxtrackposter) description homepage;
license = licenses.mit;
diff --git a/pkgs/tools/geo/gpxtrackposter/fix-localedir.patch b/pkgs/tools/geo/gpxtrackposter/fix-localedir.patch
@@ -0,0 +1,12 @@
+diff --git i/gpxtrackposter/cli.py w/gpxtrackposter/cli.py
+index 3de36cf..7ff0818 100755
+--- i/gpxtrackposter/cli.py
++++ w/gpxtrackposter/cli.py
+@@ -62,6 +62,7 @@ def main() -> None:
+ "--localedir",
+ metavar="DIR",
+ type=str,
++ default="@out@/share/locale",
+ help="The directory where the translation files can be found (default: the system's locale directory).",
+ )
+ args_parser.add_argument(