diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2014-11-28 10:35:30 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2014-11-28 10:35:30 +0000 |
commit | f02f4db8d053d83df9aa123403c92d0281f5aa68 (patch) | |
tree | 47f93f3563416dcff4c619c32d16719d33aee77b /devel/bbfreeze/files/patch-bbfreeze_freezer.py | |
parent | Fix the order of existing entries (prior to addind couple of new ones). (diff) |
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/bbfreeze/files/patch-bbfreeze_freezer.py')
-rw-r--r-- | devel/bbfreeze/files/patch-bbfreeze_freezer.py | 37 |
1 files changed, 37 insertions, 0 deletions
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): |