Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save radfish/8e8844eff7b631ef1f592bd432ae4d5e to your computer and use it in GitHub Desktop.
Save radfish/8e8844eff7b631ef1f592bd432ae4d5e to your computer and use it in GitHub Desktop.
From 5b40e248a99dda50211a19769b707f4fb112103b Mon Sep 17 00:00:00 2001
From: redfish <redfish@galactica.pw>
Date: Sat, 17 Apr 2021 21:12:05 -0400
Subject: [PATCH] install sgmllib3k via setuptools
This fixes packages that check existance of this dependency via distutils.
Those checks fail when sgmllib3k is not installed via setup.py:
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py",
line 3243, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py",
line 3226, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py",
line 3255, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py",
line 568, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py",
line 886, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py",
line 772, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'sgmllib3k' distribution was not
found and is required by FeedParser
[
---
.SRCINFO | 2 +-
PKGBUILD | 16 ++++++----------
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/.SRCINFO b/.SRCINFO
index 62d63de..f0980a7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-feedparser-dev
pkgdesc = Parse RSS and Atom feeds in Python: development version
pkgver = 6.0.2
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/kurtmckee/feedparser/
arch = any
license = custom
diff --git a/PKGBUILD b/PKGBUILD
index d0a68ad..3d4939a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,8 @@
pkgbase=python-feedparser-dev
pkgname=('python-feedparser-dev' 'python-sgmllib3k')
pkgver=6.0.2
-pkgrel=2
+_sgmllib3k_ver=1.0.0
+pkgrel=3
pkgdesc="Parse RSS and Atom feeds in Python: development version"
arch=('any')
url="https://github.com/kurtmckee/feedparser/"
@@ -14,13 +15,13 @@ conflicts=('python-feedparser')
makedepends=('python' 'libxml2' 'python-setuptools')
depends=('python' 'libxml2')
source=(feedparser-${pkgver}.tar.gz::https://github.com/kurtmckee/feedparser/archive/${pkgver}.tar.gz
- https://files.pythonhosted.org/packages/source/s/sgmllib3k/sgmllib3k-1.0.0.tar.gz)
+ https://files.pythonhosted.org/packages/source/s/sgmllib3k/sgmllib3k-${_sgmllib3k_ver}.tar.gz)
sha256sums=('b211cfb80c4daefca64b773ade77340727187564fad9c2c94b37da8e1f03788f'
'7868fb1c8bfa764c1ac563d3cf369c381d1325d36124933a726f29fcdaa812e9')
build() {
- cd "${srcdir}/sgmllib3k-1.0.0"
+ cd "${srcdir}/sgmllib3k-${_sgmllib3k_ver}"
python /usr/lib/$(readlink /usr/bin/python3)/compileall.py sgmllib.py
}
@@ -39,11 +40,6 @@ package_python-sgmllib3k() {
pkgdesc="Port of sgmllib to Python3"
license=('PSF')
- ext="3$(readlink /usr/bin/python3 | sed -En "s/python3.//p")"
- cd "${srcdir}/sgmllib3k-1.0.0"
- install -Dm644 sgmllib.py \
- "${pkgdir}/usr/lib/$(readlink /usr/bin/python3)/site-packages/sgmllib.py"
- install -Dm644 __pycache__/sgmllib.cpython-${ext}.pyc \
- "${pkgdir}/usr/lib/$(readlink /usr/bin/python3)/site-packages/__pycache__/sgmllib.cpython-${ext}.pyc"
+ cd "${srcdir}/sgmllib3k-${_sgmllib3k_ver}"
+ python setup.py install --root="${pkgdir}"
}
-
--
2.30.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment