Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haikuports/haikuports
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d85e493406b3
Choose a base ref
...
head repository: haikuports/haikuports
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9d1368f1df06
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 21, 2021

  1. qrcode, new recipe (#6126)

    Begasus authored Aug 21, 2021
    Copy the full SHA
    9d1368f View commit details
Showing with 85 additions and 0 deletions.
  1. +85 −0 dev-python/qrcode/qrcode-7.2.recipe
85 changes: 85 additions & 0 deletions dev-python/qrcode/qrcode-7.2.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
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="051935ae06d8180a5a2413192dd236fdc6a2f3da3ef04af682afbe9d5c3286f4"
SOURCE_FILENAME="qrcode-v$portVersion.tar.gz"
SOURCE_DIR="python-qrcode-$portVersion"

ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
"

PYTHON_PACKAGES=(python3 python38 python39)
PYTHON_VERSIONS=(3.7 3.8 3.9)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
cmd:python$pythonVersion\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
lxml_$pythonPackage
pillow${secondaryArchSuffix}_$pythonPackage
setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done

PROVIDES_python3="$PROVIDES_python3
cmd:qr3.7
"
PROVIDES_python38="$PROVIDES_python38
cmd:qr3.8
"
PROVIDES_python39="$PROVIDES_python39
cmd:qr3.9
"

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 $prefix/bin/qr $prefix/bin/qr$pythonVersion

mkdir -p $(dirname $manDir)
mv $prefix/share/man $manDir
rmdir $prefix/share

packageEntries $pythonPackage \
$prefix/bin \
$prefix/lib/python* \
$manDir
done
}