build-kdenlive.sh 2.42 KB
Newer Older
1
2
3
4
5
6
7
#!/bin/bash

# Halt on errors and be verbose about what we are doing
set -e
set -x

# Read in our parameters
8
9
export BUILD_PREFIX=$1
export KDENLIVE_SOURCES=$2
10
11
12
13
14
15

# qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment.
# That's not always the case, so make sure it is
export LC_ALL=en_US.UTF-8
export LANG=en_us.UTF-8

16
17
18
19
20
21
22
23
export APPDIR=$BUILD_PREFIX/kdenlive.appdir
export PLUGINS=$APPDIR/usr/lib/plugins/
export APPIMAGEPLUGINS=$APPDIR/usr/plugins/

mkdir -p $APPDIR
mkdir -p $APPDIR/usr/share/kdenlive
mkdir -p $APPDIR/usr/lib

24
# We want to use $prefix/deps/usr/ for all our dependencies
25
export DEPS_INSTALL_PREFIX=$BUILD_PREFIX/kdenlive.appdir/usr/
26
27
export DOWNLOADS_DIR=$BUILD_PREFIX/downloads/

28
29
30
31
32
# Use newer gcc
export CC=/usr/bin/gcc-6
export CXX=/usr/bin/g++-6


33
34
35
36
37
38
39
40
41
42
43
# Setup variables needed to help everything find what we build
export LD_LIBRARY_PATH=$DEPS_INSTALL_PREFIX/lib:$DEPS_INSTALL_PREFIX/openssl/lib:$LD_LIBRARY_PATH
export PATH=$DEPS_INSTALL_PREFIX/bin:$DEPS_INSTALL_PREFIX/openssl/bin:$PATH
export PKG_CONFIG_PATH=$DEPS_INSTALL_PREFIX/share/pkgconfig:$DEPS_INSTALL_PREFIX/lib/pkgconfig:$DEPS_INSTALL_PREFIX/openssl/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH
export CMAKE_PREFIX_PATH=$DEPS_INSTALL_PREFIX:${DEPS_INSTALL_PREFIX}/openssl:$CMAKE_PREFIX_PATH

# Make sure our build directory exists
if [ ! -d $BUILD_PREFIX/kdenlive-build/ ] ; then
    mkdir -p $BUILD_PREFIX/kdenlive-build/
fi

44
45
46
47
48
# Make sure our downloads directory exists
if [ ! -d $DOWNLOADS_DIR ] ; then
    mkdir -p $DOWNLOADS_DIR
fi

49
50
51
# When using git master to build refactoring_timeline:

# Switch to our build directory as we're basically ready to start building...
52
mkdir -p $BUILD_PREFIX/deps-build/
53
54
55
56
57
58
59
60
61
cd $BUILD_PREFIX/deps-build/

mkdir -p $BUILD_PREFIX/kdenlive.appdir/usr

# Configure the dependencies for building
cmake $KDENLIVE_SOURCES/packaging/appimage/3rdparty -DCMAKE_INSTALL_PREFIX=$DEPS_INSTALL_PREFIX -DEXT_INSTALL_DIR=$DEPS_INSTALL_PREFIX -DEXT_DOWNLOAD_DIR=$DOWNLOADS_DIR

cmake --build . --target ext_kdenlive

62
# Now switch to it
63
#cd $BUILD_PREFIX/kdenlive-build/
64
65

# Determine how many CPUs we have
66
#CPU_COUNT=`grep processor /proc/cpuinfo | wc -l`
67
68

# Configure Kdenlive
69
70
71
72
73
#cmake $KDENLIVE_SOURCES \
#    -DCMAKE_INSTALL_PREFIX:PATH=$BUILD_PREFIX/kdenlive.appdir/usr \
#    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
#    -DBUILD_TESTING=FALSE \
#    -DBUILD_TESTS=FALSE
74
75

# Build and Install Kdenlive (ready for the next phase)
76
#make -j$CPU_COUNT install