Files
haikuports/dev-python/unrardll/unrardll-0.1.7.recipe
Oscar Lesta 03e0c51605 unrardll: drop Python 3.9 support.
Only on-tree user (calibre) already targets 3.10 only.
2025-09-19 22:53:14 -03:00

74 lines
1.6 KiB
Bash

SUMMARY="Python wrapper for the UnRAR DLL"
DESCRIPTION="Wrap the Unrar DLL to enable unraring of files in python"
HOMEPAGE="https://github.com/kovidgoyal/unrardll
https://pypi.org/project/unrardll/"
COPYRIGHT="2017 Kovid Goyal"
LICENSE="BSD (3-clause)"
REVISION="2"
SOURCE_URI="https://github.com/kovidgoyal/unrardll/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="ac89d56d1690862b66ee684564c1357e105f9bd8d88d52f9d112c2718bd6f116"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
unrardll$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libunrar$secondaryArchSuffix
"
PYTHON_VERSIONS=(3.10)
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_$pythonPackage=\"
unrardll_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
lib:libunrar$secondaryArchSuffix
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
cmd:gcc$secondaryArchSuffix
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
rm -rf dist
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer --p $prefix dist/*.whl
packageEntries $pythonPackage \
"$prefix"/lib/python*
done
}