MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / bld_appimage.sh
1 #!/bin/bash
2
3 # We don't do cross-compiling, so the system we're running on
4 # is the target too. Some extra options have to be passed to
5 # the configure script depending on the target. The configure.ac
6 # file has something for android, but that is an OS, not a hardware
7 # platform
8
9 target=$(uname -m)
10 echo target = $target
11 CONFIG_OPTIONS="--with-single-user --with-booby --enable-static-build" 
12 if [ $target = "aarch64" ] ; then
13 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d"
14 elif [ $target = "armv7l" ] ; then
15 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d --disable-libaom --disable libwebp --without-nv"
16 fi
17 echo configure script options are $CONFIG_OPTIONS
18
19 # this should basically be the same as a static build, but the 
20 # "make install" is followed by the appimage creation. After the
21 # install does its work, the bin directory and subdirectories 
22 # contain the whole application.
23
24 # Build Cinelerra itself.
25 ( ./autogen.sh
26   ./configure $CONFIG_OPTIONS
27   make && make install ) 2>&1 | tee log
28 mv Makefile Makefile.cfg
29 cp Makefile.devel Makefile
30                         
31 rm -rf AppDir           # remove old in case a file gets deleted from the distribution
32 mkdir AppDir            # create lowest level
33 mkdir AppDir/usr
34
35 cp -r bin AppDir/usr/   # copy whole of bin directory
36
37 # Use own version of linuxdeploy, makeappimage, plus plugin makeappimageplugin.
38 # They should be in the subdirectory tools, if not, go to tools/makeappimagetool
39 # and do bld.sh there. That will place the two needed executables in tools, and
40 # then delete all other generated files (except the small log).
41
42 if [ ! -f tools/makeappimage ]; then
43         export cingg=`pwd`
44         cd tools/makeappimagetool
45         ./bld.sh
46         cd $cingg
47 fi
48
49 # We need to specify all executables, so makeappimage can pick up dependencies.
50 # Any executable code in other places is not picked up (yet).
51 # makeappimage will populate the AppDir directory, and then call a platform dependent
52 # appimagetool which must be in the path. The four supported platforms are:
53 # - appimagetool-aarch64.AppImage
54 # - appimagetool-armhf.AppImage
55 # - appimagetool-i686.AppImage
56 # - appimagetool-x86_64.AppImage
57 # Get the appropriate appimagetool from https://github.com/AppImage/AppImageKit/releases
58 # and put it in your path. Only install the version for your platform.
59
60 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
61
62 # There is now an appimage in the cinelerra-5.1 directory.