Debian Codegraph @

build/Linux+BSD/portable/x86_32/Recipe

raw symbols SCIP
1 #!/bin/bash
2
3 # This script should be run in a CentOS 6 Docker image
4
5 set -e # Halt on errors
6 set -x # Be verbose
7
8 ##########################################################################
9 # GET DEPENDENCIES
10 ##########################################################################
11
12 # go one-up from MuseScore root dir regardless of where script was run from:
13 cd "$(dirname "$(readlink -f "${0}")")/../../../../.."
14
15 yum -y install epel-release
16
17 # basic dependencies (needed by Docker image)
18 yum -y install git wget which automake unzip
19
20 # get newer compiler than available by default
21 if [ ! -f "/etc/yum.repos.d/devtools-2.repo" ]; then
22 wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
23 yum -y install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils
24 fi
25 source /opt/rh/devtoolset-2/enable # enable new compiler
26
27 # build AppImageKit now to avoid conflicts with MuseScore's dependencies (LAME)
28 if [ ! -d "AppImageKit" ]; then
29 git clone https://github.com/probonopd/AppImageKit.git
30 cd AppImageKit
31 git reset --hard 076a88a57d7ca1a8d77bdbf7d8e92f37eea03dab
32 rm -rf .git*
33 ./build.sh
34 cd ..
35 fi
36
37 # MuseScore's dependencies:
38 yum -y install \
39 alsa-lib-devel \
40 fontconfig-devel \
41 freetype-devel \
42 jack-audio-connection-kit-devel \
43 libsndfile-devel \
44 libvorbis-devel \
45 libXcomposite-devel \
46 libXcursor-devel \
47 libXrender-devel \
48 libxslt-devel \
49 mesa-libGL-devel \
50 portaudio-devel \
51 portmidi-devel \
52 pulseaudio-libs-devel
53
54 # get Qt
55 if [ ! -d "qt5" ]; then
56 mkdir qt5
57 wget -q -O qt5.zip https://s3.amazonaws.com/utils.musescore.org/qt542-x86.zip
58 unzip -qq qt5.zip -d qt5
59 rm -f qt5.zip
60 fi
61 export PATH="${PWD}/qt5/bin:$PATH"
62 export QT_PLUGIN_PATH="${PWD}/qt5/plugins"
63 export QML2_IMPORT_PATH="${PWD}/qt5/qml"
64 export LD_LIBRARY_PATH="${PWD}/qt5/lib:$LD_LIBRARY_PATH"
65
66 # install LAME (get this dependency last because rpmforge and epel-release conflict)
67 if [ "$(arch)" = "i686" ]; then
68 nux_url="http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-2.el6.nux.noarch.rpm"
69 else
70 nux_url="http://li.nux.ro/download/nux/dextop/el6/$(arch)/nux-dextop-release-0-2.el6.nux.noarch.rpm"
71 fi
72 rpm -Uvh "${nux_url}" || true # don't fail if already installed
73 yum -y install lame-devel
74
75 # install cmake
76 if [ ! -d cmake ]; then
77 if [ "$(arch)" = "i686" ]; then
78 CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-i386.tar.gz"
79 else
80 CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-$(arch).tar.gz"
81 fi
82 mkdir cmake
83 wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
84 fi
85 export PATH="${PWD}/cmake/bin:${PATH}"
86
87 # Build MuseScore on Travis but not on Docker Hub (reduce container size)
88 [ -d "MuseScore" ] || exit 0
89
90 ##########################################################################
91 # BUILD MUSESCORE
92 ##########################################################################
93
94 cd MuseScore
95 make revision
96 make "$@" portable
97
98 appdir="$(cat build.release/PREFIX.txt)"
99 appimage="$(echo "$appdir" | sed 's|\.AppDir$|.AppImage|')"
100
101 ##########################################################################
102 # PACKAGE INTO APPIMAGE WITH APPIMAGEKIT
103 ##########################################################################
104
105 cd ../AppImageKit/AppImageAssistant.AppDir
106 chmod u+x /$appdir/bin/QtWebEngineProcess
107
108 ./package "$appdir" "$appimage"
109
110 # allow access to AppImage from outside the chroot
111 chmod a+rwx "$appimage"
112 parent_dir="$(dirname "$appimage")"
113 while [ "$(dirname "$parent_dir")" != "$parent_dir" ]; do
114 [ "$parent_dir" == "/" ] && break
115 chmod a+rwx "$parent_dir"
116 parent_dir="$(dirname "$parent_dir")"
117 done
118
119 ls -lh "$appimage"