Skip to content

Commit

Permalink
Trac #32956: create dummy script packages for ffmpeg and imagemagick
Browse files Browse the repository at this point in the history
One advantage is that when the feature `ffmpeg` or `imagemagick` is
needed, an error message will now suggest how to install `ffmpeg` or
`imagemagick` according to the system (debian, cygwin, macports,
homebrew, etc.).

From https://trac.sagemath.org/ticket/32650#comment:33

See also https://trac.sagemath.org/ticket/32926#comment:24

Part of #30930

URL: https://trac.sagemath.org/32956
Reported by: slabbe
Ticket author(s): Sébastien Labbé
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Dec 21, 2021
2 parents 346459a + 6dd8bca commit da338b5
Show file tree
Hide file tree
Showing 37 changed files with 98 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/_recommended/distros/debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dvipng
# to run the Jmol 3D viewer from the console and generate images for 3D plots in the documentation
default-jdk
# to produce animations
ffmpeg
# ffmpeg -- this is a separate script package
libavdevice-dev
4 changes: 2 additions & 2 deletions build/pkgs/_recommended/distros/homebrew.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# To convert Jupyter notebooks to pdf:
# pandoc -- this is a separate script package
# To produce animations:
ffmpeg
imagemagick
# ffmpeg -- this is a separate script package
# imagemagick -- this is a separate script package
# Homebrew's texinfo can be used to build the info files for ecl and
# maxima but the OS X default version of texinfo cannot.
texinfo
4 changes: 2 additions & 2 deletions build/pkgs/_recommended/distros/macports.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# To convert Jupyter notebooks to pdf:
# pandoc -- this is a separate script package
# To produce animations:
ffmpeg
imagemagick
# ffmpeg -- this is a separate script package
# imagemagick -- this is a separate script package
# MacPorts's texinfo can be used to build the info files for ecl and
# maxima but the OS X default version of texinfo cannot.
texinfo
25 changes: 25 additions & 0 deletions build/pkgs/ffmpeg/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ffmpeg: ffmpeg video converter
==============================

Description
-----------

ffmpeg is a very fast video and audio converter that can also grab from a live
audio/video source. It can also convert between arbitrary sample rates and
resize video on the fly with a high quality polyphase filter.

License
-------

"FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version
2.1 or later. However, FFmpeg incorporates several optional parts and
optimizations that are covered by the GNU General Public License (GPL) version
2 or later. If those parts get used the GPL applies to all of FFmpeg."

http://ffmpeg.org/legal.html

Upstream Contact
----------------

http://ffmpeg.org/

1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/alpine.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imageio-ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/fedora.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/freebsd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
multimedia/ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/homebrew.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/macports.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/nix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/opensuse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/repology.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/distros/void.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffmpeg
5 changes: 5 additions & 0 deletions build/pkgs/ffmpeg/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SAGE_SPKG_CONFIGURE([ffmpeg], [
AC_PATH_PROG([FFMPEG], [ffmpeg])
AS_IF([test -z "$ac_cv_path_FFMPEG"], [sage_spkg_install_ffmpeg=yes])
])

1 change: 1 addition & 0 deletions build/pkgs/ffmpeg/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
29 changes: 29 additions & 0 deletions build/pkgs/imagemagick/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ImageMagick: A collection of tools and libraries for many image file formats
============================================================================

Description
-----------

A collection of tools and libraries for many image file formats

License
-------

Copyright [yyyy] [name of copyright owner]

Licensed under the ImageMagick License (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy
of the License at

https://imagemagick.org/script/license.php

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.

Upstream Contact
----------------

http://www.imagemagick.org/
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/alpine.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/cygwin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ImageMagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/fedora.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ImageMagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/freebsd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graphics/ImageMagick7
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/homebrew.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/macports.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ImageMagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/nix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/opensuse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ImageMagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/repology.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imagemagick
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/distros/void.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ImageMagick
4 changes: 4 additions & 0 deletions build/pkgs/imagemagick/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SAGE_SPKG_CONFIGURE([imagemagick], [
AC_PATH_PROG([CONVERT], [convert])
AS_IF([test -z "$ac_cv_path_CONVERT"], [sage_spkg_install_imagemagick=yes])
])
1 change: 1 addition & 0 deletions build/pkgs/imagemagick/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
2 changes: 1 addition & 1 deletion src/doc/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for SYSTEM in arch debian fedora cygwin homebrew conda; do
*:standard)
SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
_recommended:*|pandoc:*)
_recommended:*|pandoc:*|ffmpeg:*|imagemagick:*)
RECOMMENDED_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
*)
Expand Down
1 change: 1 addition & 0 deletions src/sage/features/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(self):
True
"""
Executable.__init__(self, "ffmpeg", executable="ffmpeg",
spkg="ffmpeg",
url="https://www.ffmpeg.org/")


Expand Down
2 changes: 1 addition & 1 deletion src/sage/features/imagemagick.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self):
"""
JoinFeature.__init__(self, "imagemagick",
[Executable("convert", executable="convert")],
spkg="_recommended",
spkg="imagemagick",
url="https://www.imagemagick.org/")


Expand Down

0 comments on commit da338b5

Please sign in to comment.