gentoo-ebuilds/media-gfx/displaycal-py3/displaycal-py3-3.9.10-r3.ebuild
Eli Schwartz e94bf085fb
media-gfx/displaycal-py3: remove incorrect upstream certifi dependency
Upstream's setup.cfg has several oddities to it, including claiming an
RDEPEND on dev-python/build from when they copied their requirements.txt
verbatim into setup.cfg.

As for certifi specifically, it is handled in a fiddly try/except that
falls back to using a bundled copy that is copied over from certifi into
displaycal iff building a py2app/py2exe edition, and if that still
doesn't work, silently does nothing.

The object of all this is that if a custom cacert.pem is found
somewhere, it goes and sets os.environ['SSL_CERT_FILE'] to affect later
uses of urllib.request.

Reasonably enough, none of this is needed except on Windows and macOS,
so displaycal does precisely that: runs this entire thing only on
Windows and macOS. On Linux, it never even attempts to import certifi,
nor set an environment variable. So we shouldn't depend on it either.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2023-12-05 05:20:33 +01:00

71 lines
1.6 KiB
Bash

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 xdg
MY_PN="DisplayCAL"
MY_P="${MY_PN}-${PV}"
SRC_URI="https://github.com/eoyilmaz/displaycal-py3/releases/download/${PV}/${MY_P}.tar.gz"
KEYWORDS="~amd64"
S="${WORKDIR}/${MY_P}"
DESCRIPTION="Modernize the DisplayCAL code including Python 3 support"
HOMEPAGE="https://github.com/eoyilmaz/displaycal-py3"
LICENSE="GPL-3"
SLOT="0"
IUSE=""
RESTRICT="test"
PATCHES="${FILESDIR}/${P}-python-3.11.patch"
DEPEND="
dev-python/build[${PYTHON_USEDEP}]
dev-python/dbus-python[${PYTHON_USEDEP}]
dev-python/distro[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/pillow[${PYTHON_USEDEP}]
dev-python/pychromecast[${PYTHON_USEDEP}]
dev-python/send2trash[${PYTHON_USEDEP}]
dev-python/zeroconf[${PYTHON_USEDEP}]
>=dev-python/wxpython-4.2.0[${PYTHON_USEDEP}]
media-gfx/argyllcms
x11-libs/libXxf86vm"
RDEPEND="${DEPEND}"
src_prepare() {
# Fix QA warning
sed -e 's/license_file/license_files/g' -i setup.cfg || die
# remove dependency only imported if `sys.platform in ("darwin", "win32")`
sed -e '/certifi/d' -i setup.cfg || die
# Remove x-world MIME
sed -i 's|x-world/x-vrml;||g' \
misc/displaycal-vrml-to-x3d-converter.desktop || die
distutils-r1_src_prepare
}
src_install() {
distutils-r1_src_install
# Use Gentoo package name for doc folder
mv "${ED}/usr/share/doc/${MY_P}" "${ED}/usr/share/doc/${PF}" || die
}
pkg_postinst() {
xdg_pkg_postinst
}
pkg_postrm() {
xdg_pkg_postrm
}