default.nix (1669B)
1 { lib, fetchFromGitHub, fetchpatch, python3Packages, s2sphere }: 2 3 python3Packages.buildPythonApplication rec { 4 pname = "gpxtrackposter"; 5 version = "2023-02-19"; 6 7 src = fetchFromGitHub { 8 owner = "flopp"; 9 repo = "gpxtrackposter"; 10 rev = "0b86e7223eaeea3e168f5b68ee7b8fe4ca8532b5"; 11 hash = "sha256-pSMfHNpGt68Elgi4NGrBlnZxpsuS7WhqM6kBDcihLu8="; 12 }; 13 14 patches = [ 15 # Fix TimezoneAdjuster 16 (fetchpatch { 17 url = "https://github.com/flopp/GpxTrackPoster/commit/4ccfbe89ae49cbac18b773d2cada2c75aead67b1.patch"; 18 hash = "sha256-1nnZZO4KipT/mDwBLZgrbpE1HbwGOGbYM9D5cnmp8zY="; 19 }) 20 ./fix-localedir.patch 21 ]; 22 23 postPatch = '' 24 substituteInPlace gpxtrackposter/poster.py \ 25 --replace "self.translate(\"ATHLETE\")" "\"\"" 26 substituteInPlace gpxtrackposter/cli.py \ 27 --subst-var out 28 sed -i 's/~=.*//' requirements.txt 29 ''; 30 31 propagatedBuildInputs = with python3Packages; [ 32 appdirs 33 colour 34 geopy 35 gpxpy 36 pint 37 pytz 38 s2sphere 39 svgwrite 40 stravalib 41 polyline 42 timezonefinder 43 setuptools 44 ]; 45 46 nativeCheckInputs = with python3Packages; [ 47 pytestCheckHook 48 (pytest-mock.overrideAttrs (old: rec { 49 pname = "pytest-mock"; 50 version = "3.3.1"; 51 src = fetchPypi { 52 inherit pname version; 53 hash = "sha256-pNbTcynkqJPnfZ/6ieg43StF1dwJmYTPA8cDrIQRu4I="; 54 }; 55 })) 56 ]; 57 58 doCheck = false; 59 60 postInstall = "rm -fr $out/requirements*.txt"; 61 62 meta = with lib; { 63 description = "Create a visually appealing poster from your GPX tracks"; 64 inherit (src.meta) homepage; 65 license = licenses.mit; 66 maintainers = [ maintainers.sikmir ]; 67 }; 68 }