build-dependencies.sh 4.86 KB
Newer Older
1
2
3
4
5
6
7
8
9
#!/bin/bash

# Halt on errors
set -e

# Be verbose
set -x

# Make sure the base dependencies are installed
10
11
12
13
14
15
16
17
#apt-get -y install build-essential perl python git '^libxcb.*-dev' libx11-xcb-dev \
#	libglu1-mesa-dev libxrender-dev libxi-dev flex bison gperf libicu-dev ruby
#apt-get -y install cmake3 wget tar bzip2 xz-utils libtool libfile-which-perl automake gcc-4.8 patch \
#	g++-4.8 zlib1g-dev libglib2.0-dev libc6-dev libeigen3-dev libssl-dev \
#	libcppunit-dev libstdc++-4.8-dev libfreetype6-dev libfontconfig1-dev liblcms2-dev \
#	mesa-common-dev libaio-dev lzma liblzma-dev\
#	libpulse-dev libsox-dev liblist-moreutils-perl libxml-parser-perl \
#	libjack-dev autopoint language-pack-en-base
18

19
#apt-get -y install libpixman-1-dev docbook-xml docbook-xsl libattr1-dev
20

21
# Read in our parameters
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
22
23
export BUILD_PREFIX=$1
export KDENLIVE_SOURCES=$2
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

# 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

# We want to use $prefix/deps/usr/ for all our dependencies
export DEPS_INSTALL_PREFIX=$BUILD_PREFIX/deps/usr
export DOWNLOADS_DIR=$BUILD_PREFIX/downloads

# 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

# A kdenlive build layout looks like this:
# kdenlive/ -- the source directory
# downloads/ -- downloads of the dependencies from files.kde.org
# deps-build/ -- build directory for the dependencies
# deps/ -- the location for the built dependencies
# build/ -- build directory for kdenlive itself
# kdenlive.appdir/ -- install directory for kdenlive and the dependencies

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

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

# The 3rdparty dependency handling in Kdenlive also requires the install directory to be pre-created
if [ ! -d $DEPS_INSTALL_PREFIX ] ; then
    mkdir -p $DEPS_INSTALL_PREFIX
fi

# Switch to our build directory as we're basically ready to start building...
cd $BUILD_PREFIX/deps-build/

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

# Now start building everything we need, in the appropriate order
69

70
71
72
73
74
cmake --build . --target ext_lzma
cmake --build . --target ext_xml
cmake --build . --target ext_gettext
cmake --build . --target ext_xslt
cmake --build . --target ext_png
75
76
77

  # cmake --build . --target ext_jpeg #this causes build failures in Qt 5.10

78
79
80
export CC=/usr/bin/gcc-6
export CXX=/usr/bin/g++-6

81
82
83
84
85
86
87
88
89
90
91
cmake --build . --target ext_qt
cmake --build . --target ext_boost
cmake --build . --target ext_gpgme
cmake --build . --target ext_frameworks
cmake --build . --target ext_libsndfile
cmake --build . --target ext_libsamplerate
cmake --build . --target ext_nasm
cmake --build . --target ext_yasm
cmake --build . --target ext_alsa
cmake --build . --target ext_sdl2

92
cmake --build . --target ext_fftw3
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
93
cmake --build . --target ext_fftw3f
94
95

# ladspa expects fft3w.pc pkgconfig files
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
96
97
cp $DEPS_INSTALL_PREFIX/lib/pkgconfig/fftwf.pc $DEPS_INSTALL_PREFIX/lib/pkgconfig/fftw3f.pc
cp $DEPS_INSTALL_PREFIX/lib/pkgconfig/fftw.pc $DEPS_INSTALL_PREFIX/lib/pkgconfig/fftw3.pc
98

99
100
cmake --build . --target ext_x264
cmake --build . --target ext_x265
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
101
102

# libvpx does not compile with this gcc6 version
103
104
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
105

106
cmake --build . --target ext_libvpx
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
107

108
109
export CC=/usr/bin/gcc-6
export CXX=/usr/bin/g++-6
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
110

111
cmake --build . --target ext_ffmpeg
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
112
113
114
cmake --build . --target ext_sox
cmake --build . --target ext_jack
cmake --build . --target ext_ladspa
115
116
117
118
119
cmake --build . --target ext_cairo
cmake --build . --target ext_harfbuzz
cmake --build . --target ext_pango
cmake --build . --target ext_gdkpixbuf
cmake --build . --target ext_gtk+
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
120
121
122
cmake --build . --target ext_gavl
cmake --build . --target ext_frei0r
cmake --build . --target ext_vidstab
123
cmake --build . --target ext_opencv
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

#export CC=/usr/bin/gcc-6
#export CXX=/usr/bin/g++-6

#cmake --build . --target ext_movit
cmake --build . --target ext_kbookmarks
cmake --build . --target ext_kxmlgui
cmake --build . --target ext_kconfigwidgets
cmake --build . --target ext_knotifyconfig
cmake --build . --target ext_knewstuff
cmake --build . --target ext_kdeclarative
cmake --build . --target ext_breezeicons
cmake --build . --target ext_kcrash
cmake --build . --target ext_breeze
cmake --build . --target ext_ruby