diff options
author | danfe <danfe@FreeBSD.org> | 2014-11-28 18:35:30 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2014-11-28 18:35:30 +0800 |
commit | 7adfbb8c8b87adc3a504a811314a3af7aebbfefa (patch) | |
tree | 47f93f3563416dcff4c619c32d16719d33aee77b /devel | |
parent | baa85e7e5eaeef4030ee65cc3b51d3803761c7b3 (diff) | |
download | freebsd-ports-gnome-7adfbb8c8b87adc3a504a811314a3af7aebbfefa.tar.gz freebsd-ports-gnome-7adfbb8c8b87adc3a504a811314a3af7aebbfefa.tar.zst freebsd-ports-gnome-7adfbb8c8b87adc3a504a811314a3af7aebbfefa.zip |
Add two new ports: bbfreeze and bbfreeze-loader (helper script).
bbfreeze creates standalone executables from Python scripts. It's similar
in purpose to the well known py2exe for Windows, py2app for OS X, PyInstaller
and cx_Freeze (in fact ancient versions were based on cx_Freeze.
And it uses the modulegraph package, which is also used by py2app).
It has the following features:
- ZIP/Egg file import tracking
- Binary dependency tracking (e.g. shared libraries)
- Multiple script freezing support
- Python interpreter included (named 'py')
- Automatic pathname rewriting (pathnames in tracebacks are relative)
- New distutils command: bdist_bbfreeze
WWW: https://pypi.python.org/pypi/bbfreeze/
Diffstat (limited to 'devel')
-rw-r--r-- | devel/Makefile | 2 | ||||
-rw-r--r-- | devel/bbfreeze-loader/Makefile | 18 | ||||
-rw-r--r-- | devel/bbfreeze-loader/distinfo | 2 | ||||
-rw-r--r-- | devel/bbfreeze-loader/pkg-descr | 4 | ||||
-rw-r--r-- | devel/bbfreeze/Makefile | 33 | ||||
-rw-r--r-- | devel/bbfreeze/distinfo | 2 | ||||
-rw-r--r-- | devel/bbfreeze/files/patch-bbfreeze_freezer.py | 37 | ||||
-rw-r--r-- | devel/bbfreeze/pkg-descr | 15 |
8 files changed, 113 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index 6427ee468e1d..09e975004248 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -117,6 +117,8 @@ SUBDIR += avro-cpp SUBDIR += awscli SUBDIR += bam + SUBDIR += bbfreeze + SUBDIR += bbfreeze-loader SUBDIR += bcc SUBDIR += bcpp SUBDIR += beautifyphp diff --git a/devel/bbfreeze-loader/Makefile b/devel/bbfreeze-loader/Makefile new file mode 100644 index 000000000000..a8b7b8a952cb --- /dev/null +++ b/devel/bbfreeze-loader/Makefile @@ -0,0 +1,18 @@ +# Created by: Alexey Dokuchaev <danfe@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= bbfreeze-loader +PORTVERSION= 1.1.0 +CATEGORIES= devel python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= python@FreeBSD.org +COMMENT= Binary loader module required for bbfreeze + +LICENSE= ZLIB + +USES= python:2 zip +USE_PYTHON= autoplist distutils + +.include <bsd.port.mk> diff --git a/devel/bbfreeze-loader/distinfo b/devel/bbfreeze-loader/distinfo new file mode 100644 index 000000000000..42e7e7fdceae --- /dev/null +++ b/devel/bbfreeze-loader/distinfo @@ -0,0 +1,2 @@ +SHA256 (bbfreeze-loader-1.1.0.zip) = 0dbe47ba2335a9c222b01a3c81746406a17d42a2e219785582f164c62441adb7 +SIZE (bbfreeze-loader-1.1.0.zip) = 13728 diff --git a/devel/bbfreeze-loader/pkg-descr b/devel/bbfreeze-loader/pkg-descr new file mode 100644 index 000000000000..3be126ee3183 --- /dev/null +++ b/devel/bbfreeze-loader/pkg-descr @@ -0,0 +1,4 @@ +bbfreeze-loader provides binary dependencies for bbfreeze, utility to create +standalone executables from Python scripts. + +WWW: https://pypi.python.org/pypi/bbfreeze-loader/ diff --git a/devel/bbfreeze/Makefile b/devel/bbfreeze/Makefile new file mode 100644 index 000000000000..29ec6f73bba0 --- /dev/null +++ b/devel/bbfreeze/Makefile @@ -0,0 +1,33 @@ +# Created by: Alexey Dokuchaev <danfe@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= bbfreeze +PORTVERSION= 1.1.3 +CATEGORIES= devel python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= python@FreeBSD.org +COMMENT= Module to create standalone executables from Python scripts + +LICENSE= ZLIB + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}altgraph>=0.9:${PORTSDIR}/math/py-altgraph \ + ${PYTHON_PKGNAMEPREFIX}bbfreeze-loader>=1.1.0:${PORTSDIR}/devel/bbfreeze-loader + +USES= python:2 zip +USE_PYTHON= autoplist distutils + +DOCSDIR= ${PREFIX}/share/doc/${PYTHON_PKGNAMEPREFIX}${PORTNAME} +PORTDOCS= * + +post-patch: + @${REINPLACE_CMD} -e '/altgraph/s,==,>=,' ${WRKSRC}/${PYSETUP} + @${REINPLACE_CMD} -e '/from altgraph.compat import/d' \ + ${WRKSRC}/bbfreeze/modulegraph/modulegraph.py + +post-install: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README.rst ${STAGEDIR}${DOCSDIR} + +.include <bsd.port.mk> diff --git a/devel/bbfreeze/distinfo b/devel/bbfreeze/distinfo new file mode 100644 index 000000000000..b32e7289170b --- /dev/null +++ b/devel/bbfreeze/distinfo @@ -0,0 +1,2 @@ +SHA256 (bbfreeze-1.1.3.zip) = 5936f30d41cddba4814b5e3c9d068ae179215cbc47e255173ae5efcfa73cd1bf +SIZE (bbfreeze-1.1.3.zip) = 65010 diff --git a/devel/bbfreeze/files/patch-bbfreeze_freezer.py b/devel/bbfreeze/files/patch-bbfreeze_freezer.py new file mode 100644 index 000000000000..b59e7d5a09eb --- /dev/null +++ b/devel/bbfreeze/files/patch-bbfreeze_freezer.py @@ -0,0 +1,37 @@ +--- bbfreeze/freezer.py.orig 2013-11-08 07:20:06 UTC ++++ bbfreeze/freezer.py +@@ -1,4 +1,4 @@ +-import os ++import os, stat + import sys + import re + import time +@@ -791,16 +791,24 @@ if __name__ == '__main__': + os.environ['S'] = p + os.system('strip $S') + ++ def copy_noschg(self, src, dst): ++ """ copy access/modification times and user flags only to ++ allow operation under regular user e.g. on FreeBSD, ++ where /lib/libc.so.* by default has stat.SF_IMMUTABLE ++ flag set (which is super-user only)""" ++ shutil.copyfile(src, dst) ++ sb = os.stat(src) ++ os.utime(dst, (sb.st_atime, sb.st_mtime)) ++ os.chflags(dst, sb.st_flags & 0x0000ffff) # UF_SETTABLE ++ + def _handle_Executable(self, m): + dst = os.path.join(self.distdir, os.path.basename(m.filename)) +- shutil.copy2(m.filename, dst) +- os.chmod(dst, 0755) ++ self.copy_noschg(m.filename, dst) + self.adaptBinary(dst) + + def _handle_SharedLibrary(self, m): + dst = os.path.join(self.distdir, os.path.basename(m.filename)) +- shutil.copy2(m.filename, dst) +- os.chmod(dst, 0755) ++ self.copy_noschg(m.filename, dst) + self.adaptBinary(dst) + + def showxref(self): diff --git a/devel/bbfreeze/pkg-descr b/devel/bbfreeze/pkg-descr new file mode 100644 index 000000000000..df428b32fc54 --- /dev/null +++ b/devel/bbfreeze/pkg-descr @@ -0,0 +1,15 @@ +bbfreeze creates standalone executables from Python scripts. It's similar +in purpose to the well known py2exe for Windows, py2app for OS X, PyInstaller +and cx_Freeze (in fact ancient versions were based on cx_Freeze. +And it uses the modulegraph package, which is also used by py2app). + +It has the following features: + + - ZIP/Egg file import tracking + - Binary dependency tracking (e.g. shared libraries) + - Multiple script freezing support + - Python interpreter included (named 'py') + - Automatic pathname rewriting (pathnames in tracebacks are relative) + - New distutils command: bdist_bbfreeze + +WWW: https://pypi.python.org/pypi/bbfreeze/ |