svn commit: r487621 - in head/multimedia/py-moviepy: . files
Yuri Victorovich
yuri at FreeBSD.org
Sun Dec 16 18:59:07 UTC 2018
Author: yuri
Date: Sun Dec 16 18:59:06 2018
New Revision: 487621
URL: https://svnweb.freebsd.org/changeset/ports/487621
Log:
multimedia/py-moviepy: Unbreak: it couldn't find the ffmpeg executable
This line:
from moviepy.editor import *
resulted in failure:
File "/usr/local/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 77, in download
raise RuntimeError("FFMPEG exe isn't available for platform %s" % plat)
RuntimeError: FFMPEG exe isn't available for platform freebsd64
This is because it uses py-imageio to download the ffmpeg binary which doesn't exist for FreeBSD.
Besides, py-imageio is downloading files without checking cryptographic fingerprints wihich is insecure: https://github.com/imageio/imageio/issues/416
Solution:
Make py-moviepy to always use the pre-installed ffmpeg package.
Approved by: portmgr (unbreak)
Added:
head/multimedia/py-moviepy/files/
head/multimedia/py-moviepy/files/patch-moviepy_config__defaults.py (contents, props changed)
head/multimedia/py-moviepy/files/patch-moviepy_editor.py (contents, props changed)
Modified:
head/multimedia/py-moviepy/Makefile
Modified: head/multimedia/py-moviepy/Makefile
==============================================================================
--- head/multimedia/py-moviepy/Makefile Sun Dec 16 18:42:27 2018 (r487620)
+++ head/multimedia/py-moviepy/Makefile Sun Dec 16 18:59:06 2018 (r487621)
@@ -2,7 +2,7 @@
PORTNAME= moviepy
PORTVERSION= 0.2.3.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= multimedia python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -16,7 +16,8 @@ LICENSE_FILE= ${WRKSRC}/LICENCE.txt
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}decorator>=4.0.2:devel/py-decorator@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}imageio>=2.1.2:graphics/py-imageio@${PY_FLAVOR} \
${PYNUMPY} \
- ${PYTHON_PKGNAMEPREFIX}tqdm>=4.11.2:misc/py-tqdm@${PY_FLAVOR}
+ ${PYTHON_PKGNAMEPREFIX}tqdm>=4.11.2:misc/py-tqdm@${PY_FLAVOR} \
+ ffmpeg:multimedia/ffmpeg
USES= python
USE_PYTHON= autoplist concurrent distutils
Added: head/multimedia/py-moviepy/files/patch-moviepy_config__defaults.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/multimedia/py-moviepy/files/patch-moviepy_config__defaults.py Sun Dec 16 18:59:06 2018 (r487621)
@@ -0,0 +1,12 @@
+--- moviepy/config_defaults.py.orig 2018-12-16 18:28:09 UTC
++++ moviepy/config_defaults.py
+@@ -50,5 +50,6 @@ IMAGEMAGICK_BINARY
+
+ import os
+
+-FFMPEG_BINARY = os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio')
+-IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'auto-detect')
+\ No newline at end of file
++FFMPEG_BINARY = "ffmpeg" # by default it asks py-imageio to download ffmpeg from GitHub, but it doesn't exist there for FreeBSD, and it is also an insecure download
++ # instead, just default to "ffmpeg" which means to use the local binary
++IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'auto-detect')
Added: head/multimedia/py-moviepy/files/patch-moviepy_editor.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/multimedia/py-moviepy/files/patch-moviepy_editor.py Sun Dec 16 18:59:06 2018 (r487621)
@@ -0,0 +1,14 @@
+--- moviepy/editor.py.orig 2018-12-16 18:36:01 UTC
++++ moviepy/editor.py
+@@ -21,8 +21,10 @@ import os
+
+ # Downloads ffmpeg if it isn't already installed
+ import imageio
++from moviepy.config import get_setting
++
+ # Checks to see if the user has set a place for their own version of ffmpeg
+-if os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio') == 'ffmpeg-imageio':
++if get_setting("FFMPEG_BINARY") == 'ffmpeg-imageio':
+ imageio.plugins.ffmpeg.download()
+
+ # Clips
More information about the svn-ports-all
mailing list