Files
haikuports/dev-python/unrardll/unrardll-0.1.7.recipe
OscarL 98f1f38f40 unrardll: update to version 0.1.7, support Python 3.10. (#9474)
Also switch to build with "build + installer".
2023-09-21 06:38:52 +02:00

75 lines
1.7 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="1"
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_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
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 i in "${!PYTHON_PACKAGES[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
rm -rf dist
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer --p $prefix dist/*.whl
packageEntries ${PYTHON_PACKAGES[i]} \
"$prefix"/lib/python*
done
}