diff options
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | .nvchecker.toml | 3 | ||||
-rw-r--r-- | PKGBUILD | 62 | ||||
-rw-r--r-- | python3.12-compatibility.patch | 49 |
5 files changed, 119 insertions, 22 deletions
@@ -1,16 +1,19 @@ -# Generated by mksrcinfo v8 -# Thu Apr 14 19:43:23 UTC 2016 pkgbase = cmake-lint pkgdesc = Check for coding style issues in CMake files - pkgver = 1.3.4.1 - pkgrel = 1 - url = http://github.com/richq/cmake-lint/ + pkgver = 1.4.2 + pkgrel = 7 + url = https://github.com/cmake-lint/cmake-lint arch = any - license = APACHE + license = Apache-2.0 + checkdepends = python-pytest + makedepends = python-build + makedepends = python-installer makedepends = python-setuptools + makedepends = python-wheel depends = python - source = https://github.com/richq/cmake-lint/archive/v1.3.4.1.tar.gz - md5sums = 81bbc87d65a27a88a5121f58843d4c8c + source = cmake-lint-1.4.2.tar.gz::https://github.com/cmake-lint/cmake-lint/archive/1.4.2.tar.gz + source = python3.12-compatibility.patch + sha256sums = bf060987c74e07890f7314a4832c2e54ffb9c5c1e6d799387bc438010f918676 + sha256sums = 4f1573fa02d542067f0d20eb178f50354bed451173c4f73175098ca4c6e569c1 pkgname = cmake-lint - diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..f121dd0b3998 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +* +!.gitignore +!.nvchecker.toml +!.SRCINFO +!PKGBUILD +!python3.12-compatibility.patch diff --git a/.nvchecker.toml b/.nvchecker.toml new file mode 100644 index 000000000000..8ee0460c80a7 --- /dev/null +++ b/.nvchecker.toml @@ -0,0 +1,3 @@ +[cmake-lint] +source = "pypi" +pypi = "cmakelint" @@ -1,21 +1,57 @@ +# Maintainer: Carl Smedstad <carsme@archlinux.org> +# Contributor: Richard Quirk + pkgname=cmake-lint -pkgver=1.3.4.1 -pkgrel=1 +pkgver=1.4.2 +pkgrel=7 pkgdesc="Check for coding style issues in CMake files" -arch=('any') -url="http://github.com/richq/cmake-lint/" -license=('APACHE') -depends=('python') -makedepends=('python-setuptools') -source=("https://github.com/richq/$pkgname/archive/v$pkgver.tar.gz") -md5sums=('960df861a984e721df08e2c57eb18e36') +arch=(any) +url="https://github.com/cmake-lint/cmake-lint" +license=(Apache-2.0) +depends=(python) +makedepends=( + python-build + python-installer + python-setuptools + python-wheel +) +checkdepends=(python-pytest) +source=( + "$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz" + "python3.12-compatibility.patch" +) +sha256sums=( + 'bf060987c74e07890f7314a4832c2e54ffb9c5c1e6d799387bc438010f918676' + '4f1573fa02d542067f0d20eb178f50354bed451173c4f73175098ca4c6e569c1' +) + +_archive="$pkgname-$pkgver" + +prepare() { + cd "$_archive" + + patch --forward --strip=1 --input="$srcdir/python3.12-compatibility.patch" +} build() { - cd "$srcdir/$pkgname-$pkgver" - python setup.py build + cd "$_archive" + + python -m build --wheel --no-isolation --skip-dependency-check +} + +check() { + cd "$_archive" + + rm -rf tmp_install + python -m installer --destdir=tmp_install dist/*.whl + + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + export PYTHONPATH="$PWD/tmp_install/$site_packages" + pytest --override-ini="addopts=" } package() { - cd "$srcdir/$pkgname-$pkgver" - python ./setup.py install --prefix=/usr --root="$pkgdir" + cd "$_archive" + + python -m installer --destdir="$pkgdir" dist/*.whl } diff --git a/python3.12-compatibility.patch b/python3.12-compatibility.patch new file mode 100644 index 000000000000..5e67b1bee5ba --- /dev/null +++ b/python3.12-compatibility.patch @@ -0,0 +1,49 @@ +diff --unified --recursive --text --new-file cmake-lint-1.4.2.orig/setup.py cmake-lint-1.4.2/setup.py +--- cmake-lint-1.4.2.orig/setup.py 2024-04-22 15:48:16.433625415 +0200 ++++ cmake-lint-1.4.2/setup.py 2024-04-22 15:59:27.546256097 +0200 +@@ -1,22 +1,13 @@ + #! /usr/bin/env python + +-import imp ++from importlib.machinery import SourceFileLoader + + from setuptools import setup + + + def get_version(): +- ver_file = None +- try: +- ver_file, pathname, description = imp.find_module( +- '__version__', ['cmakelint']) +- vermod = imp.load_module( +- '__version__', ver_file, pathname, description) +- version = vermod.VERSION +- return version +- finally: +- if ver_file is not None: +- ver_file.close() ++ version_module = SourceFileLoader('__version__', 'cmakelint/__version__.py').load_module() ++ return version_module.VERSION + + + def read_without_comments(filename): +@@ -30,7 +21,6 @@ + setup(name='cmakelint', + version=get_version(), + packages=['cmakelint'], +- scripts=['bin/cmakelint'], + entry_points={ + 'console_scripts': [ + 'cmakelint = cmakelint.main:main' +diff --unified --recursive --text --new-file cmake-lint-1.4.2.orig/test/cmakelint_test.py cmake-lint-1.4.2/test/cmakelint_test.py +--- cmake-lint-1.4.2.orig/test/cmakelint_test.py 2024-04-22 15:48:16.433625415 +0200 ++++ cmake-lint-1.4.2/test/cmakelint_test.py 2024-04-22 15:59:27.539589434 +0200 +@@ -19,7 +19,7 @@ + + import cmakelint.__version__ + import cmakelint.main +-import mock ++from unittest import mock + + + # stderr suppression from https://stackoverflow.com/a/1810086 |