upgrade libvpx+lv2, fix dbl tap play bug, add multi nest/unnest clips, add del top...
[goodguy/cinelerra.git] / cinelerra-5.1 / blds / cin.SlackBuild
1 #!/bin/bash -x
2
3 # Slackware build script for cin 5.1
4
5 # Copyright 2017 by WP Morrow (aka goodguy) <cin@lists.cinelerra-gg.org>
6 # All rights reserved.
7 #
8 # Redistribution and use of this script, with or without modification, is
9 # permitted provided that the following conditions are met:
10 #
11 # 1. Redistributions of this script must retain the above copyright
12 #    notice, this list of conditions and the following disclaimer.
13 #
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
15 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25 PRGNAM=cin
26 VERSION="$( date +%Y%m%d )"
27 BUILD=${BUILD:-1}
28 TAG=${TAG:-_cin}
29 GITURL="git://git.cinelerra-gg.org/goodguy/cinelerra.git"
30 SLKBLD=`realpath "$0"`
31
32 if [ -z "$ARCH" ]; then
33   case "$( uname -m )" in
34     i?86) ARCH=i486 ;;
35     arm*) ARCH=arm ;;
36        *) ARCH=$( uname -m ) ;;
37   esac
38 fi
39
40 CWD=$(pwd)
41 TMP=${TMP:-/tmp/SBo}
42 PKG=$TMP/package-$PRGNAM
43 OUTPUT=${OUTPUT:-/tmp}
44
45 if [ "$ARCH" = "i486" ]; then
46   export CFG_VARS='ac_cv_header_xmmintrin_h=no'
47   SLKCFLAGS="-march=i486 -mtune=i686"
48   LIBDIRSUFFIX=""
49 elif [ "$ARCH" = "i686" ]; then
50   SLKCFLAGS="-march=i686 -mtune=i686"
51   LIBDIRSUFFIX=""
52 elif [ "$ARCH" = "x86_64" ]; then
53   SLKCFLAGS=""
54   LIBDIRSUFFIX="64"
55 else
56   SLKCFLAGS=""
57   LIBDIRSUFFIX=""
58 fi
59
60 set -e
61
62 rm -rf $PKG
63 mkdir -p $TMP $PKG $OUTPUT
64 cd $TMP
65 rm -rf $PRGNAM-$VERSION
66 git clone --depth 1 $GITURL $PRGNAM-$VERSION
67 #rsh host tar -C /mnt0 -cf - cinelerra-gg | tar -xf -
68 #mv cinelerra-gg $PRGNAM-$VERSION
69 cd $PRGNAM-$VERSION/cinelerra-5.1
70 chown -R root:root .
71
72 # disable vdpau or ffmpeg won't build on Slackware 14.2
73 export FFMPEG_EXTRA_CFG=" --disable-vdpau"
74
75 # configure the build
76 ./autogen.sh
77
78 # Use ccache for faster rebuilding
79 # TODO: Let ffmpeg compile with ccache
80 export CC="ccache gcc"
81
82 ./configure \
83     --prefix=/usr \
84     --with-exec-name=$PRGNAM \
85     --build=$ARCH-slackware-linux
86
87 make
88 make install DESTDIR=$PKG
89
90 find $PKG -type f | while read f ; do
91   if ! ( file "$f" | grep ELF | grep -q -e "executable" -e "shared object" ); then
92     continue
93   fi
94   echo == "$f"
95   strip --strip-unneeded "$f"
96 done 2> /dev/null || true
97
98 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
99 cat $SLKBLD > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
100
101 mkdir -p $PKG/install
102 cat > $PKG/install/slack-desc <<<"
103        |-----handy-ruler------------------------------------------------------|
104 $PRGNAM: $PRGNAM (GNU/Linux Video/Audio Studio)
105 $PRGNAM: 5.x variant of Cinelerra by WP Morrow (aka goodguy)
106 $PRGNAM:
107 $PRGNAM: Cinelerra is the most  advanced non-linear video editor
108 $PRGNAM: and compositor for Linux.  It does primarily three main
109 $PRGNAM: things:  capturing, compositing, and  editing audio and
110 $PRGNAM: video with sample level accuracy.
111 $PRGNAM:
112 $PRGNAM: Homepage: https://cinelerra-gg.org/"
113 cat > $PKG/install/doinst.sh <<<"
114 if [ -x /usr/bin/update-desktop-database ]; then
115    /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
116 fi"
117
118 # desktop icon data path
119 sed -e "s;^Icon=.*;Icon=/usr/share/pixmaps/$PRGNAM.xpm;" \
120  < image/cin.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
121
122 cd $PKG
123 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}