SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sorry for necroposting, but I've made an improvement on this script to auto detect some libraries.
It's not complete, but maybe we could finish this list and send to the maintainer. The missing parts are marked with a #TODO comment
The following lines can be added just before the comments I've kept at the end.
As drgibbon showed, I did finally find the time to add autodetection to the script. Unfortunately, the maintainer believes that it comes too close to replicating a build system within the SlackBuild. Here's his message:
Quote:
Hi Jeremy!
Thanks for the poke on LQ and sorry I missed this
I agree that this is a beneficial change, just not to the SlackBuild
IMHO, the SlackBuild is already very complex as it is. Adding dependency auto-
detection to it essentially turns the SlackBuild into another build system for
ffmpeg.
Instead of modifying the SlackBuild to auto-detect the dependencies, you could
try modifying ffmpeg's configure script to do the auto-detection there, and then
try to get it upstream.
They might not accept it, as I suppose there's a reason why there's no auto-
detection so far, but depending on the reasoning given we can then decide how
we want to proceed on our side.
Generally though, I'd rather carry a patch to ffmpeg that makes the SlackBuild
simpler than adding dependency detection to the SlackBuild.
Grs,
Heinz
Here's my patch for ffmpeg from SBo:
Code:
From a0f627934b0d016a407fb0528705840e15be2bea Mon Sep 17 00:00:00 2001
From: Jeremy Hansen <jebrhansen+SBo@gmail.com>
Date: Sat, 24 Oct 2020 17:43:55 -0600
Subject: [PATCH 1/1] multimedia/ffmpeg: Add autodetection support for optional
dependencies
---
multimedia/ffmpeg/README | 81 +++++++++++-----------
multimedia/ffmpeg/ffmpeg.SlackBuild | 131 +++++++++++++++++++++++-------------
2 files changed, 126 insertions(+), 86 deletions(-)
diff --git a/multimedia/ffmpeg/README b/multimedia/ffmpeg/README
index 09b08b00df..d93a142fc5 100644
--- a/multimedia/ffmpeg/README
+++ b/multimedia/ffmpeg/README
@@ -4,46 +4,49 @@ FFmpeg is a complete solution to record, convert and stream audio
and video. It includes libavcodec, the leading audio/video codec
library.
-You can enable a lot of optional (not-autodetected) features by
-passing variables to the script (VAR=yes/no ./ffmpeg.SlackBuild):
-ASS=yes|no (default: no), requires libass
-BLURAY=yes|no (default: no), requires libbluray
-BS2B=yes|no (default: no), requires libbs2b
-CELT=yes|no (default: no), requires celt
-CHROMAPRINT=yes|no (default: no), requires chromaprint
-DC1394=yes|no (default: no), requires libdc1394
-DECKLINK=yes|no (default: no), requires decklink-sdk
-EBUR128=yes|no (default: no), requires libebur128
-FDK_AAC=yes|no (default: no), requires libfdk-aac (creates non-redistributable binary)
-FLITE=yes|no (default: no), requires flite
-FREI0R=yes|no (default: no), requires frei0r
-GME=yes|no (default: no), requires libgme
-GSM=yes|no (default: no), requires gsm
-IEC61883=yes|no (default: no), requires libiec61883 and libavc1394
-ILBC=yes|no (default: no), requires libilbc
-LADSPA=yes|no (default: no), requires ladspa_sdk
-LAME=yes|no (default: no), requires lame
-MODPLUG=yes|no (default: no), requires libmodplug
-NETCDF=yes|no (default: no), requires netcdf
-OPENAL=yes|no (default: no), requires OpenAL
-OPENCORE=yes|no (default: no), requires opencore-amr
-OPENCV=yes|no (default: no), requires opencv-legacy
+The following packages are optional dependencies. They will be enabled
+if autodetected. If you want them disabled, pass:
+VAR=no .ffmpeg.SlackBuild
+
+OpenAL (disable via OPENAL=no)
+celt (disable via CELT=no)
+chromaprint (disable via CHROMAPRINT=no)
+decklink-sdk (disable via DECKLINK=no)
+flite (disable via FLITE=no)
+frei0r (disable via FREI0R=no)
+gsm (disable via GSM=no)
+ladspa_sdk (disable via LADSPA=no)
+lame (disable via LAME=no)
+libass (disable via ASS=no)
+libbluray (disable via BLURAY=no)
+libbs2b (disable via BS2B=no)
+libdc1394 (disable via DC1394=no)
+libebur128 (disable via EBUR128=no)
+libfdk-aac (disable via FDK_AAC=no) (creates non-redistributable binary)
+libgme (disable via GME=no)
+libilbc (disable via ILBC=no)
+libmodplug (disable via MODPLUG=no)
+libwebp (disable via WEBP=no)
+netcdf (disable via NETCDF=no)
+opencore-amr (disable via OPENCORE=no)
+opencv-legacy (disable via OPENCV=no)
+opus (disable via OPUS=no)
+rtmpdump (disable via RTMP=no)
+rubberband (disable via RUBBERBAND=no)
+schroedinger (disable via SCHROEDINGER=no)
+snappy (disable via SNAPPY=no)
+speex (disable via SPEEX=no)
+tesseract (disable via TESSERACT=no)
+twolame (disable via TWOLAME=no)
+vid.stab (disable via VIDSTAB=no)
+x264 (disable via X264=no)
+x265 (disable via X265=no)
+xvidcore (disable via XVID=no)
+zeromq (disable via ZMQ=no)
+zvbi (disable via ZVBI=no)
+libiec61883 & libavc1394 (disable via IEC61883=no)
+
OPENSSL=yes|no (default: no), creates non-redistributable binary
-OPUS=yes|no (default: no), requires opus
-RTMP=yes|no (default: no), requires rtmpdump
-RUBBERBAND=yes|no (default: no), requires rubberband
-SCHROEDINGER=yes|no (default: no), requires schroedinger
-SNAPPY=yes|no (default: no), requires snappy
-SPEEX=yes|no (default: no), requires speex
-TESSERACT=yes|no (default: no), requires tesseract
-TWOLAME=yes|no (default: no), requires twolame
-VIDSTAB=yes|no (default: no), requires vid.stab
-WEBP=yes|no (default: no), requires libwebp
-X264=yes|no (default: no), requires x264
-X265=yes|no (default: no), requires x265
-XVID=yes|no (default: no), requires xvidcore
-ZMQ=yes|no (default: no), requires zeromq
-ZVBI=yes|no (default: no), requires zvbi
Additional optional (autodetected) dependencies are jack and SDL2. The
latter is needed for building ffplay.
diff --git a/multimedia/ffmpeg/ffmpeg.SlackBuild b/multimedia/ffmpeg/ffmpeg.SlackBuild
index 8b83fcca42..40039ac668 100644
--- a/multimedia/ffmpeg/ffmpeg.SlackBuild
+++ b/multimedia/ffmpeg/ffmpeg.SlackBuild
@@ -28,7 +28,7 @@
PRGNAM=ffmpeg
VERSION=${VERSION:-3.2.4}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -58,8 +58,8 @@ else
LIBDIRSUFFIX=""
fi
-# You can enable a lot of optional (not-autodetected) features by
-# passing variables to the script (VAR=yes/no ./ffmpeg.SlackBuild).
+# You can disable a lot of optional (now autodetected) features by
+# passing variables to the script (VAR=no ./ffmpeg.SlackBuild).
# Unfortunately ffmpeg's configure doesn't support --enable-feature=yes
# syntax, so we have to do it the complicated way :/
# Additional optional (autodetected) dependencies are:
@@ -72,49 +72,83 @@ fi
# - xz
# - zlib
-mp3lame="" ; [ "${LAME:-no}" != "no" ] && mp3lame="--enable-libmp3lame"
-libx264="" ; [ "${X264:-no}" != "no" ] && libx264="--enable-libx264"
-libcelt="" ; [ "${CELT:-no}" != "no" ] && libcelt="--enable-libcelt"
-libdc1394="" ; [ "${DC1394:-no}" != "no" ] && libdc1394="--enable-libdc1394"
-libfrei0r="" ; [ "${FREI0R:-no}" != "no" ] && libfrei0r="--enable-frei0r"
-libgsm="" ; [ "${GSM:-no}" != "no" ] && libgsm="--enable-libgsm"
-librtmp="" ; [ "${RTMP:-no}" != "no" ] && librtmp="--enable-librtmp"
-dirac_fast="" ; [ "${SCHROEDINGER:-no}" != "no" ] && dirac_fast="--enable-libschroedinger"
-libspeex="" ; [ "${SPEEX:-no}" != "no" ] && libspeex="--enable-libspeex"
-libxvid="" ; [ "${XVID:-no}" != "no" ] && libxvid="--enable-libxvid"
-libbluray="" ; [ "${BLURAY:-no}" != "no" ] && libbluray="--enable-libbluray"
-libass="" ; [ "${ASS:-no}" != "no" ] && libass="--enable-libass"
-libopenal="" ; [ "${OPENAL:-no}" != "no" ] && libopenal="--enable-openal"
-libiec61883=""; [ "${IEC61883:-no}" != "no" ] && libiec61883="--enable-libiec61883"
-libilbc="" ; [ "${ILBC:-no}" != "no" ] && libilbc="--enable-libilbc"
-libmodplug="" ; [ "${MODPLUG:-no}" != "no" ] && libmodplug="--enable-libmodplug"
-libopus="" ; [ "${OPUS:-no}" != "no" ] && libopus="--enable-libopus"
-libtwolame="" ; [ "${TWOLAME:-no}" != "no" ] && libtwolame="--enable-libtwolame"
-ladspa="" ; [ "${LADSPA:-no}" != "no" ] && ladspa="--enable-ladspa"
-libflite="" ; [ "${FLITE:-no}" != "no" ] && libflite="--enable-libflite"
-libvidstab="" ; [ "${VIDSTAB:-no}" != "no" ] && libvidstab="--enable-libvidstab"
-libx265="" ; [ "${X265:-no}" != "no" ] && libx265="--enable-libx265"
-libzvbi="" ; [ "${ZVBI:-no}" != "no" ] && libzvbi="--enable-libzvbi"
-libopencv="" ; [ "${OPENCV:-no}" != "no" ] && libopencv="--enable-libopencv"
-libgme="" ; [ "${GME:-no}" != "no" ] && libgme="--enable-libgme"
-libsnappy="" ; [ "${SNAPPY:-no}" != "no" ] && libsnappy="--enable-libsnappy"
-libwebp="" ; [ "${WEBP:-no}" != "no" ] && libwebp="--enable-libwebp"
-libzmq="" ; [ "${ZMQ:-no}" != "no" ] && libzmq="--enable-libzmq"
-libbs2b="" ; [ "${BS2B:-no}" != "no" ] && libbs2b="--enable-libbs2b"
-libebur128="" ; [ "${EBUR128:-no}" != "no" ] && libebur128="--enable-libebur128"
-rubberband="" ; [ "${RUBBERBAND:-no}" != "no" ] && rubberband="--enable-librubberband"
-tesseract="" ; [ "${TESSERACT:-no}" != "no" ] && tesseract="--enable-libtesseract"
-netcdf="" ; [ "${NETCDF:-no}" != "no" ] && netcdf="--enable-netcdf"
-chromaprint="" ; [ "${CHROMAPRINT:-no}" != "no" ] && chromaprint="--enable-chromaprint"
-opencore_amr="" ; [ "${OPENCORE:-no}" != "no" ] && \
- opencore_amr="--enable-libopencore-amrnb --enable-libopencore-amrwb"
-fdk="" ; [ "${FDK_AAC:-no}" != "no" ] && \
- { fdk="--enable-libfdk-aac"; non_free="--enable-nonfree" ; }
-ssl="" ; [ "${OPENSSL:-no}" != "no" ] && \
- { ssl="--enable-openssl" ; non_free="--enable-nonfree" ; }
-decklink="" ; [ "${DECKLINK:-no}" != "no" ] && \
- { decklink="--enable-decklink" ; \
- SLKCFLAGS="$SLKCFLAGS -I/usr/include/decklink" ; }
+## Enable autodetect using pkg-config -- SBo package names are above each check
+#OpenAL
+if pkg-config --exists openal && [ "${OPENAL:-yes}" != "no" ]; then libopenal="--enable-openal"; else libopenal=""; fi
+#celt
+if pkg-config --exists celt && [ "${CELT:-yes}" != "no" ]; then libcelt="--enable-libcelt"; else libcelt=""; fi
+#chromaprint
+if pkg-config --exists libchromaprint && [ "${CHROMAPRINT:-yes}" != "no" ]; then chromaprint="--enable-chromaprint"; else chromaprint=""; fi
+#fdk-aac -- creates non-redistributable binary
+if pkg-config --exists fdk-aac && [ "${FDK-AAC:-yes}" != "no" ]; then fdk="--enable-libfdk-aac"; non_free="--enable-nonfree"; else fdk=""; fi
+#frei0r
+if pkg-config --exists frei0r && [ "${FREI0R:-yes}" != "no" ]; then libfrei0r="--enable-frei0r"; else libfrei0r=""; fi
+#libass
+if pkg-config --exists libass && [ "${LIBASS:-yes}" != "no" ]; then libass="--enable-libass"; else libass=""; fi
+#libbluray
+if pkg-config --exists libbluray && [ "${BLURAY:-yes}" != "no" ]; then libbluray="--enable-libbluray"; else libbluray=""; fi
+#libbs2b
+if pkg-config --exists libbs2b && [ "${BS2B:-yes}" != "no" ]; then libbs2b="--enable-libbs2b"; else libbs2b=""; fi
+#libdc1394
+if pkg-config --exists libdc1394-2 && [ "${DC1394:-no}" != "no" ]; then libdc1394="--enable-libdc1394"; else libdc1394=""; fi
+#libebur128
+if pkg-config --exists libebur128 && [ "${EBUR128:-yes}" != "no" ]; then libebur128="--enable-libebur128"; else libebur128=""; fi
+#libgme
+if pkg-config --exists libgme && [ "${GME:-yes}" != "no" ]; then libgme="--enable-libgme"; else libgme=""; fi
+#libiec61883 & libavc1394
+if pkg-config --exists libavc1394 && pkg-config --exists libiec61883 && [ "${IEC61883:-yes}" != "no" ]; then libiec61883="--enable-libiec61883"; else libiec61883=""; fi
+#libilbc
+if pkg-config --exists libilbc && [ "${ILBC:-yes}" != "no" ]; then libilbc="--enable-libilbc"; else libilbc=""; fi
+#libmodplug
+if pkg-config --exists libmodplug && [ "${MODPLUG:-yes}" != "no" ]; then libmodplug="--enable-libmodplug"; else libmodplug=""; fi
+#libwebp
+if pkg-config --exists libwebp && [ "${WEBP:-yes}" != "no" ]; then libwebp="--enable-libwebp"; else libwebp=""; fi
+#netcdf
+if pkg-config --exists netcdf && [ "${NETCDF:-no}" != "no" ]; then netcdf="--enable-netcdf"; else netcdf=""; fi
+#opencore-amrnb
+if pkg-config --exists opencore-amrnb && [ "${OPENCORE:-yes}" != "no" ]; then opencore_amr="--enable-libopencore-amrnb --enable-libopencore-amrwb"; else opencore-amrnb=""; fi
+#opencv
+if pkg-config --exists opencv && [ "${OPENCV:-yes}" != "no" ]; then libopencv="--enable-libopencv"; else libopencv=""; fi
+#opus
+if pkg-config --exists opus && [ "${OPUS:-yes}" != "no" ]; then libopus="--enable-libopus"; else libopus=""; fi
+#rtmpdump
+if pkg-config --exists librtmp && [ "${RTMP:-yes}" != "no" ]; then librtmp="--enable-librtmp"; else librtmp=""; fi
+#rubberband
+if pkg-config --exists rubberband && [ "${RUBBERBAND:-yes}" != "no" ]; then rubberband="--enable-librubberband"; else rubberband=""; fi
+#schroedinger
+if pkg-config --exists schroedinger-1.0 && [ "${SCHROEDINGER:-yes}" != "no" ]; then dirac_fast="--enable-libschroedinger"; else dirac_fast=""; fi
+#speex
+if pkg-config --exists speex && [ "${SPEEX:-yes}" != "no" ]; then libspeex="--enable-libspeex"; else libspeex=""; fi
+#tesseract
+if pkg-config --exists tesseract && [ "${TESSERACT:-no}" != "no" ]; then tesseract="--enable-libtesseract"; else tesseract=""; fi
+#twolame
+if pkg-config --exists twolame && [ "${TWOLAME:-yes}" != "no" ]; then libtwolame="--enable-libtwolame"; else libtwolame=""; fi
+#vid.stab
+if pkg-config --exists vidstab && [ "${VIDSTAB:-yes}" != "no" ]; then libvidstab="--enable-libvidstab"; else libvidstab=""; fi
+#x264
+if pkg-config --exists x264 && [ "${X264:-yes}" != "no" ]; then libx264="--enable-libx264"; else libx264=""; fi
+#x265
+if pkg-config --exists x265 && [ "${X265:-yes}" != "no" ]; then libx265="--enable-libx265"; else libx265=""; fi
+#zeromq
+if pkg-config --exists libzmq && [ "${ZMQ:-no}" != "no" ]; then libzmq="--enable-libzmq"; else libzmq=""; fi
+#zvbi
+if pkg-config --exists zvbi-0.2 && [ "${ZVBI:-no}" != "no" ]; then libzvbi="--enable-libzvbi"; else libzvbi=""; fi
+
+## These do not support pkg-config, checking for program manually
+#decklink-sdk
+if [ -e /usr/include/decklink/DeckLinkAPI.h ] && [ "${DECKLINK:-no}" != "no" ]; then decklink="--enable-decklink" ; SLKCFLAGS="$SLKCFLAGS -I/usr/include/decklink" ; else decklink=""; fi
+#flite
+if [ -e /usr/include/flite/flite.h ] && [ "${FLITE:-no}" != "no" ]; then libflite="--enable-libflite"; else libflite=""; fi
+#gsm
+if [ -e /usr/include/gsm/gsm.h ] && [ "${GSM:-no}" != "no" ]; then libgsm="--enable-libgsm"; else libgsm=""; fi
+#ladspa_sdk
+if [ -e /usr/include/ladspa.h ] && [ "${LADSPA:-no}" != "no" ]; then ladspa="--enable-ladspa"; else ladspa=""; fi
+#lame
+if [ -e /usr/include/lame/lame.h ] && [ "${LAME:-yes}" != "no" ]; then mp3lame="--enable-libmp3lame"; else mp3lame=""; fi
+#snappy
+if [ -e /usr/include/snappy.h ] && [ "${SNAPPY:-no}" != "no" ]; then libsnappy="--enable-libsnappy"; else libsnappy=""; fi
+#xvidcore
+if [ -e /usr/include/xvid.h ] && [ "${XVID:-no}" != "no" ]; then libxvid="--enable-libxvid"; else libxvid=""; fi
# Default enabled features:
#opencl="" ; [ "${OPENCL:-yes}" != "no" ] && opencl="--enable-opencl"
@@ -137,7 +171,10 @@ wavpack="" ; [ "${WAVPACK:-yes}" != "no" ] && wavpack="--enable-libwavpac
x11grab="" ; [ "${X11GRAB:-yes}" != "no" ] && x11grab="--enable-x11grab"
# Disable patent encumbered features:
-aac="" ; [ "${AAC:-yes}" != "yes" ] && aac="--disable-encoder=aac"
+aac="" ; [ "${AAC:-yes}" != "yes" ] && aac="--disable-encoder=aac"
+
+# Creates non-redistributable binary
+ssl="" ; [ "${OPENSSL:-no}" != "no" ] && { ssl="--enable-openssl" ; non_free="--enable-nonfree" ; }
set -e
--
2.14.5
It can be applied while directly in the ffmpeg directory via:
I also have the SlackBuild available on my github repo, if you'd rather do that.
I did find that I need to rework my ffmpeg patch for -current as support for 13 additional libraries were added to the SlackBuild since I last did this, so I'll need to add the programs to my computer and find out if they support pkg-config or if I'll need to manually check for files. Once I get that done, I'll upload a SlackBuild to my repo for -current. I hope to find time this weekend for it.
Thanks for your efforts on this! I use ffmpeg a lot, but spread across three different machines. Over a period of time (since 14.2 came out!), the three have drifted a part somewhat in what is installed on them!
I've been patiently waiting for 15.0 so I can start from scratch, and ensure that all three machines have exactly the same setup on them! Too many patches and upgrades going on on -current, erm, currently, to keep on top of it all!
I've invested in a small NAS that I use as a local repository for the Slackware tree, to save having to download everything three times whenever there's an upgrade. My intention is to put all my multimedia builds on there too, so that I only have to build ffmpeg - or whatever - on one machine, and then simply install it on the rest.
So many projects, so little time! <sigh!>
In the meantime, auto-detecting ffmpeg builds is a major help, so again, thanks for your efforts!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.