Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 2014 10:35:31 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r373541 - in head/devel: . bbfreeze bbfreeze-loader bbfreeze/files
Message-ID:  <201411281035.sASAZVHx032500@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Fri Nov 28 10:35:30 2014
New Revision: 373541
URL: https://svnweb.freebsd.org/changeset/ports/373541
QAT: https://qat.redports.org/buildarchive/r373541/

Log:
  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/

Added:
  head/devel/bbfreeze/
  head/devel/bbfreeze-loader/
  head/devel/bbfreeze-loader/Makefile   (contents, props changed)
  head/devel/bbfreeze-loader/distinfo   (contents, props changed)
  head/devel/bbfreeze-loader/pkg-descr   (contents, props changed)
  head/devel/bbfreeze/Makefile   (contents, props changed)
  head/devel/bbfreeze/distinfo   (contents, props changed)
  head/devel/bbfreeze/files/
  head/devel/bbfreeze/files/patch-bbfreeze_freezer.py   (contents, props changed)
  head/devel/bbfreeze/pkg-descr   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Fri Nov 28 10:32:07 2014	(r373540)
+++ head/devel/Makefile	Fri Nov 28 10:35:30 2014	(r373541)
@@ -117,6 +117,8 @@
     SUBDIR += avro-cpp
     SUBDIR += awscli
     SUBDIR += bam
+    SUBDIR += bbfreeze
+    SUBDIR += bbfreeze-loader
     SUBDIR += bcc
     SUBDIR += bcpp
     SUBDIR += beautifyphp

Added: head/devel/bbfreeze-loader/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze-loader/Makefile	Fri Nov 28 10:35:30 2014	(r373541)
@@ -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>

Added: head/devel/bbfreeze-loader/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze-loader/distinfo	Fri Nov 28 10:35:30 2014	(r373541)
@@ -0,0 +1,2 @@
+SHA256 (bbfreeze-loader-1.1.0.zip) = 0dbe47ba2335a9c222b01a3c81746406a17d42a2e219785582f164c62441adb7
+SIZE (bbfreeze-loader-1.1.0.zip) = 13728

Added: head/devel/bbfreeze-loader/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze-loader/pkg-descr	Fri Nov 28 10:35:30 2014	(r373541)
@@ -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/

Added: head/devel/bbfreeze/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze/Makefile	Fri Nov 28 10:35:30 2014	(r373541)
@@ -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>

Added: head/devel/bbfreeze/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze/distinfo	Fri Nov 28 10:35:30 2014	(r373541)
@@ -0,0 +1,2 @@
+SHA256 (bbfreeze-1.1.3.zip) = 5936f30d41cddba4814b5e3c9d068ae179215cbc47e255173ae5efcfa73cd1bf
+SIZE (bbfreeze-1.1.3.zip) = 65010

Added: head/devel/bbfreeze/files/patch-bbfreeze_freezer.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze/files/patch-bbfreeze_freezer.py	Fri Nov 28 10:35:30 2014	(r373541)
@@ -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):

Added: head/devel/bbfreeze/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/bbfreeze/pkg-descr	Fri Nov 28 10:35:30 2014	(r373541)
@@ -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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411281035.sASAZVHx032500>