diff --git a/pkgs/by-name/ki/kikit/default.nix b/pkgs/by-name/ki/kikit/default.nix index 45209545aa3d..886cca973837 100644 --- a/pkgs/by-name/ki/kikit/default.nix +++ b/pkgs/by-name/ki/kikit/default.nix @@ -16,13 +16,10 @@ , pcbnew-transition , pybars3 , versioneer +, shapely_1_8 }: let solidpython = callPackage ./solidpython { }; - - # https://github.com/yaqwsx/KiKit/issues/574 - # copy-pasted from nixpkgs#8d8e62e74f511160a599471549a98bc9e4f4818d - shapely = callPackage ./shapely { }; in buildPythonApplication rec { pname = "kikit"; @@ -48,7 +45,8 @@ buildPythonApplication rec { wxPython_4_2 pcbnew-transition pybars3 - shapely + # https://github.com/yaqwsx/KiKit/issues/574 + shapely_1_8 # https://github.com/yaqwsx/KiKit/issues/576 solidpython ]; diff --git a/pkgs/development/libraries/geos/3.11.nix b/pkgs/development/libraries/geos/3.11.nix new file mode 100644 index 000000000000..90bdfdb0d605 --- /dev/null +++ b/pkgs/development/libraries/geos/3.11.nix @@ -0,0 +1,47 @@ +{ lib +, stdenv +, callPackage +, fetchpatch +, fetchurl +, testers + +, cmake +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "geos"; + version = "3.11.2"; + + src = fetchurl { + url = "https://download.osgeo.org/geos/${finalAttrs.pname}-${finalAttrs.version}.tar.bz2"; + hash = "sha256-sfB3ZpSBxaPmKv/EnpbrBvKBmHpdNv2rIlIX5bgl5Mw="; + }; + + patches = [ + # Pull upstream fix of `gcc-13` build failure: + # https://github.com/libgeos/geos/pull/805 + (fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/libgeos/geos/commit/bea3188be44075034fd349f5bb117c943bdb7fb1.patch"; + hash = "sha256-dQT3Hf9YJchgjon/r46TLIXXbE6C0ZnewyvfYJea4jM="; + }) + ]; + + nativeBuildInputs = [ cmake ]; + + doCheck = true; + + passthru.tests = { + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + geos = callPackage ./tests.nix { geos = finalAttrs.finalPackage; }; + }; + + meta = with lib; { + description = "C/C++ library for computational geometry with a focus on algorithms used in geographic information systems (GIS) software"; + homepage = "https://libgeos.org"; + license = licenses.lgpl21Only; + maintainers = teams.geospatial.members; + pkgConfigModules = [ "geos" ]; + mainProgram = "geosop"; + }; +}) diff --git a/pkgs/development/libraries/geos/default.nix b/pkgs/development/libraries/geos/default.nix index 90bdfdb0d605..fc3cff98d7e8 100644 --- a/pkgs/development/libraries/geos/default.nix +++ b/pkgs/development/libraries/geos/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , callPackage -, fetchpatch , fetchurl , testers @@ -10,23 +9,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "geos"; - version = "3.11.2"; + version = "3.12.1"; src = fetchurl { url = "https://download.osgeo.org/geos/${finalAttrs.pname}-${finalAttrs.version}.tar.bz2"; - hash = "sha256-sfB3ZpSBxaPmKv/EnpbrBvKBmHpdNv2rIlIX5bgl5Mw="; + hash = "sha256-1up+SSIktRGT6CRP4+wXxNRNB3fzwyyk+xcRQFSaDQM="; }; - patches = [ - # Pull upstream fix of `gcc-13` build failure: - # https://github.com/libgeos/geos/pull/805 - (fetchpatch { - name = "gcc-13.patch"; - url = "https://github.com/libgeos/geos/commit/bea3188be44075034fd349f5bb117c943bdb7fb1.patch"; - hash = "sha256-dQT3Hf9YJchgjon/r46TLIXXbE6C0ZnewyvfYJea4jM="; - }) - ]; - nativeBuildInputs = [ cmake ]; doCheck = true; @@ -40,8 +29,9 @@ stdenv.mkDerivation (finalAttrs: { description = "C/C++ library for computational geometry with a focus on algorithms used in geographic information systems (GIS) software"; homepage = "https://libgeos.org"; license = licenses.lgpl21Only; + mainProgram = "geosop"; maintainers = teams.geospatial.members; pkgConfigModules = [ "geos" ]; - mainProgram = "geosop"; + changelog = "https://github.com/libgeos/geos/releases/tag/${finalAttrs.finalPackage.version}"; }; }) diff --git a/pkgs/development/python-modules/django/3.nix b/pkgs/development/python-modules/django/3.nix index 077ea73bd8b9..295094c65928 100644 --- a/pkgs/development/python-modules/django/3.nix +++ b/pkgs/development/python-modules/django/3.nix @@ -3,7 +3,7 @@ , buildPythonPackage , fetchPypi , substituteAll -, geos39 +, geos_3_9 , gdal , asgiref , pytz @@ -33,7 +33,7 @@ buildPythonPackage rec { ] ++ lib.optional withGdal (substituteAll { src = ./django_3_set_geos_gdal_lib.patch; - inherit geos39; + inherit geos_3_9; inherit gdal; extension = stdenv.hostPlatform.extensions.sharedLibrary; }); diff --git a/pkgs/development/python-modules/django/django_3_set_geos_gdal_lib.patch b/pkgs/development/python-modules/django/django_3_set_geos_gdal_lib.patch index 15f0773dcf4f..a7dfa086a0a7 100644 --- a/pkgs/development/python-modules/django/django_3_set_geos_gdal_lib.patch +++ b/pkgs/development/python-modules/django/django_3_set_geos_gdal_lib.patch @@ -18,7 +18,7 @@ diff -Nur a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos lib_path = settings.GEOS_LIBRARY_PATH except (AttributeError, ImportError, ImproperlyConfigured, OSError): - lib_path = None -+ lib_path = "@geos39@/lib/libgeos_c@extension@" ++ lib_path = "@geos_3_9@/lib/libgeos_c@extension@" # Setting the appropriate names for the GEOS-C library. if lib_path: diff --git a/pkgs/development/python-modules/pygeos/default.nix b/pkgs/development/python-modules/pygeos/default.nix index 91c4231d604d..657da35b4ad3 100644 --- a/pkgs/development/python-modules/pygeos/default.nix +++ b/pkgs/development/python-modules/pygeos/default.nix @@ -2,7 +2,7 @@ , buildPythonPackage , fetchPypi , python -, geos +, geos_3_11 , pytestCheckHook , cython , numpy @@ -19,7 +19,7 @@ buildPythonPackage rec { }; nativeBuildInputs = [ - geos # for geos-config + geos_3_11 # for geos-config cython ]; diff --git a/pkgs/by-name/ki/kikit/shapely/default.nix b/pkgs/development/python-modules/shapely/1.8.nix similarity index 60% rename from pkgs/by-name/ki/kikit/shapely/default.nix rename to pkgs/development/python-modules/shapely/1.8.nix index 7f136a1338ad..28a248af0bed 100644 --- a/pkgs/by-name/ki/kikit/shapely/default.nix +++ b/pkgs/development/python-modules/shapely/1.8.nix @@ -2,39 +2,32 @@ , stdenv , buildPythonPackage , fetchPypi -, substituteAll -, pythonOlder -, geos , pytestCheckHook +, pythonOlder +, substituteAll + , cython +, geos_3_11 , numpy +, oldest-supported-numpy +, setuptools +, wheel }: buildPythonPackage rec { pname = "Shapely"; - version = "1.8.4"; - disabled = pythonOlder "3.6"; + version = "1.8.5"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-oZXlHKr6IYKR8suqP+9p/TNTyT7EtlsqRyLEz0DDGYw="; + hash = "sha256-6CttYOz7EkEgyI/hBqR4WWu+qxQhFtfn9ko2TayQKpI="; }; - nativeBuildInputs = [ - geos # for geos-config - cython - ]; - - propagatedBuildInputs = [ - numpy - ]; - - checkInputs = [ - pytestCheckHook - ]; - # Environment variable used in shapely/_buildcfg.py - GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}"; + GEOS_LIBRARY_PATH = "${geos_3_11}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}"; patches = [ # Patch to search form GOES .so/.dylib files in a Nix-aware way @@ -45,6 +38,30 @@ buildPythonPackage rec { }) ]; + postPatch = '' + substituteInPlace pyproject.toml --replace "setuptools<64" "setuptools" + ''; + + nativeBuildInputs = [ + cython + geos_3_11 # for geos-config + oldest-supported-numpy + setuptools + wheel + ]; + + buildInputs = [ + geos_3_11 + ]; + + propagatedBuildInputs = [ + numpy + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + preCheck = '' rm -r shapely # prevent import of local shapely ''; @@ -63,9 +80,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "shapely" ]; meta = with lib; { - description = "Geometric objects, predicates, and operations"; - homepage = "https://pypi.python.org/pypi/Shapely/"; - license = with licenses; [ bsd3 ]; - maintainers = with maintainers; [ knedlsepp ]; + changelog = "https://github.com/shapely/shapely/blob/${version}/CHANGES.txt"; + description = "Manipulation and analysis of geometric objects"; + homepage = "https://github.com/shapely/shapely"; + license = licenses.bsd3; + maintainers = teams.geospatial.members; }; } diff --git a/pkgs/by-name/ki/kikit/shapely/library-paths.patch b/pkgs/development/python-modules/shapely/library-paths.patch similarity index 100% rename from pkgs/by-name/ki/kikit/shapely/library-paths.patch rename to pkgs/development/python-modules/shapely/library-paths.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47fb24617d1f..e3311d2b5f47 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21459,7 +21459,9 @@ with pkgs; stdenv = if stdenv.cc.isClang then overrideLibcxx llvmPackages_14.stdenv else stdenv; }; - geos39 = callPackage ../development/libraries/geos/3.9.nix { }; + geos_3_9 = callPackage ../development/libraries/geos/3.9.nix { }; + + geos_3_11 = callPackage ../development/libraries/geos/3.11.nix { }; getdata = callPackage ../development/libraries/getdata { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 88bbd7673a7f..c67a151c8064 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13022,6 +13022,8 @@ self: super: with self; { shapely = callPackage ../development/python-modules/shapely { }; + shapely_1_8 = callPackage ../development/python-modules/shapely/1.8.nix { }; + shaperglot = callPackage ../development/python-modules/shaperglot { }; sharedmem = callPackage ../development/python-modules/sharedmem { };