mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-17 17:20:07 +02:00
dev-python/pycparser: new recipe.
This commit is contained in:
105
dev-python/pycparser/pycparser-2.19.recipe
Normal file
105
dev-python/pycparser/pycparser-2.19.recipe
Normal file
@@ -0,0 +1,105 @@
|
||||
SUMMARY="A C parser and AST generator written in Python"
|
||||
DESCRIPTION="pycparser is a parser for the C language, written in pure Python. \
|
||||
It is designed to be easily integrated into applications that need to parse C \
|
||||
source code."
|
||||
HOMEPAGE="https://github.com/eliben/pycparser"
|
||||
COPYRIGHT="2008-2018 Eli Bendersky"
|
||||
LICENSE="BSD (3-clause)"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/eliben/pycparser/archive/release_v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="893ec3d0f26c0faa7d0b992979940353a1682f86b5cd1228740637055b112379"
|
||||
SOURCE_FILENAME="pycparser-$portVersion.tar.gz"
|
||||
SOURCE_DIR="pycparser-release_v$portVersion"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
pycparser = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
setuptools_python
|
||||
setuptools_python3
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:python
|
||||
cmd:python3
|
||||
"
|
||||
|
||||
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
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
ply_$pythonPackage
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
done
|
||||
|
||||
BUILD()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
rm -rf "$sourceDir"-$pythonPackage
|
||||
cp -a "$sourceDir" "$sourceDir"-$pythonPackage
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
|
||||
python=python$pythonVersion
|
||||
$python setup.py build
|
||||
cd pycparser
|
||||
$python _build_tables.py
|
||||
cd ..
|
||||
done
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation
|
||||
mkdir -p "$installLocation"
|
||||
$python setup.py install --root=/ --prefix="$prefix" --optimize=1
|
||||
|
||||
install -m 755 -d "$dataDir"/licenses
|
||||
install -m 644 -T LICENSE "$dataDir"/licenses/pycparser
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
"$dataDir" \
|
||||
"$prefix"/lib/$python
|
||||
done
|
||||
|
||||
install -m 755 -d "$dataDir"/licenses "$docDir"
|
||||
install -m 644 -T LICENSE "$dataDir"/licenses/pycparser
|
||||
install -m 644 -t "$docDir" README.rst
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
|
||||
python=python$pythonVersion
|
||||
$python tests/all_tests.py
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user