Skip to content

Commit

Permalink
Python example
Browse files Browse the repository at this point in the history
  • Loading branch information
extrowerk committed Feb 18, 2019
1 parent cabde07 commit 8b3d7c7
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions generic/generic_python-1.2.3.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
SUMMARY="Short description of ProjectX"
DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 80 characters and use \
a backslash to wrap the line."
HOMEPAGE="https://homepage/of/projectx.org"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
LICENSE="MIT
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/HaikuArchives/ProjectX/archive/projectx-$portVersion.tar.gz"
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="$portVersionedName"
PATCHES="projectx-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="any"

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

BUILD_REQUIRES="
haiku_devel
"

PYTHON_PACKAGES=(python python3)
PYTHON_VERSIONS=(2.7 3.6)
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
setuptools_$pythonPackage"
BUILD_PREREQUIRES="$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

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

0 comments on commit 8b3d7c7

Please sign in to comment.