diff --git a/srcpkgs/python3-dominate/patches/strip-version.patch b/srcpkgs/python3-dominate/patches/strip-version.patch new file mode 100644 index 00000000000..c3fc2bc0f4f --- /dev/null +++ b/srcpkgs/python3-dominate/patches/strip-version.patch @@ -0,0 +1,22 @@ +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 09:55:31.893470107 -0400 ++++ ./setup.py 2023-09-29 09:56:17.655743399 -0400 +@@ -19,14 +19,11 @@ + + from setuptools import setup + +-import imp +-_version = imp.load_source("dominate._version", "dominate/_version.py") +- + long_description = open('README.md').read() + + setup( + name = 'dominate', +- version = _version.__version__, ++ version = '@@VERSION@@', + author = 'Tom Flanagan and Jake Wharton', + author_email = 'tom@zkpq.ca', + license = 'LGPLv3', diff --git a/srcpkgs/python3-dominate/template b/srcpkgs/python3-dominate/template index 19e0f070382..6990c54131d 100644 --- a/srcpkgs/python3-dominate/template +++ b/srcpkgs/python3-dominate/template @@ -1,7 +1,7 @@ # Template file for 'python3-dominate' pkgname=python3-dominate version=2.8.0 -revision=1 +revision=2 build_style=python3-module hostmakedepends="python3-setuptools" depends="python3" @@ -13,6 +13,11 @@ homepage="https://github.com/Knio/dominate" distfiles="https://github.com/Knio/dominate/archive/${version}.tar.gz" checksum=4e55f84b8446fe4338a7acaf60bbb1cb133a81c4c7a46a196b904c9f8387d377 +post_patch() { + # Adjust the version properly + vsed -i -e "s/@@VERSION@@/${version}/" setup.py +} + pre_check() { # this fix the failed test in i686 # https://github.com/Knio/dominate/issues/175