diff --git a/srcpkgs/python3-pathtools/patches/strip-version.patch b/srcpkgs/python3-pathtools/patches/strip-version.patch new file mode 100644 index 00000000000..e247849fc80 --- /dev/null +++ b/srcpkgs/python3-pathtools/patches/strip-version.patch @@ -0,0 +1,29 @@ +Python 3.12 drops the imp module, and rather than implement a convoluted +replacement for imp.load_source to automatically populate the package version, +we can just add a placeholder and vsed it in the template. + +--- ./setup.py.orig 2023-09-29 14:08:21.605034790 -0400 ++++ ./setup.py 2023-09-29 14:08:47.085183549 -0400 +@@ -22,13 +22,8 @@ + # THE SOFTWARE. + + import os +-import imp + from setuptools import setup + +-PKG_DIR = 'pathtools' +-version = imp.load_source('version', +- os.path.join(PKG_DIR, 'version.py')) +- + def read_file(filename): + """ + Reads the contents of a given file relative to the directory +@@ -40,7 +35,7 @@ + return open(os.path.join(os.path.dirname(__file__), filename)).read() + + setup(name='pathtools', +- version=version.VERSION_STRING, ++ version='@@VERSION@@', + description='File system general utilities', + long_description=read_file('README'), + author="Yesudeep Mangalapilly", diff --git a/srcpkgs/python3-pathtools/template b/srcpkgs/python3-pathtools/template index 0874986d422..b841140aae6 100644 --- a/srcpkgs/python3-pathtools/template +++ b/srcpkgs/python3-pathtools/template @@ -1,7 +1,7 @@ # Template file for 'python3-pathtools' pkgname=python3-pathtools version=0.1.2 -revision=6 +revision=7 build_style=python3-module hostmakedepends="python3-setuptools" depends="python3" @@ -12,6 +12,10 @@ homepage="https://github.com/gorakhargosh/pathtools" distfiles="${PYPI_SITE}/p/pathtools/pathtools-${version}.tar.gz" checksum=7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0 +post_patch() { + vsed -i -e "s/@@VERSION@@/${version}/" setup.py +} + post_install() { vlicense LICENSE }