0
0
Fork 0
haikuports/dev-python/unrardll/unrardll-0.1.4.recipe

73 lines
1.8 KiB
Bash
Raw Permalink Normal View History

2020-01-30 00:16:31 +00:00
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="4"
2020-01-30 00:16:31 +00:00
SOURCE_URI="https://github.com/kovidgoyal/unrardll/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="88c23a76492cf0d4aef5861947064698984c930294776dc66e9c46c2004ff0a2"
ARCHITECTURES="all !x86_gcc2"
2021-01-28 09:01:16 +00:00
SECONDARY_ARCHITECTURES="x86"
2020-01-30 00:16:31 +00:00
PROVIDES="
2021-01-28 09:01:16 +00:00
unrardll$secondaryArchSuffix = $portVersion
2020-01-30 00:16:31 +00:00
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
2021-01-28 09:01:16 +00:00
haiku${secondaryArchSuffix}_devel
devel:libunrar$secondaryArchSuffix
2020-01-30 00:16:31 +00:00
"
2021-01-28 09:01:16 +00:00
PYTHON_PACKAGES=(python38 python39)
PYTHON_VERSIONS=(3.8 3.9)
2020-01-30 00:16:31 +00:00
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
2021-01-28 09:01:16 +00:00
lib:libunrar$secondaryArchSuffix\n\
2020-01-30 00:16:31 +00:00
cmd:python$pythonVersion\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
2021-01-28 09:01:16 +00:00
setuptools_$pythonPackage"
2020-01-30 00:16:31 +00:00
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion\n\
cmd:gcc$secondaryArchSuffix"
done
2021-01-28 09:01:16 +00:00
if [ "$targetArchitecture" = "x86_gcc2" ]; then
PROVIDES_python38+="
unrardll_python38 = $portVersion
"
PROVIDES_python39+="
unrardll_python39 = $portVersion
"
fi
2020-01-30 00:16:31 +00:00
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
packageEntries $pythonPackage \
$prefix/lib/python*
done
}