cram: move to Python 3.10. (#11714)

Also:

- switch from setup.py to build/installer.
- ran --test and added results for reference.
This commit is contained in:
OscarL
2025-02-04 05:12:24 -03:00
committed by GitHub
parent 19e9b85961
commit 83fb1ce484
2 changed files with 48 additions and 8 deletions

View File

@@ -6,14 +6,15 @@ the command's actual output."
HOMEPAGE="https://bitheap.org/cram/"
COPYRIGHT="2010-2016 Rafael G. Martins"
LICENSE="GNU GPL v2"
REVISION="3"
REVISION="4"
SOURCE_URI="https://bitheap.org/cram/cram-$portVersion.tar.gz"
CHECKSUM_SHA256="7da7445af2ce15b90aad5ec4792f857cef5786d71f14377e9eb994d8b8337f2f"
PATCHES="cram-$portVersion.patchset"
ARCHITECTURES="any"
# It only makes sense to package this one just for the default Python version.
pythonVersion=3.9
pythonVersion=3.10
pythonPackage=python${pythonVersion//.}
PROVIDES="
@@ -26,27 +27,33 @@ REQUIRES="
"
BUILD_REQUIRES="
haiku_devel
build_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES="
cmd:python$pythonVersion
"
TEST_REQUIRES="
cmd:cram
cmd:md5sum
cmd:patch
cmd:which
"
INSTALL()
{
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
$python setup.py build install --root=/ --prefix=$prefix
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer --p $prefix dist/*-$portVersion-*.whl
}
# Results for reference:
# Ran 11 tests, 3 skipped, 1 failed.
# The one that fails mentions "+ 'finddir B_USER_CONFIG_DIRECTORY' failed",
# but I have no clue from where that message comes from.
TEST()
{
cram tests/*.t

View File

@@ -0,0 +1,33 @@
From 9403554020974f5a26ad6682b7bd27a4b6fe99e2 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Tue, 4 Feb 2025 04:39:40 -0300
Subject: Fix calling Python on Haiku.
Haiku's "default Python" package do not currently provide /bin/python.
diff --git a/tests/run-doctests.py b/tests/run-doctests.py
index 7cc39e2..4921614 100644
--- a/tests/run-doctests.py
+++ b/tests/run-doctests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import doctest
import os
diff --git a/tests/setup.sh b/tests/setup.sh
index 4ecf32f..33a7539 100644
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -6,7 +6,7 @@
# The $PYTHON environment variable should be set when running this test
# from Python.
-[ -n "$PYTHON" ] || PYTHON="`which python`"
+[ -n "$PYTHON" ] || PYTHON="`which python3`"
[ -n "$PYTHONPATH" ] || PYTHONPATH="$TESTDIR/.." && export PYTHONPATH
if [ -n "$COVERAGE" ]; then
if [ -z "$COVERAGE_FILE" ]; then
--
2.45.2