Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Slackware build script for Open Broadcaster Software
  4. #
  5. # Copyright 2015 Gethyn ThomasQuail <gethyn@bloodbathsoftworks.com>
  6. # Copyright 2016-2023 Christoph Willing, Brisbane Australia
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25.  
  26. cd $(dirname $0) ; CWD=$(pwd)
  27.  
  28. PRGNAM=obs-studio
  29. VERSION=${VERSION:-29.1.3}
  30. COMMIT=c58e511813c33e93da7637d50aa431ae0cddda0c
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34.  
  35. if [ -z "$ARCH" ]; then
  36. case "$( uname -m )" in
  37. i?86) ARCH=i586 ;;
  38. arm*) ARCH=arm ;;
  39. *) ARCH=$( uname -m ) ;;
  40. esac
  41. fi
  42.  
  43. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  44. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  45. exit 0
  46. fi
  47.  
  48. TMP=${TMP:-/tmp/SBo}
  49. PKG=$TMP/package-$PRGNAM
  50. OUTPUT=${OUTPUT:-/tmp}
  51.  
  52. if [ "$ARCH" = "i586" ]; then
  53. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. # CEF_ROOT=cef_binary_101.0.18+g367b4a0+chromium-101.0.4951.67_linux32_minimal
  56. elif [ "$ARCH" = "i686" ]; then
  57. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  58. LIBDIRSUFFIX=""
  59. # CEF_ROOT=cef_binary_101.0.18+g367b4a0+chromium-101.0.4951.67_linux32_minimal
  60. elif [ "$ARCH" = "x86_64" ]; then
  61. SLKCFLAGS="-O2 -fPIC"
  62. LIBDIRSUFFIX="64"
  63. # CEF_ROOT=cef_binary_4638_linux64
  64. else
  65. SLKCFLAGS="-O2"
  66. LIBDIRSUFFIX=""
  67. fi
  68.  
  69. set -e
  70.  
  71. rm -rf $PKG
  72. mkdir -p $TMP $PKG $OUTPUT
  73. cd $TMP
  74. rm -rf $PRGNAM-$VERSION
  75. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  76. #tar xvf $CWD/$CEF_ROOT.tar.bz2
  77. #cd $CEF_ROOT
  78. # strip -v Release/*.so
  79. # if [ "$ARCH" = "i686" -o "$ARCH" = "i586" ]; then
  80. # cmake \
  81. # -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  82. # -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  83. # -DCMAKE_BUILD_TYPE=Release .
  84.  
  85. # iiimake libcef_dll_wrapper
  86. # fi
  87. # cd ..
  88.  
  89. cd $PRGNAM-$VERSION
  90. sed -i -e '/OBS_VERSION_CANONICAL/ s=^=#=' CMakeLists.txt
  91. chown -R root:root .
  92. find -L . \
  93. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  94. -o -perm 511 \) -exec chmod 755 {} \; -o \
  95. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  96. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  97.  
  98. for i in $CWD/patches/* ; do patch -p1 < $i ; done
  99.  
  100. mkdir -p build
  101. cd build
  102. cmake \
  103. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  104. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  105. -DCMAKE_INSTALL_PREFIX=/usr \
  106. -DOBS_MULTIARCH_SUFFIX="$LIBDIRSUFFIX" \
  107. -DOBS_VERSION_OVERRIDE=${VERSION} \
  108. -DUNIX_STRUCTURE=ON \
  109. -DENABLE_BROWSER=OFF \
  110. -DENABLE_JACK=ON \
  111. -DENABLE_LIBFDK=ON \
  112. -DENABLE_NEW_MPEGTS_OUTPUT=OFF \
  113. -DENABLE_AJA=OFF \
  114. -DCMAKE_BUILD_TYPE=Release ..
  115. make
  116. make install DESTDIR=$PKG
  117. cd ..
  118.  
  119. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  120. cp -a CONTRIBUTING* COPYING INSTALL README* $PKG/usr/doc/$PRGNAM-$VERSION
  121. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  122.  
  123. mkdir -p $PKG/install
  124. cat $CWD/slack-desc > $PKG/install/slack-desc
  125.  
  126. cd $PKG
  127. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
  128.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement