summaryrefslogtreecommitdiff
path: root/devel/py-e3-core
diff options
context:
space:
mode:
Diffstat (limited to 'devel/py-e3-core')
-rw-r--r--devel/py-e3-core/Makefile74
-rw-r--r--devel/py-e3-core/distinfo3
-rw-r--r--devel/py-e3-core/files/patch-src_e3_fs.py11
-rw-r--r--devel/py-e3-core/files/patch-tests_tests__e3_env_main__test.py12
-rw-r--r--devel/py-e3-core/files/patch-tests_tests__e3_main_main__test.py56
-rw-r--r--devel/py-e3-core/files/patch-tests_tests__e3_os_process_main__test.py11
-rw-r--r--devel/py-e3-core/pkg-descr3
7 files changed, 170 insertions, 0 deletions
diff --git a/devel/py-e3-core/Makefile b/devel/py-e3-core/Makefile
new file mode 100644
index 000000000000..f2989716fc88
--- /dev/null
+++ b/devel/py-e3-core/Makefile
@@ -0,0 +1,74 @@
+PORTNAME= e3-core
+DISTVERSION= 22.10.0
+CATEGORIES= devel python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= agh@riseup.net
+COMMENT= Core framework for developing portable automated build systems
+WWW= https://github.com/AdaCore/e3-core
+
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKSRC}/COPYING3
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=61.0.0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}colorama>0:devel/py-colorama@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}distro>0:sysutils/py-distro@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}python-dateutil>0:devel/py-python-dateutil@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pyyaml>0:devel/py-pyyaml@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests-cache>0:www/py-requests-cache@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests-toolbelt>0:www/py-requests-toolbelt@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}resolvelib>0:devel/py-resolvelib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}stevedore>1.20.0:devel/py-stevedore@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}tqdm>0:misc/py-tqdm@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \
+ bash>0:shells/bash
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ansi2html>0:textproc/py-ansi2html@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}ptyprocess>0:sysutils/py-ptyprocess@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytest-html>0:devel/py-pytest-html@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytest-socket>0:devel/py-pytest-socket@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests-mock>0:www/py-requests-mock@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
+ git>0:devel/git \
+ rsync>0:net/rsync
+
+USES= pytest python:3.9+
+USE_GITHUB= yes
+GH_ACCOUNT= AdaCore
+USE_PYTHON= autoplist concurrent pep517
+
+PLIST_FILES+= ${PYTHON_SITELIBDIR}/e3/os/data/rlimit-${_RLIMIT_PLATFORM}
+
+_RLIMIT_PLATFORM= ${ARCH:S/amd64/x86_64/}-${OPSYS:tl}
+
+post-patch:
+# Modify ${WRKSRC}/VERSION to reflect the complete upsteam version, to avoid
+# dealing with Python Wheel shenanigans
+ ${REINPLACE_CMD} -e 's|${PORTVERSION:R}|${PORTVERSION}|' \
+ ${WRKSRC}/VERSION
+ ${REINPLACE_CMD} -e 's|%%PYTHON_VER%%|${PYTHON_VER}|' \
+ ${WRKSRC}/tests/tests_e3/os/process/main_test.py \
+ ${WRKSRC}/tests/tests_e3/main/main_test.py
+
+pre-build:
+# Build required rlimit binary, see GitHub issue 388 for context,
+# https://github.com/AdaCore/e3-core/issues/388
+ (cd ${WRKSRC}/tools/rlimit && \
+ ${CC} -o rlimit-${_RLIMIT_PLATFORM} rlimit.c)
+
+post-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/tools/rlimit/rlimit-${_RLIMIT_PLATFORM} \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/e3/os/data/
+
+do-test:
+# Tests require e3 to function
+ (cd ${WRKSRC} && \
+ ${SETENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} \
+ ${PYTHON_CMD} -m pytest)
+
+.include <bsd.port.mk>
diff --git a/devel/py-e3-core/distinfo b/devel/py-e3-core/distinfo
new file mode 100644
index 000000000000..37c5c737f8ff
--- /dev/null
+++ b/devel/py-e3-core/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1746773105
+SHA256 (AdaCore-e3-core-22.10.0_GH0.tar.gz) = 496b630569579c0b544e5455681076baeb6195d9ed03b4a7c7add9618d9e7127
+SIZE (AdaCore-e3-core-22.10.0_GH0.tar.gz) = 805122
diff --git a/devel/py-e3-core/files/patch-src_e3_fs.py b/devel/py-e3-core/files/patch-src_e3_fs.py
new file mode 100644
index 000000000000..f5080935ec1d
--- /dev/null
+++ b/devel/py-e3-core/files/patch-src_e3_fs.py
@@ -0,0 +1,11 @@
+--- src/e3/fs.py.orig 2025-03-28 13:21:34 UTC
++++ src/e3/fs.py
+@@ -58,7 +58,7 @@ def cp(
+ if copy_attrs:
+ switches += " -p"
+ if recursive:
+- switches += " -r"
++ switches += " -R"
+ logger.debug("cp %s %s->%s", switches, source, target)
+
+ if recursive and not copy_attrs:
diff --git a/devel/py-e3-core/files/patch-tests_tests__e3_env_main__test.py b/devel/py-e3-core/files/patch-tests_tests__e3_env_main__test.py
new file mode 100644
index 000000000000..9b0ec2bfc2b6
--- /dev/null
+++ b/devel/py-e3-core/files/patch-tests_tests__e3_env_main__test.py
@@ -0,0 +1,12 @@
+--- tests/tests_e3/env/main_test.py.orig 2025-05-09 08:40:30 UTC
++++ tests/tests_e3/env/main_test.py
+@@ -15,6 +15,9 @@ def test_autodetect():
+ .replace("win32", "windows")
+ .replace("aix7", "aix")
+ .replace("sunos5", "solaris")
++ .replace("freebsd13", "freebsd")
++ .replace("freebsd14", "freebsd")
++ .replace("freebsd15", "freebsd")
+ )
+ assert sys_platform in str(e3.platform.Platform.get())
+
diff --git a/devel/py-e3-core/files/patch-tests_tests__e3_main_main__test.py b/devel/py-e3-core/files/patch-tests_tests__e3_main_main__test.py
new file mode 100644
index 000000000000..e076278d8092
--- /dev/null
+++ b/devel/py-e3-core/files/patch-tests_tests__e3_main_main__test.py
@@ -0,0 +1,56 @@
+--- tests/tests_e3/main/main_test.py.orig 2025-05-09 10:12:19 UTC
++++ tests/tests_e3/main/main_test.py
+@@ -19,7 +19,7 @@ def test_mainprog():
+ f.write(
+ "\n".join(
+ (
+- "#!/usr/bin/env python",
++ "#!/usr/bin/env python%%PYTHON_VER%%",
+ "from e3.main import Main",
+ "import os",
+ 'm = Main(name="testmain")',
+@@ -44,7 +44,7 @@ def to_rework_modules_logging_limitations():
+ f.write(
+ "\n".join(
+ (
+- "#!/usr/bin/env python",
++ "#!/usr/bin/env python%%PYTHON_VER%%",
+ "from e3.main import Main",
+ "import requests",
+ "import logging",
+@@ -79,7 +79,7 @@ def test_mainprog_with_console_logs():
+ f.write(
+ "\n".join(
+ (
+- "#!/usr/bin/env python",
++ "#!/usr/bin/env python%%PYTHON_VER%%",
+ "from e3.main import Main",
+ "import os",
+ 'm = Main(name="testmain")',
+@@ -111,7 +111,7 @@ def test_x86_64_windows_default():
+ f.write(
+ "\n".join(
+ (
+- "#!/usr/bin/env python",
++ "#!/usr/bin/env python%%PYTHON_VER%%",
+ "from e3.main import Main",
+ "m = Main(platform_args=True, default_x86_64_on_windows=True)",
+ "m.parse_args()",
+@@ -128,7 +128,7 @@ def test_default_env_callback():
+ f.write(
+ "\n".join(
+ (
+- "#!/usr/bin/env python",
++ "#!/usr/bin/env python%%PYTHON_VER%%",
+ "from e3.main import Main",
+ "from e3.env import Env",
+ "def cb(args):",
+@@ -157,7 +157,7 @@ def test_sigterm():
+ f.write(
+ "\n".join(
+ (
+- "#!/usr/bin/env python",
++ "#!/usr/bin/env python%%PYTHON_VER%%",
+ "from e3.main import Main",
+ "import os",
+ "import signal",
diff --git a/devel/py-e3-core/files/patch-tests_tests__e3_os_process_main__test.py b/devel/py-e3-core/files/patch-tests_tests__e3_os_process_main__test.py
new file mode 100644
index 000000000000..a0399d54e93b
--- /dev/null
+++ b/devel/py-e3-core/files/patch-tests_tests__e3_os_process_main__test.py
@@ -0,0 +1,11 @@
+--- tests/tests_e3/os/process/main_test.py.orig 2025-03-28 13:21:34 UTC
++++ tests/tests_e3/os/process/main_test.py
+@@ -51,7 +51,7 @@ def test_run_shebang(caplog):
+ """Verify that the parse shebang option works."""
+ prog_filename = os.path.join(os.getcwd(), "prog")
+ with open(prog_filename, "wb") as f:
+- f.write(b"#!/usr/bin/env python\n")
++ f.write(b"#!/usr/bin/env python%%PYTHON_VER%%\n")
+ f.write(b"import sys\n")
+ f.write(b'print("running %s" % sys.argv[1])\n')
+ e3.os.fs.chmod("a+x", prog_filename)
diff --git a/devel/py-e3-core/pkg-descr b/devel/py-e3-core/pkg-descr
new file mode 100644
index 000000000000..d877b6bbd40f
--- /dev/null
+++ b/devel/py-e3-core/pkg-descr
@@ -0,0 +1,3 @@
+The e3 Project is a Python framework to ease the development of portable
+automated build systems (compilation, dependencies management, binary code
+packaging, and automated testing).