diff options
author | Mark Wagie | 2023-05-14 09:29:25 -0600 |
---|---|---|
committer | Mark Wagie | 2023-05-14 09:29:25 -0600 |
commit | 5901e6896ec7ae9dadebbd4e909baf490061b7d9 (patch) | |
tree | a038e64b441b2d079df057455dbac04d428f2493 | |
parent | db687c953451b31f4fd6739297be9a390ccc546d (diff) | |
download | aur-5901e6896ec7ae9dadebbd4e909baf490061b7d9.tar.gz |
fixes & improvements
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | 0000-use-system-libsass.patch | 26 | ||||
-rw-r--r-- | PKGBUILD | 54 |
4 files changed, 52 insertions, 57 deletions
@@ -1,16 +1,22 @@ pkgbase = python-libsass pkgdesc = Sass for Python: A straightforward binding of libsass for Python. pkgver = 0.22.0 - pkgrel = 1 + pkgrel = 2 url = https://sass.github.io/libsass-python/ arch = x86_64 - license = MIT License - makedepends = gcc - depends = python-six + arch = aarch64 + license = MIT + checkdepends = python-pip + checkdepends = python-pytest + checkdepends = python-werkzeug + makedepends = git + makedepends = python-build + makedepends = python-installer + makedepends = python-wheel depends = libsass depends = python-setuptools - provides = sassc - source = https://files.pythonhosted.org/packages/source/l/libsass/libsass-0.22.0.tar.gz - sha256sums = 3ab5ad18e47db560f4f0c09e3d28cf3bb1a44711257488ac2adad69f4f7f8425 + provides = _sass.abi3.so + source = git+https://github.com/sass/libsass-python.git#commit=b18db090672676d7c58fcd52e6ae0eb505993886 + sha256sums = SKIP pkgname = python-libsass diff --git a/.gitignore b/.gitignore index 7b092346e423..4dab8d6386e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ -*.tar.gz -*.tar.xz +# Ignore everything +* + +# But not these files... +!.gitignore +!PKGBUILD +!.SRCINFO diff --git a/0000-use-system-libsass.patch b/0000-use-system-libsass.patch deleted file mode 100644 index 74b3774f800f..000000000000 --- a/0000-use-system-libsass.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/setup.py b/setup.py -index f92779a..fcc956a 100644 ---- a/setup.py -+++ b/setup.py -@@ -59,9 +59,9 @@ for directory in ( - for pth, _, filenames in os.walk(directory): - for filename in filenames: - filename = os.path.join(pth, filename) -- if filename.endswith(('.c', '.cpp')): -- sources.append(filename) -- elif filename.endswith('.h'): -+ #if filename.endswith(('.c', '.cpp')): -+ # sources.append(filename) -+ if filename.endswith('.h'): - headers.append(filename) - - if sys.platform == 'win32': -@@ -139,7 +139,7 @@ else: - if platform.system() == 'FreeBSD': - link_flags = ['-fPIC', '-lc++'] - else: -- link_flags = ['-fPIC', '-lstdc++'] -+ link_flags = ['-fPIC', '-lstdc++', '-lsass'] - - sass_extension = Extension( - '_sass', @@ -1,33 +1,43 @@ -_name=libsass +# Maintainer: Mark Wagie <mark at proton dot me> pkgname=python-libsass +_name=${pkgname#python-} pkgver=0.22.0 -pkgrel=1 +pkgrel=2 pkgdesc="Sass for Python: A straightforward binding of libsass for Python." -arch=('x86_64') +arch=('x86_64' 'aarch64') url="https://sass.github.io/libsass-python/" -license=('MIT License') -depends=('python-six' 'libsass' 'python-setuptools') -makedepends=('gcc') -provides=('sassc') -source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/libsass-0.22.0.tar.gz") -sha256sums=('3ab5ad18e47db560f4f0c09e3d28cf3bb1a44711257488ac2adad69f4f7f8425') +license=('MIT') +depends=('libsass' 'python-setuptools') +makedepends=('git' 'python-build' 'python-installer' 'python-wheel') +provides=('_sass.abi3.so') +checkdepends=('python-pip' 'python-pytest' 'python-werkzeug') +_commit=b18db090672676d7c58fcd52e6ae0eb505993886 # tags/0.22.0^0 +source=("git+https://github.com/sass/libsass-python.git#commit=$_commit") +sha256sums=('SKIP') build() { - cd "$srcdir/libsass-0.22.0" - python3 setup.py build + cd "$srcdir/$_name-python" + export SYSTEM_SASS="1" + python -m build --wheel --no-isolation +} + +check() { + cd "$srcdir/$_name-python" + local PLATFORM=$(python -c "import sysconfig; print(sysconfig.get_platform())") + local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') + export PYTHONPATH=build/lib.${PLATFORM}-cpython-${python_version//./} + pytest sasstests.py } package() { - cd "$srcdir/libsass-0.22.0" - python3 setup.py install --root=$pkgdir --optimize=1 --skip-build + cd "$srcdir/$_name-python" + export SYSTEM_SASS="1" + python -m installer --destdir="$pkgdir" dist/*.whl - # make sure we don't install any world-writable or root-readable-only files - # we shouldn't need to fix ownership as we extract tarballs as a non-root user - # https://github.com/pypa/setuptools/issues/1328 - # https://github.com/LonamiWebs/Telethon/issues/1605 - chmod u=rwX,go=rX -R "$pkgdir" - # make sure we don't install annoying files - local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])") - rm -rf "$pkgdir/$_site_packages/tests/" -} + install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + # We don't want to install tests + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + rm "${pkgdir}${site_packages}/sasstests.py" \ + "${pkgdir}${site_packages}"/__pycache__/sasstests.*.pyc +} |