LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-05-2021, 12:31 AM   #16
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656

Quote:
Originally Posted by Weber Kai View Post
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:

Code:
patch -p3 < 0001-multimedia-ffmpeg-Add-autodetection-ffmpeg-14.2.patch
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.
 
1 members found this post helpful.
Old 06-06-2021, 03:19 PM   #17
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Here's the updated patch for -current:

Code:
From 1bc9230eaa3338e0508549dd654e5ea2a9af5831 Mon Sep 17 00:00:00 2001
From: Jeremy Hansen <jebrhansen+SBo@gmail.com>
Date: Sun, 6 Jun 2021 14:09:51 -0600
Subject: [PATCH] Add ffmpeg autodetection for -current

---
 ffmpeg.SlackBuild | 128 +++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 83 insertions(+), 45 deletions(-)

diff --git a/ffmpeg.SlackBuild b/ffmpeg.SlackBuild
index 49bfcc6..ecf8e69 100755
--- a/ffmpeg.SlackBuild
+++ b/ffmpeg.SlackBuild
@@ -89,51 +89,87 @@ fi
 # - xz
 # - zlib
 
-libx264=""    ; [ "${X264:-no}" != "no" ]         && libx264="--enable-libx264"
-libcelt=""    ; [ "${CELT:-no}" != "no" ]         && libcelt="--enable-libcelt"
-libdc1394=""  ; [ "${DC1394:-no}" != "no" ]       && libdc1394="--enable-libdc1394"
-libgsm=""     ; [ "${GSM:-no}" != "no" ]          && libgsm="--enable-libgsm"
-librtmp=""    ; [ "${RTMP:-no}" != "no" ]         && librtmp="--enable-librtmp"
-libxvid=""    ; [ "${XVID:-no}" != "no" ]         && libxvid="--enable-libxvid"
-libass=""     ; [ "${ASS:-no}" != "no" ]          && libass="--enable-libass"
-libiec61883=""; [ "${IEC61883:-no}" != "no" ]     && libiec61883="--enable-libiec61883"
-libilbc=""    ; [ "${ILBC:-no}" != "no" ]         && libilbc="--enable-libilbc"
-libmodplug="" ; [ "${MODPLUG:-no}" != "no" ]      && libmodplug="--enable-libmodplug"
-libtwolame="" ; [ "${TWOLAME:-no}" != "no" ]      && libtwolame="--enable-libtwolame"
-ladspa=""     ; [ "${LADSPA:-no}" != "no" ]       && ladspa="--enable-ladspa"
-libflite=""   ; [ "${FLITE:-no}" != "no" ]        && libflite="--enable-libflite"
-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"
-libzmq=""     ; [ "${ZMQ:-no}" != "no" ]          && libzmq="--enable-libzmq"
-libbs2b=""    ; [ "${BS2B:-no}" != "no" ]         && libbs2b="--enable-libbs2b"
-rubberband="" ; [ "${RUBBERBAND:-no}" != "no" ]   && rubberband="--enable-librubberband"
-tesseract=""  ; [ "${TESSERACT:-no}" != "no" ]    && tesseract="--enable-libtesseract"
-libjack=""    ; [ "${JACK:-no}" != "no" ]         && libjack="--enable-libjack"
-libaom=""     ; [ "${AOM:-no}" != "no" ]          && libaom="--enable-libaom"
-lv2=""        ; [ "${LV2:-no}" != "no" ]          && lv2="--enable-lv2"
-libdav1d=""   ; [ "${DAV1D:-no}" != "no" ]        && libdav1d="--enable-libdav1d"
-rabbitmq=""   ; [ "${RABBITMQ:-no}" != "no" ]     && rabbitmq="--enable-librabbitmq"
-libcodec2=""  ; [ "${CODEC2:-no}" != "no" ]       && libcodec2="--enable-libcodec2"
-libsoxr=""    ; [ "${SOXR:-no}" != "no" ]         && libsoxr="--enable-libsoxr"
-libsrt=""     ; [ "${SRT:-no}" != "no" ]          && libsrt="--enable-libsrt"
-libzimg=""    ; [ "${ZIMG:-no}" != "no" ]         && libzimg="--enable-libzimg"
-chromaprint=""  ; [ "${CHROMAPRINT:-no}" != "no" ] && chromaprint="--enable-chromaprint"
-vapoursynth=""  ; [ "${VAPOURSYNTH:-no}" != "no" ] && vapoursynth="--enable-vapoursynth"
-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" ; }
-vulkan=""     ; [ "${VULKAN:-no}" != "no" ]      && vulkan="--enable-vulkan"
-libglslang="" ; [ "${GLSLANG:-no}" != "no" ]     && libglslang="--enable-libglslang"
-liblensfun="" ; [ "${LENSFUN:-no}" != "no" ]     && liblensfun="--enable-liblensfun"
+## Enable autodetect using pkg-config -- SBo package names are above each check
+#aom
+if pkg-config --exists aom && [ "${AOM:-no}" != "no" ]; then libaom="--enable-libaom"; else libaom=""; 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
+#codec2
+if pkg-config --exists codec2 && [ "${CODEC2:-no}" != "no" ]; then libcodec2="--enable-libcodec2"; else libcodec2=""; fi
+#dav1d
+if pkg-config --exists libdav1d && [ "${DAV1D:-no}" != "no" ]; then libdav1d="--enable-libdav1d"; else libdav1d=""; 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
+# jack
+if pkg-config --exists jack && [ "${JACK:-no}" != "no" ]; then libjack="--enable-libjack"; else libjack=""; fi
+#lensfun
+if pkg-config --exists liblensfun && [ "${LENSFUN:-no}" != "no" ]; then liblensfun="--enable-liblensfun"; else liblensfun=""; fi
+#libass
+if pkg-config --exists libass && [ "${LIBASS:-yes}" != "no" ]; then libass="--enable-libass"; else libass=""; 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
+#libgme
+if pkg-config --exists libgme && [ "${GME:-yes}" != "no" ]; then libgme="--enable-libgme"; else libgme=""; fi
+#libiec61883 & libavc1394
+if pkg-config --exists libavc1394 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
+#lv2
+if pkg-config --exists lv2 && [ "${LV2:-no}" != "no" ]; then lv2="--enable-lv2"; else lv2=""; 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
+#rabbitmq-c
+if pkg-config --exists librabbitmq && [ "${RABBITMQ:-no}" != "no" ]; then rabbitmq="--enable-librabbitmq"; else rabbitmq=""; 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
+#soxr
+if pkg-config --exists soxr && [ "${SOXR:-no}" != "no" ]; then libsoxr="--enable-libsoxr"; else libsoxr=""; fi
+#srt
+if pkg-config --exists srt && [ "${SRT:-no}" != "no" ]; then libsrt="--enable-libsrt"; else libsrt=""; 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
+#vapoursynth
+if pkg-config --exists vapoursynth && [ "${VAPOURSYNTH:-no}" != "no" ]; then vapoursynth="--enable-vapoursynth"; else vapoursynth=""; fi
+#vulkan-sdk
+if pkg-config --exists vulkan && [ "${VULKAN:-no}" != "no" ]; then vulkan="--enable-vulkan"; else vulkan=""; 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
+#zimg
+if pkg-config --exists zimg && [ "${ZIMG:-no}" != "no" ]; then libzimg="--enable-libzimg"; else libzimg=""; 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 programs 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
+#glslang
+if [ -e /usr/include/glslang/Include/glslang_c_interface.h ] && [ "${GLSLANG:-no}" != "no" ];then libglslang="--enable-libglslang"; else libglslang=""; 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
+#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:
 fontconfig="" ; [ "${FONTCONFIG:-yes}" != "no" ]  && fontconfig="--enable-libfontconfig"
@@ -166,6 +202,8 @@ libdrm=""     ; [ "${LIBDRM:-yes}" != "no" ]      && libdrm="--enable-libdrm"

 # No default patent encumbered features:
 aac=""        ; [ "${AAC:-no}" = "no" ]           && aac="--disable-encoder=aac"
+# Don't include OpenSSL support by default (enabling creates non-redistributable binary):
+ssl=""       ; [ "${OPENSSL:-no}" != "no" ]      && { ssl="--enable-openssl" ; non_free="--enable-nonfree" ; }

 rm -rf $PKG
 mkdir -p $TMP $PKG
--
2.14.5
It can be applied from within the ffmpeg directory using:

Code:
patch -p1 < 0001-Add-ffmpeg-autodetection-for-current.patch
Or the script can be found on my github.
 
2 members found this post helpful.
Old 06-10-2021, 03:02 AM   #18
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Rep: Reputation: Disabled
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!

--
Pete
 
  


Reply

Tags
ffmpeg, x264



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ffmpeg: Unknown encoder 'libmp3lame' maschelsea Linux - Software 13 01-30-2017 02:36 AM
LINUX UBUNTU PHP FFMPEG INSTALLED BUT libx264 while installing ERROR??? trinay123 Ubuntu 2 03-13-2010 10:22 AM
slack13_64 - FFMPEG's "libx264 not found" error erickFis Slackware 24 11-14-2009 08:12 PM
[FFMPEG] Error with libx264 not found nikhil010586 Linux - Software 11 09-23-2009 03:48 AM
dependency issue: libx264.so.54 needed by ffmpeg PhilTR Fedora 22 01-23-2007 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration