mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
92 lines
2.2 KiB
Bash
92 lines
2.2 KiB
Bash
SUMMARY="Pure python QR Code generator"
|
|
DESCRIPTION="This module uses the Python Imaging Library (PIL) to allow for \
|
|
the generation of QR Codes."
|
|
HOMEPAGE="https://github.com/lincolnloop/python-qrcode/"
|
|
COPYRIGHT="2011 Lincoln Loop"
|
|
LICENSE="BSD (3-clause)"
|
|
REVISION="1"
|
|
SOURCE_URI="https://github.com/lincolnloop/python-qrcode/archive/refs/tags/v$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="0c33d46a4d5baa4ed6d26f1a2215b9166078235f54f1c16af87b9533072d1787"
|
|
SOURCE_FILENAME="qrcode-v$portVersion.tar.gz"
|
|
SOURCE_DIR="python-qrcode-$portVersion"
|
|
|
|
ARCHITECTURES="any"
|
|
|
|
PROVIDES="
|
|
$portName = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku_devel
|
|
"
|
|
|
|
PYTHON_PACKAGES=(python39 python310)
|
|
PYTHON_VERSIONS=(3.9 3.10)
|
|
defaultVersion=3.10
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
|
|
eval "PROVIDES_$pythonPackage=\"
|
|
${portName}_$pythonPackage = $portVersion
|
|
cmd:qr_$pythonVersion = $portVersion
|
|
\""
|
|
# Provide non-suffixed cmd only for the default Python version
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
eval "PROVIDES_$pythonPackage+=\"
|
|
cmd:qr = $portVersion
|
|
\""
|
|
fi
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
eval "PROVIDES_$pythonPackage+=\"
|
|
qrcode_$pythonPackage = $portVersion
|
|
\""
|
|
fi
|
|
eval "REQUIRES_$pythonPackage=\"
|
|
haiku
|
|
pillow_$pythonPackage
|
|
cmd:python$pythonVersion
|
|
\""
|
|
BUILD_REQUIRES+="
|
|
setuptools_$pythonPackage
|
|
"
|
|
BUILD_PREREQUIRES+="
|
|
cmd:python$pythonVersion
|
|
"
|
|
done
|
|
|
|
|
|
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
|
|
|
|
mv $binDir/qr $binDir/qr-$pythonVersion
|
|
# Provide suffix-less symlinks for the default version:
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
ln -sr $binDir/qr-$pythonVersion $binDir/qr
|
|
fi
|
|
|
|
mkdir -p $(dirname $manDir)
|
|
mv $prefix/share/man $manDir
|
|
rmdir $prefix/share
|
|
|
|
packageEntries $pythonPackage \
|
|
$prefix/bin \
|
|
$prefix/lib/python* \
|
|
$manDir
|
|
done
|
|
}
|