From 9478a7ef8220b0a74dffcca2bdd46c10ae93fd59 Mon Sep 17 00:00:00 2001 From: traxys Date: Sat, 22 Apr 2023 23:57:57 +0200 Subject: [PATCH] fit-trackee: init at 0.7.15 --- .../geospatial/fit-trackee/default.nix | 105 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 107 insertions(+) create mode 100644 pkgs/servers/geospatial/fit-trackee/default.nix diff --git a/pkgs/servers/geospatial/fit-trackee/default.nix b/pkgs/servers/geospatial/fit-trackee/default.nix new file mode 100644 index 000000000000..c7bc7fbc2e5b --- /dev/null +++ b/pkgs/servers/geospatial/fit-trackee/default.nix @@ -0,0 +1,105 @@ +{ lib +, python3 +, fetchFromGitHub +, fetchPypi +, postgresql +, postgresqlTestHook +}: +let + python = python3.override { + packageOverrides = self: super: { + sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec { + version = "1.4.49"; + src = fetchPypi { + pname = "SQLAlchemy"; + inherit version; + hash = "sha256-Bv8ly64ww5bEt3N0ZPKn/Deme32kCZk7GCsCTOyArtk="; + }; + # Remove "test/typing" that does not exist + disabledTestPaths = [ + "test/aaa_profiling" + "test/ext/mypy" + ]; + }); + }; + }; + +in +python.pkgs.buildPythonApplication rec { + pname = "fit-trackee"; + version = "0.7.22"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "SamR1"; + repo = "FitTrackee"; + rev = "v${version}"; + hash = "sha256-aPQ8jLssN9nx0Bpd/44E3sQi2w0cR8ecG76DJjreeHA="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace psycopg2-binary psycopg2 \ + --replace 'poetry>=0.12' 'poetry-core' \ + --replace 'poetry.masonry.api' 'poetry.core.masonry.api' + ''; + + nativeBuildInputs = [ + python3.pkgs.poetry-core + ]; + + propagatedBuildInputs = with python.pkgs; [ + authlib + babel + dramatiq + flask + flask-bcrypt + flask-dramatiq + flask-limiter + flask-migrate + gpxpy + gunicorn + humanize + psycopg2 + pyjwt + pyopenssl + pytz + shortuuid + sqlalchemy + staticmap + ua-parser + ] ++ dramatiq.optional-dependencies.redis; + + pythonImportsCheck = [ "fittrackee" ]; + + nativeCheckInputs = with python.pkgs; [ + pytestCheckHook + freezegun + postgresqlTestHook + postgresql + ]; + + pytestFlagsArray = [ + "fittrackee" + ]; + + postgresqlTestSetupPost = '' + export DATABASE_TEST_URL=postgresql://$PGUSER/$PGDATABAS?host=$PGHOST + ''; + + postInstall = '' + mkdir -p $out/var/share/fittrackee-instance + ''; + + preCheck = '' + export TMP=$(mktemp -d) + ''; + + meta = with lib; { + description = "Self-hosted outdoor activity tracker :bicyclist"; + homepage = "https://github.com/SamR1/FitTrackee"; + changelog = "https://github.com/SamR1/FitTrackee/blob/${src.rev}/CHANGELOG.md"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ traxys ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 358d79cc695e..a5f1109b4ee7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27708,6 +27708,8 @@ with pkgs; ### SERVERS / GEOSPATIAL + fit-trackee = callPackage ../servers/geospatial/fit-trackee { }; + geoserver = callPackage ../servers/geospatial/geoserver { }; mapcache = callPackage ../servers/geospatial/mapcache { };