gst-plugins-bad-nonfree.SlackBuild 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. #!/bin/bash
  2. # Slackware build script for gst-plugins-bad-nonfree
  3. # Copyright 2013-2021 Robby Workman, Tuscaloosa, Alabama, USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. # 20220307 bkw: this is a rename and rework of the old SBo
  23. # gst-plugins-bad. Here we build only the portions of gst-plugins-bad
  24. # that are missing from Slackware's gst-plugins-bad-free. Despite
  25. # the -nonfree in the name, not all of these are encumbered (some
  26. # just aren't included in Slackware because it lacks the optional
  27. # dependencies).
  28. cd $(dirname $0) ; CWD=$(pwd)
  29. PRGNAM=gst-plugins-bad-nonfree
  30. VERSION=${VERSION:-1.18.5}
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34. if [ -z "$ARCH" ]; then
  35. case "$( uname -m )" in
  36. i?86) ARCH=i586 ;;
  37. arm*) ARCH=arm ;;
  38. *) ARCH=$( uname -m ) ;;
  39. esac
  40. fi
  41. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  42. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  43. exit 0
  44. fi
  45. TMP=${TMP:-/tmp/SBo}
  46. PKG=$TMP/package-$PRGNAM
  47. OUTPUT=${OUTPUT:-/tmp}
  48. if [ "$ARCH" = "i586" ]; then
  49. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  50. LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "i686" ]; then
  52. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  53. LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "x86_64" ]; then
  55. SLKCFLAGS="-O2 -fPIC"
  56. LIBDIRSUFFIX="64"
  57. else
  58. SLKCFLAGS="-O2"
  59. LIBDIRSUFFIX=""
  60. fi
  61. set -e
  62. SRCNAM=gst-plugins-bad
  63. # 20220307 bkw: libsrtp is disabled by default because it currently breaks
  64. # the build.
  65. [ "${SRTP:-no}" = "no" ] && SRTPOPT="-Dsrtp=disabled"
  66. # 20220307 bkw: nvcodec is disabled by default, per Robby's README.
  67. [ "${CUDA:-no}" = "no" ] && CUDAOPT="-Dnvcodec=disabled"
  68. rm -rf $PKG
  69. mkdir -p $TMP $PKG $OUTPUT
  70. cd $TMP
  71. rm -rf $SRCNAM-$VERSION
  72. tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
  73. cd $SRCNAM-$VERSION
  74. chown -R root:root .
  75. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  76. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  77. # 20220307 bkw: the massive list of -Dfoo=disabled below took a minute
  78. # to put together. Notice that shm is *not* in the list, though it
  79. # should be. This is because the build fails with -Dshm=disabled.
  80. # So we build it, then remove it from $PKG after it's installed.
  81. mkdir build
  82. cd build
  83. CFLAGS="$SLKCFLAGS" \
  84. CXXFLAGS="$SLKCFLAGS" \
  85. meson .. \
  86. --buildtype=release \
  87. --infodir=/usr/info \
  88. --libdir=/usr/lib${LIBDIRSUFFIX} \
  89. --localstatedir=/var \
  90. --mandir=/usr/man \
  91. --prefix=/usr \
  92. --sysconfdir=/etc \
  93. -Dexamples=disabled \
  94. -Dopencv=disabled \
  95. $SRTPOPT \
  96. $CUDAOPT \
  97. -Daccurip=disabled \
  98. -Dadpcmdec=disabled \
  99. -Dadpcmenc=disabled \
  100. -Daiff=disabled \
  101. -Dasfmux=disabled \
  102. -Daudiobuffersplit=disabled \
  103. -Daudiofxbad=disabled \
  104. -Daudiomixmatrix=disabled \
  105. -Daudiolatency=disabled \
  106. -Daudiovisualizers=disabled \
  107. -Dautoconvert=disabled \
  108. -Dbayer=disabled \
  109. -Dcamerabin2=disabled \
  110. -Dcoloreffects=disabled \
  111. -Ddebugutils=disabled \
  112. -Ddvbsubenc=disabled \
  113. -Dfaceoverlay=disabled \
  114. -Dfestival=disabled \
  115. -Dfieldanalysis=disabled \
  116. -Dfreeverb=disabled \
  117. -Dfrei0r=disabled \
  118. -Dgaudieffects=disabled \
  119. -Dgdp=disabled \
  120. -Dgeometrictransform=disabled \
  121. -Did3tag=disabled \
  122. -Dinter=disabled \
  123. -Dinterlace=disabled \
  124. -Divfparse=disabled \
  125. -Divtc=disabled \
  126. -Djp2kdecimator=disabled \
  127. -Djpegformat=disabled \
  128. -Dlibrfb=disabled \
  129. -Dmidi=disabled \
  130. -Dmpegdemux=disabled \
  131. -Dmpegpsmux=disabled \
  132. -Dmpegtsdemux=disabled \
  133. -Dmpegtsmux=disabled \
  134. -Dmxf=disabled \
  135. -Dnetsim=disabled \
  136. -Drtp=disabled \
  137. -Dpcapparse=disabled \
  138. -Dpnm=disabled \
  139. -Dproxy=disabled \
  140. -Drawparse=disabled \
  141. -Dremovesilence=disabled \
  142. -Drist=disabled \
  143. -Drtmp2=disabled \
  144. -Drtp=disabled \
  145. -Dsdp=disabled \
  146. -Dsegmentclip=disabled \
  147. -Dsmooth=disabled \
  148. -Dspeed=disabled \
  149. -Dsubenc=disabled \
  150. -Dswitchbin=disabled \
  151. -Dtimecode=disabled \
  152. -Dvideoframe_audiolevel=disabled \
  153. -Dvideofilters=disabled \
  154. -Dvideoparsers=disabled \
  155. -Dvideosignal=disabled \
  156. -Dvmnc=disabled \
  157. -Dy4m=disabled \
  158. -Dbluez=disabled \
  159. -Ddecklink=disabled \
  160. -Ddvb=disabled \
  161. -Dfbdev=disabled \
  162. -Dipcpipeline=disabled \
  163. -Dkms=disabled \
  164. -Duvch264=disabled \
  165. -Dv4l2codecs=disabled \
  166. -Dva=disabled \
  167. -Dbz2=disabled \
  168. -Dclosedcaption=disabled \
  169. -Dcolormanagement=disabled \
  170. -Dcurl=disabled \
  171. -Ddash=disabled \
  172. -Ddtls=disabled \
  173. -Dfluidsynth=disabled \
  174. -Dhls=disabled \
  175. -Dneon=disabled \
  176. -Donvif=disabled \
  177. -Dopenal=disabled \
  178. -Dopencv=disabled \
  179. -Dopenexr=disabled \
  180. -Dopenjpeg=disabled \
  181. -Dopus=disabled \
  182. -Dresindvd=disabled \
  183. -Drsvg=disabled \
  184. -Dsbc=disabled \
  185. -Dsctp=disabled \
  186. -Dsmoothstreaming=disabled \
  187. -Dsndfile=disabled \
  188. -Dttml=disabled \
  189. -Dtranscode=disabled \
  190. -Dvulkan=disabled \
  191. -Dwayland=disabled \
  192. -Dwebrtc=disabled \
  193. -Dwebp=disabled
  194. "${NINJA:=ninja}"
  195. DESTDIR=$PKG $NINJA install
  196. cd ..
  197. # 20220307 bkw: remove all the things that already exist in Slackware.
  198. rm -rf $PKG/usr/lib*/gstreamer-*/libgstshm.so \
  199. $PKG/usr/lib*/*.so* \
  200. $PKG/usr/lib*/girepository* \
  201. $PKG/usr/lib*/pkgconfig \
  202. $PKG/usr/share \
  203. $PKG/usr/include \
  204. $PKG/usr/bin
  205. strip $PKG/usr/lib*/gstreamer-*/*.so
  206. # 20220308 bkw: don't even include the docs. they already exist in Pat's
  207. # gst-plugins-bad-free package.
  208. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  209. mkdir -p $PKGDOC
  210. cat $CWD/README_docs.txt > $PKGDOC/README_docs.txt
  211. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  212. mkdir -p $PKG/install
  213. cat $CWD/slack-desc > $PKG/install/slack-desc
  214. cd $PKG
  215. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE