Skip to content

Commit

Permalink
dev-python/basemap: Added @ksunden 's patches from
Browse files Browse the repository at this point in the history
matplotlib/basemap#576

The package seems to be working :D

Signed-off-by: Tomas Fabrizio Orsi <[email protected]>
  • Loading branch information
lima-limon-inc committed Jun 6, 2024
1 parent 189937e commit 9bf60a3
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ emaint sync -r lemon-lime
- sdl2cpp: https://github.com/libSDL2pp/libSDL2pp

- mininet: https://github.com/mininet/mininet

- Matplotlib's basemap: https://github.com/matplotlib/basemap
1 change: 1 addition & 0 deletions dev-python/basemap-data-hires/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST basemap-data-hires-1.4.1.gh.tar.gz 129993453 BLAKE2B b6ce839550026b562425f7fb856571e1ce42afeb4cf83a1c096012ddf900f9e8c80a845789d3ac62eb31bc325e8690351b12497e5d1b07f6c0f1c280c64991b0 SHA512 b92171305e423c1a36025150f96358ef89676f36ffd651f00b9a607bb606d01d10539e0a7160b12d8ec6c29c6be191390c98f4228daf02f790e08705c4ee52a4
29 changes: 29 additions & 0 deletions dev-python/basemap-data-hires/basemap-data-hires-1.4.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_EXT=1
inherit distutils-r1

DESCRIPTION="Plot on map projections "
HOMEPAGE="https://matplotlib.org/basemap/stable/"
SRC_URI="https://github.com/matplotlib/basemap/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/basemap-${PV}/packages/basemap_data_hires"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
"

PATCHES=(
"${FILESDIR}/namespace-change.patch"
)

DEPEND="${RDEPEND}"
BDEPEND="
dev-python/cython
"
57 changes: 57 additions & 0 deletions dev-python/basemap-data-hires/files/namespace-change.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From cbe0cb6fc45b34e30675bad65a770ac292cb155d Mon Sep 17 00:00:00 2001
From: Kyle Sunden <[email protected]>
Date: Thu, 8 Jun 2023 16:42:59 -0500
Subject: [PATCH 1/3] Convert to new style namespace packages

---

--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@
import os
import itertools
from setuptools import setup
-from setuptools import find_packages
+from setuptools import find_namespace_packages


def get_content(name, splitlines=False):
@@ -92,7 +92,7 @@ def get_content(name, splitlines=False):
"package_dir":
{"": "src"},
"packages":
- find_packages(where="src"),
+ find_namespace_packages(where="src"),
"package_data": {
"mpl_toolkits.basemap_data":
data_files,


--- a/src/mpl_toolkits/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- pass # must not have setuptools

--- a/src/mpl_toolkits/basemap_data/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- pass # must not have setuptools

--- a/setup.py
+++ b/setup.py
@@ -86,9 +86,6 @@ def get_content(name, splitlines=False):
"maps",
"plots",
],
- "namespace_packages": [
- "mpl_toolkits.basemap_data",
- ],
"package_dir":
{"": "src"},
"packages":
1 change: 1 addition & 0 deletions dev-python/basemap-data/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST basemap-data-1.4.1.gh.tar.gz 129993453 BLAKE2B b6ce839550026b562425f7fb856571e1ce42afeb4cf83a1c096012ddf900f9e8c80a845789d3ac62eb31bc325e8690351b12497e5d1b07f6c0f1c280c64991b0 SHA512 b92171305e423c1a36025150f96358ef89676f36ffd651f00b9a607bb606d01d10539e0a7160b12d8ec6c29c6be191390c98f4228daf02f790e08705c4ee52a4
29 changes: 29 additions & 0 deletions dev-python/basemap-data/basemap-data-1.4.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_EXT=1
inherit distutils-r1

DESCRIPTION="Plot on map projections "
HOMEPAGE="https://matplotlib.org/basemap/stable/"
SRC_URI="https://github.com/matplotlib/basemap/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/basemap-${PV}/packages/basemap_data"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
"

PATCHES=(
"${FILESDIR}/namespace-change.patch"
)

DEPEND="${RDEPEND}"
BDEPEND="
dev-python/cython
"
57 changes: 57 additions & 0 deletions dev-python/basemap-data/files/namespace-change.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From cbe0cb6fc45b34e30675bad65a770ac292cb155d Mon Sep 17 00:00:00 2001
From: Kyle Sunden <[email protected]>
Date: Thu, 8 Jun 2023 16:42:59 -0500
Subject: [PATCH 1/3] Convert to new style namespace packages

---

--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@
import os
import itertools
from setuptools import setup
-from setuptools import find_packages
+from setuptools import find_namespace_packages


def get_content(name, splitlines=False):
@@ -114,7 +114,7 @@ def get_content(name, splitlines=False):
"package_dir":
{"": "src"},
"packages":
- find_packages(where="src"),
+ find_namespace_packages(where="src"),
"package_data": {
"mpl_toolkits.basemap_data":
data_files,


--- a/src/mpl_toolkits/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- pass # must not have setuptools

--- a/src/mpl_toolkits/basemap_data/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- pass # must not have setuptools

--- a/setup.py
+++ b/setup.py
@@ -108,9 +108,6 @@ def get_content(name, splitlines=false):
"maps",
"plots",
],
- "namespace_packages": [
- "mpl_toolkits.basemap_data",
- ],
"package_dir":
{"": "src"},
"packages":
1 change: 1 addition & 0 deletions dev-python/basemap/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST basemap-1.4.1.gh.tar.gz 129993453 BLAKE2B b6ce839550026b562425f7fb856571e1ce42afeb4cf83a1c096012ddf900f9e8c80a845789d3ac62eb31bc325e8690351b12497e5d1b07f6c0f1c280c64991b0 SHA512 b92171305e423c1a36025150f96358ef89676f36ffd651f00b9a607bb606d01d10539e0a7160b12d8ec6c29c6be191390c98f4228daf02f790e08705c4ee52a4
36 changes: 36 additions & 0 deletions dev-python/basemap/basemap-1.4.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_EXT=1
inherit distutils-r1

DESCRIPTION="Plot on map projections "
HOMEPAGE="https://matplotlib.org/basemap/stable/"
SRC_URI="https://github.com/matplotlib/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${P}/packages/${PN}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
sci-libs/geos
dev-python/matplotlib
dev-python/numpy
dev-python/pyproj
sci-libs/pyshp
dev-python/basemap-data
dev-python/basemap-data-hires
"

PATCHES=(
"${FILESDIR}/namespace-change.patch"
)

DEPEND="${RDEPEND}"
BDEPEND="
dev-python/cython
"
55 changes: 55 additions & 0 deletions dev-python/basemap/files/namespace-change.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From cbe0cb6fc45b34e30675bad65a770ac292cb155d Mon Sep 17 00:00:00 2001
From: Kyle Sunden <[email protected]>
Date: Thu, 8 Jun 2023 16:42:59 -0500
Subject: [PATCH 1/3] Convert to new style namespace packages

---

--- a/setup.py
+++ b/setup.py
@@ -10,6 +10,6 @@
import glob
import warnings
from setuptools import setup
-from setuptools import find_packages
+from setuptools import find_namespace_packages
from setuptools.command.sdist import sdist
from setuptools.extension import Extension


--- a/setup.py
+++ b/setup.py
@@ -230,7 +230,7 @@ def run(self):
"package_dir":
{"": "src"},
"packages":
- find_packages(where="src"),
+ find_namespace_packages(where="src"),
"ext_modules":
ext_modules,
"data_files":


--- a/src/mpl_toolkits/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from __future__ import (absolute_import, division, print_function)
-
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- pass # must not have setuptools


--- a/setup.py
+++ b/setup.py
@@ -224,9 +224,6 @@ def run(self):
"maps",
"plots",
],
- "namespace_packages": [
- "mpl_toolkits",
- ],
"package_dir":
{"": "src"},
"packages":

0 comments on commit 9bf60a3

Please sign in to comment.