mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 21:30:08 +02:00
104 lines
2.3 KiB
Bash
104 lines
2.3 KiB
Bash
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="4"
|
|
SOURCE_URI="https://github.com/eliben/pycparser/archive/release_v$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="3c797eb2eb1ba57772bb99ffa7caed23c3a2c2ae58daef114c9b09d3a6da97e2"
|
|
SOURCE_FILENAME="pycparser-$portVersion.tar.gz"
|
|
SOURCE_DIR="pycparser-release_v$portVersion"
|
|
|
|
ARCHITECTURES="any"
|
|
|
|
PROVIDES="
|
|
pycparser = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku_devel
|
|
"
|
|
|
|
PYTHON_VERSIONS=(3.10)
|
|
|
|
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
eval "PROVIDES_$pythonPackage=\"
|
|
${portName}_$pythonPackage = $portVersion
|
|
\""
|
|
|
|
eval "REQUIRES_$pythonPackage=\"
|
|
haiku
|
|
cmd:python$pythonVersion
|
|
\""
|
|
|
|
BUILD_REQUIRES+="
|
|
setuptools_$pythonPackage
|
|
"
|
|
BUILD_PREREQUIRES+="
|
|
cmd:python$pythonVersion
|
|
"
|
|
done
|
|
|
|
BUILD()
|
|
{
|
|
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
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 pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
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 pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
cd "$sourceDir"-$pythonPackage
|
|
|
|
python=python$pythonVersion
|
|
$python tests/all_tests.py
|
|
done
|
|
}
|