Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / bld_appimage.sh
1 #!/bin/bash
2
3 # Build Cinelerra-GG as AppImage.
4 # This follows four steps:
5 # - Build static version of Cinelerra-GG.
6 # - If desired and needed, build the manual for context-sensitive help.
7 # - Organize code and manual in a AppImage specific format AppDir. Do
8 #   this with tool makeappimage, which is built if needed.
9 # - Call an external tool to make the AppDuir into an AppImage
10
11 # We don't do cross-compiling, so the system we're running on
12 # is the target too. Some extra options have to be passed to
13 # the configure script depending on the target. The configure.ac
14 # file has something for android, but that is an OS, not a hardware
15 # platform
16
17 target=$(uname -m)
18 echo target = $target
19 CONFIG_OPTIONS="--with-single-user --with-booby --enable-static-build" 
20 if [ $target = "aarch64" ] ; then
21 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d"
22 elif [ $target = "armv7l" ] ; then
23 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d --disable-libaom --disable libwebp --without-nv"
24 fi
25 echo configure script options are $CONFIG_OPTIONS
26
27 # Build Cinelerra itself.
28 ( ./autogen.sh
29   ./configure $CONFIG_OPTIONS
30   make && make install ) 2>&1 | tee log
31 mv Makefile Makefile.cfg
32 cp Makefile.devel Makefile
33
34 # To include the context-sensitive help, specify the directory
35 # where the manual source is. This script will then call the "translate"
36 # script there to build the manual, and copy it to the proper place
37 # before the AppImage is built.
38
39 CINGG_DIRECTORY=$(pwd)
40 MANUAL_DIRECTORY=$(pwd)/../../cin-manual-latex
41
42 # Build the manual if the directory is specified and exists, and copy it
43 # to CinGG
44 if [ -d "$MANUAL_DIRECTORY" ]; then
45   pushd $MANUAL_DIRECTORY
46   # run the build in a subshell so if some error causes an exit
47   # the popd will still work.
48   (./translate_manual) 2>&1 | tee $CINGG_DIRECTORY/manual.log
49   popd
50   rm -rf bin/doc/CinelerraGG_Manual
51   cp -r $MANUAL_DIRECTORY/CinelerraGG_Manual bin/doc/
52 fi
53
54 rm -rf AppDir           # remove old in case a file gets deleted from the distribution
55 mkdir AppDir            # create lowest level
56 mkdir AppDir/usr
57
58 cp -r bin AppDir/usr/   # copy whole of bin directory
59
60 # Use own version of linuxdeploy, makeappimage. This should be in
61 # subdirectory tools, if not, go to tools/makeappimagetool and do bld.sh
62 # there. That will place the makeappimage executable in tools, and
63 # then delete all other generated files (except the small log). The tools
64 # directory is not cleared with "make clean" or "autogen.sh clean"
65
66 if [ ! -f tools/makeappimage ]; then
67         export cingg=`pwd`
68         cd tools/makeappimagetool
69         ./bld.sh
70         cd $cingg
71 fi
72
73 # We need to specify all executables, so makeappimage can pick up dependencies.
74 # Any executable code in other places is not picked up (yet).
75 # makeappimage will populate the AppDir directory, and then call a platform dependent
76 # appimagetool which must be in the path. The four supported platforms are:
77 # - appimagetool-aarch64.AppImage
78 # - appimagetool-armhf.AppImage
79 # - appimagetool-i686.AppImage
80 # - appimagetool-x86_64.AppImage
81 # Get the appropriate appimagetool from https://github.com/AppImage/AppImageKit/releases
82 # and put it in your path. Only install the version for your platform
83 # and mark it executable. The file name must start with "appimagetool".
84
85 tools/makeappimage --appdir=AppDir -d image/cin.desktop -i image/cin.svg -e bin/cin -e bin/mpeg2enc -e bin/mplex -e bin/hveg2enc -e bin/lv2ui -e bin/bdwrite -e bin/zmpeg3toc -e bin/zmpeg3show -e bin/zmpeg3cat -e bin/zmpeg3ifochk -e bin/zmpeg3cc2txt -e bin/mplexlo 2>&1 | tee appimage.log
86
87 # There is now an appimage in the cinelerra-5.1 directory.