From 21b11bfc0e42936c2c5f8c51f9d9de7de9f9c327 Mon Sep 17 00:00:00 2001 From: Rakesh Gupta Date: Thu, 6 Feb 2020 18:02:44 +0530 Subject: [PATCH] mapproxy: init at 1.12.0 --- pkgs/applications/misc/mapproxy/default.nix | 63 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/applications/misc/mapproxy/default.nix diff --git a/pkgs/applications/misc/mapproxy/default.nix b/pkgs/applications/misc/mapproxy/default.nix new file mode 100644 index 000000000000..efdfbaadd3da --- /dev/null +++ b/pkgs/applications/misc/mapproxy/default.nix @@ -0,0 +1,63 @@ +{ lib +, pkgs +, python +}: +let + py = python.override { + packageOverrides = self: super: { + pyproj = super.pyproj.overridePythonAttrs (oldAttrs: rec { + version = "1.9.6"; + src = pkgs.fetchFromGitHub { + owner = "pyproj4"; + repo = "pyproj"; + rev = "v${version}rel"; + sha256 = "sha256:18v4h7jx4mcc0x2xy8y7dfjq9bzsyxs8hdb6v67cabvlz2njziqy"; + }; + nativeBuildInputs = with python.pkgs; [ cython ]; + patches = [ ]; + checkPhase = '' + runHook preCheck + pushd unittest # changing directory should ensure we're importing the global pyproj + ${python.interpreter} test.py && ${python.interpreter} -c "import doctest, pyproj, sys; sys.exit(doctest.testmod(pyproj)[0])" + popd + runHook postCheck + ''; + }); + }; + }; +in +with py.pkgs; +buildPythonApplication rec { + pname = "MapProxy"; + version = "1.12.0"; + src = fetchPypi { + inherit pname version; + sha256 = "622e3a7796ef861ba21e42231b49c18d00d75f03eaf3f01a2b7687be7568e2ec"; + }; + prePatch = '' + substituteInPlace mapproxy/util/ext/serving.py --replace "args = [sys.executable] + sys.argv" "args = sys.argv" + ''; + propagatedBuildInputs = [ + pillow + pyyaml + pyproj + shapely + gdal + lxml + setuptools + ]; + # Tests are disabled: + # 1) Dependency list is huge. + # https://github.com/mapproxy/mapproxy/blob/master/requirements-tests.txt + # + # 2) There are security issues with package Riak + # https://github.com/NixOS/nixpkgs/issues/33876 + # https://github.com/NixOS/nixpkgs/pull/56480 + doCheck = false; + meta = with lib; { + description = "MapProxy is an open source proxy for geospatial data"; + homepage = https://mapproxy.org/; + license = licenses.asl20; + maintainers = with maintainers; [ rakesh4g ]; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e351a5f90642..0c9b909a9d06 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1929,6 +1929,8 @@ in lynis = callPackage ../tools/security/lynis { }; + mapproxy = callPackage ../applications/misc/mapproxy { }; + marlin-calc = callPackage ../tools/misc/marlin-calc {}; mathics = with python2Packages; toPythonApplication mathics;