aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2024-05-27 18:54:01 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2024-05-27 18:54:42 +0000
commit698eadbe278c0e8c50da6082994e16bb4910a398 (patch)
tree05c36844e25146018716c4f0f03d420f7559a087
parentadb5bf72cfa854ce96bf6172a548c210d7fda9b2 (diff)
devel/shedskin: New port: Restricted Python-to-C++ compiler
-rw-r--r--devel/Makefile1
-rw-r--r--devel/shedskin/Makefile35
-rw-r--r--devel/shedskin/distinfo3
-rw-r--r--devel/shedskin/files/patch-shedskin_lib_os_____init____.cpp19
-rw-r--r--devel/shedskin/pkg-descr4
5 files changed, 62 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index e88694af9821..5750ddd2ea2f 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -7839,6 +7839,7 @@
SUBDIR += shadered
SUBDIR += shapelib
SUBDIR += shards
+ SUBDIR += shedskin
SUBDIR += shell-toolbox
SUBDIR += shflags
SUBDIR += shfmt
diff --git a/devel/shedskin/Makefile b/devel/shedskin/Makefile
new file mode 100644
index 000000000000..fe59996f5694
--- /dev/null
+++ b/devel/shedskin/Makefile
@@ -0,0 +1,35 @@
+PORTNAME= shed-skin
+DISTVERSION= 0.9.8
+CATEGORIES= devel python
+MASTER_SITES= PYPI
+DISTNAME= ${PORTNAME:S/-/_/g}-${PORTVERSION}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Restricted Python-to-C++ compiler
+WWW= https://shedskin.github.io/
+
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}poetry-core>0:devel/py-poetry-core@${PY_FLAVOR}
+RUN_DEPENDS= boehm-gc>0:devel/boehm-gc \
+ pcre>0:devel/pcre
+
+USES= python
+USE_PYTHON= pep517 autoplist
+
+NO_ARCH= yes
+
+post-extract:
+ @${RM} ${WRKSRC}/tests/test_ops_assignment/test_ops_assignment.py.orig
+
+post-patch:
+ # the fouth regex below is a workaround for https://github.com/shedskin/shedskin/issues/470
+ @${REINPLACE_CMD} -e ' \
+ s|^CC=.*|CC=${CXX}|; \
+ s|^CCFLAGS=|CCFLAGS?=-I${PREFIX}/include |; \
+ s|^LFLAGS=|LFLAGS=-L${PREFIX}/lib |; \
+ s|^CCFLAGS.*|& -I$$(SHEDSKIN_LIBDIR)|; \
+ ' ${WRKSRC}/shedskin/resources/flags/FLAGS
+
+.include <bsd.port.mk>
diff --git a/devel/shedskin/distinfo b/devel/shedskin/distinfo
new file mode 100644
index 000000000000..b375f34fc64d
--- /dev/null
+++ b/devel/shedskin/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1716797518
+SHA256 (shed_skin-0.9.8.tar.gz) = 2367ab06a29122d79cd2091b306711743a0b08836ee6291775ad049914670779
+SIZE (shed_skin-0.9.8.tar.gz) = 18176411
diff --git a/devel/shedskin/files/patch-shedskin_lib_os_____init____.cpp b/devel/shedskin/files/patch-shedskin_lib_os_____init____.cpp
new file mode 100644
index 000000000000..79bade3dc93c
--- /dev/null
+++ b/devel/shedskin/files/patch-shedskin_lib_os_____init____.cpp
@@ -0,0 +1,19 @@
+--- shedskin/lib/os/__init__.cpp.orig 2023-12-24 21:56:45 UTC
++++ shedskin/lib/os/__init__.cpp
+@@ -27,7 +27,7 @@
+ #include <sys/utsname.h>
+ #include <sys/statvfs.h>
+
+-#ifndef __APPLE__
++#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ #include <sys/sysmacros.h>
+ #endif
+
+@@ -42,6 +42,7 @@
+ #ifdef __FreeBSD__
+ #include <roken.h>
+ #include <libutil.h>
++extern char **environ;
+ #endif
+
+ #ifdef __APPLE__
diff --git a/devel/shedskin/pkg-descr b/devel/shedskin/pkg-descr
new file mode 100644
index 000000000000..40b82a6bf358
--- /dev/null
+++ b/devel/shedskin/pkg-descr
@@ -0,0 +1,4 @@
+Shed Skin is a transpiler, that can translate pure, but implicitly statically
+typed Python 3 programs into optimized C++. It can generate stand-alone
+programs or extension modules that can be imported and used in larger Python
+programs.