gnash.SlackBuild 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #!/bin/bash
  2. # Slackware build script for gnash
  3. # Copyright 2012-2022 Kyle Guinn <elyk03@gmail.com>
  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. cd $(dirname $0) ; CWD=$(pwd)
  23. PRGNAM=gnash
  24. VERSION=${VERSION:-0.8.11dev_20190130}
  25. SRCVER=${SRCVER:-583ccbc1275c7701dc4843ec12142ff86bb305b4}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. PKGTYPE=${PKGTYPE:-tgz}
  29. if [ -z "$ARCH" ]; then
  30. case "$(uname -m)" in
  31. i?86) ARCH=i586 ;;
  32. arm*) ARCH=arm ;;
  33. *) ARCH=$(uname -m) ;;
  34. esac
  35. fi
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM-$VERSION
  42. OUTPUT=${OUTPUT:-/tmp}
  43. DOCS="AUTHORS COPYING ChangeLog NEWS README* TODO"
  44. if [ "$ARCH" = "i586" ]; then
  45. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  46. LIBDIRSUFFIX=""
  47. elif [ "$ARCH" = "i686" ]; then
  48. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  49. LIBDIRSUFFIX=""
  50. elif [ "$ARCH" = "x86_64" ]; then
  51. SLKCFLAGS="-O2 -fPIC"
  52. LIBDIRSUFFIX="64"
  53. else
  54. SLKCFLAGS="-O2"
  55. LIBDIRSUFFIX=""
  56. fi
  57. # TODO: Test the KPARTS3 plugin with KDE3/Trinity.
  58. if [ "${KPARTS3:-no}" != "no" ]; then
  59. KPARTS3_OPT=""
  60. else
  61. KPARTS3_OPT="--disable-kparts3"
  62. fi
  63. # Set $KPARTS4 to "yes" to enable the KDE4 Konqueror plugin.
  64. if [ "${KPARTS4:-no}" != "no" ]; then
  65. KPARTS4_OPT=" \
  66. --with-kde4-prefix=/usr \
  67. --with-kde4-incl=/usr/include \
  68. --with-kde4-lib=/usr/lib${LIBDIRSUFFIX} \
  69. --with-kde4-plugindir=/usr/lib${LIBDIRSUFFIX}/kde4 \
  70. --with-kde4-servicesdir=/usr/share/kde4/services \
  71. --with-kde4-configdir=/usr/share/config \
  72. --with-kde-appsdatadir=/usr/share/apps/klash"
  73. else
  74. KPARTS4_OPT="--disable-kparts4"
  75. fi
  76. set -e
  77. rm -rf $PKG
  78. mkdir -p $TMP $PKG $OUTPUT
  79. cd $TMP
  80. rm -rf $PRGNAM-$SRCVER
  81. tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
  82. cd $PRGNAM-$SRCVER
  83. chown -R root:root .
  84. chmod -R u+w,go-w,a+rX-st .
  85. # jemalloc(3) wants <jemalloc/jemalloc.h>, not <jemalloc.h>
  86. sed -i 's|jemalloc.h|jemalloc/jemalloc.h|' \
  87. libbase/jemalloc_gnash.c \
  88. configure.ac
  89. # Fix giflib version check for API change
  90. sed -i 's|GIFLIB_MINOR==1|GIFLIB_MINOR>=1|' \
  91. libbase/GnashImageGif.cpp
  92. # Consider using --enable-media=... to disable ffmpeg
  93. # if this isn't sufficient for compatibility with latest ffmpeg
  94. sed -i 's|FF_INPUT_BUFFER_PADDING_SIZE|AV_INPUT_BUFFER_PADDING_SIZE|' \
  95. libmedia/ffmpeg/MediaHandlerFfmpeg.cpp \
  96. libmedia/ffmpeg/MediaParserFfmpeg.cpp
  97. autoreconf -vif
  98. ./configure \
  99. --prefix=/usr \
  100. --libdir=/usr/lib${LIBDIRSUFFIX} \
  101. --sysconfdir=/etc \
  102. --localstatedir=/var \
  103. --mandir=/usr/man \
  104. --infodir=/usr/info \
  105. --docdir=/usr/doc/$PRGNAM-$VERSION \
  106. --build=$ARCH-slackware-linux \
  107. --disable-dependency-tracking \
  108. --enable-python \
  109. --enable-ssh \
  110. --enable-ssl \
  111. --without-gconf \
  112. --with-plugins-install=system \
  113. --disable-npapi \
  114. $KPARTS3_OPT \
  115. $KPARTS4_OPT \
  116. CFLAGS="$SLKCFLAGS" \
  117. CXXFLAGS="$SLKCFLAGS -std=c++14" \
  118. make
  119. make install-strip install-plugins DESTDIR=$PKG
  120. # make install-plugins doesn't strip the plugins.
  121. find $PKG -exec file {} + | grep -e "executable" -e "shared object" | grep ELF \
  122. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  123. find $PKG/usr/lib${LIBDIRSUFFIX} -name '*.la' -delete
  124. find $PKG/etc -type f -exec mv {} {}.new \;
  125. find $PKG/usr/man -type f -exec gzip -9 {} +
  126. mkdir -p $PKG/etc/gconf/schemas
  127. mv $PKG/usr/share/applications/gnash.schemas $PKG/etc/gconf/schemas
  128. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  129. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  130. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  131. mkdir -p $PKG/install
  132. cat $CWD/slack-desc > $PKG/install/slack-desc
  133. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  134. cd $PKG
  135. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE