Commit 5984003b authored by danfe's avatar danfe
Browse files

Add port of PyInstaller, a program that converts (packages) Python programs

into standalone executables under Windows, Mac OS X, and Unix-like operating
systems.

Also, properly sort `devel/Makefile' while here.
parent 3265c9c8
......@@ -632,12 +632,12 @@
SUBDIR += gtgt
SUBDIR += gtkparasite
SUBDIR += gtranslator
SUBDIR += gumbo
SUBDIR += guichan
SUBDIR += guikachu
SUBDIR += guile-lib
SUBDIR += guiloader
SUBDIR += guiloader-c++
SUBDIR += gumbo
SUBDIR += gvfs
SUBDIR += gwenhywfar
SUBDIR += gwenhywfar-fox16
......@@ -2601,7 +2601,6 @@
SUBDIR += p5-PAR-Dist
SUBDIR += p5-PAR-Packer
SUBDIR += p5-PCSC-Card
SUBDIR += p5-PerlX-Maybe
SUBDIR += p5-PHP-Serialization
SUBDIR += p5-POE
SUBDIR += p5-POE-API-Hooks
......@@ -2715,6 +2714,7 @@
SUBDIR += p5-PerlIO-via-MD5
SUBDIR += p5-PerlIO-via-dynamic
SUBDIR += p5-PerlIO-via-symlink
SUBDIR += p5-PerlX-Maybe
SUBDIR += p5-Pid-File-Flock
SUBDIR += p5-Pipeline
SUBDIR += p5-Pithub
......@@ -4225,6 +4225,7 @@
SUBDIR += pycount
SUBDIR += pydbus-common
SUBDIR += pygobject3-common
SUBDIR += pyinstaller
SUBDIR += pylint
SUBDIR += pymacs
SUBDIR += pyobfuscate
......
# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
# $FreeBSD$
PORTNAME= PyInstaller
PORTVERSION= 2.1
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= python@FreeBSD.org
COMMENT= Program to create standalone executables from Python scripts
LICENSE= GPLv2
USES= python
USE_PYTHON= autoplist distutils
DOCSDIR= ${PREFIX}/share/doc/${PYTHON_PKGNAMEPREFIX}${PORTNAME}
PORTDOCS= *
post-patch:
@${REINPLACE_CMD} -e '/install_requires/s,distribute,setuptools,' \
${WRKSRC}/${PYSETUP}
@${REINPLACE_CMD} -e '/\/sbin\/ldconfig/s,-p,-r,' \
${WRKSRC}/PyInstaller/bindepend.py \
${WRKSRC}/PyInstaller/depend/utils.py
@${REINPLACE_CMD} -e '/libpython/s,\.so\.1\.0,.so.1,' \
${WRKSRC}/PyInstaller/bindepend.py
pre-build:
cd ${WRKSRC}/bootloader && ${PYTHON_CMD} waf configure build install
post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>
SHA256 (PyInstaller-2.1.tar.gz) = feff03a3212d984882432ff81c6afcdcf04d8f636fd4beb131b7a027653b3b05
SIZE (PyInstaller-2.1.tar.gz) = 4811236
--- PyInstaller/build.py.orig 2013-09-15 20:27:11 UTC
+++ PyInstaller/build.py
@@ -1411,8 +1411,17 @@ class COLLECT(Target):
upx=(self.upx_binaries and (is_win or is_cygwin)),
dist_nm=inm)
if typ != 'DEPENDENCY':
- shutil.copy2(fnm, tofnm)
- if typ in ('EXTENSION', 'BINARY'):
+ def copy_noschg(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
+ copy_noschg(fnm, tofnm)
+ if typ in ('EXTENSION', 'BINARY', 'EXECUTABLE'):
os.chmod(tofnm, 0755)
_save_data(self.out,
(self.name, self.strip_binaries, self.upx_binaries, self.toc))
--- PyInstaller/compat.py.orig 2013-09-15 20:27:11 UTC
+++ PyInstaller/compat.py
@@ -31,6 +31,7 @@ is_darwin = sys.platform == 'darwin' #
# Unix platforms
is_linux = sys.platform.startswith('linux')
+is_freebsd = sys.platform.startswith('freebsd')
is_solar = sys.platform.startswith('sun') # Solaris
is_aix = sys.platform.startswith('aix')
@@ -38,7 +39,7 @@ is_aix = sys.platform.startswith('aix')
# (e.g. Linux, Solaris, AIX)
# Mac OS X is not considered as unix since there are many
# platform specific details for Mac in PyInstaller.
-is_unix = is_linux or is_solar or is_aix
+is_unix = is_linux or is_freebsd or is_solar or is_aix
# Correct extension ending: 'c' or 'o'
--- bootloader/wscript.orig 2013-09-15 20:27:11 UTC
+++ bootloader/wscript
@@ -229,7 +229,6 @@ def configure(conf):
conf.check_cc(lib='ws2_32', mandatory=True)
else:
- conf.check_cc(lib='dl', mandatory=True)
conf.check_cc(lib='z', mandatory=True)
if conf.check_cc(function_name='readlink', header_name='unistd.h'):
conf.env.append_value('CCFLAGS', '-DHAVE_READLINK')
@@ -468,7 +467,7 @@ def build(bld):
else: # linux, darwin (MacOSX)
- libs = ['dl', 'z', 'm'] # 'z' - zlib, 'm' - math,
+ libs = ['z', 'm'] # 'z' - zlib, 'm' - math,
if opt.boehmgc:
libs.append('gc')
PyInstaller is a program that converts (packages) Python programs into stand-
alone executables, under Windows, Mac OS X, and Unix-like operating systems.
Its main advantages over similar tools are that PyInstaller works with any
version of Python since 2.4, it builds smaller executables thanks to
transparent compression, it is fully multi-platform, and uses the OS support
to load the dynamic libraries, thus ensuring full compatibility.
The main goal of PyInstaller is to be compatible with third-party packages
out-of-the-box. This means that, with PyInstaller, all the required tricks
to make external packages work are already integrated within PyInstaller
itself so that there is no user intervention required.
WWW: https://pypi.python.org/pypi/PyInstaller/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment