Debian Codegraph @

build/Linux+BSD/portable/x86_64/Recipe

raw symbols SCIP
1 #!/bin/bash
2
3 # This script should be run in an Ubuntu 12.04 "Precise Pangolin" 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 apt-get update # no package lists in Docker image
16
17 # basic dependencies (needed by Docker but provided on Travis)
18 apt-get -y install \
19 git \
20 unzip \
21 libxslt1-dev \
22 libxrender-dev \
23 libxcomposite-dev \
24 libdrm-dev \
25 libgl1-mesa-dev \
26 libopenal1 \
27 gstreamer0.10-plugins-base \
28 software-properties-common # installs `add-apt-repository`
29
30 # get newer compiler
31 if [ ! -f /etc/apt/sources.list.d/ubuntu-toolchain-r-test-precise.list ]; then
32 add-apt-repository -y ppa:ubuntu-toolchain-r/test
33 apt-get update
34 fi
35
36 # MuseScore dependencies (same as on Travis)
37 apt-get -y install \
38 g++-4.9 \
39 wget \
40 make \
41 curl \
42 alsa \
43 libasound2-dev \
44 portaudio19-dev \
45 libportmidi-dev \
46 libsndfile1-dev \
47 zlib1g-dev \
48 libfreetype6-dev \
49 libfontconfig1-dev \
50 lame \
51 libmp3lame-dev \
52 libegl1-mesa-dev \
53 libpulse-dev \
54 libnss3-dev \
55 libxss1 \
56 libnspr4-dev \
57 libxi-dev \
58 libxcursor-dev \
59 libxtst-dev
60
61
62 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
63
64 # get Qt
65 if [ ! -d "qt5" ]; then
66 mkdir qt5
67 wget -q -O qt5.zip https://s3.amazonaws.com/utils.musescore.org/qt593.zip
68 unzip -qq qt5.zip -d qt5
69 rm -f qt5.zip
70 fi
71 export PATH="${PWD}/qt5/bin:$PATH"
72 export QT_PLUGIN_PATH="${PWD}/qt5/plugins"
73 export QML2_IMPORT_PATH="${PWD}/qt5/qml"
74 export LD_LIBRARY_PATH="${PWD}/qt5/lib:$LD_LIBRARY_PATH"
75
76 # install cmake
77 if [ ! -d cmake ]; then
78 if [ "$(arch)" = "i686" ]; then
79 CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-i386.tar.gz"
80 else
81 CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-$(arch).tar.gz"
82 fi
83 mkdir cmake
84 wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
85 fi
86 export PATH="${PWD}/cmake/bin:${PATH}"
87
88 # build AppImageKit
89 if [ ! -d "AppImageKit" ]; then
90 git clone https://github.com/probonopd/AppImageKit.git
91 cd AppImageKit
92 git reset --hard 076a88a57d7ca1a8d77bdbf7d8e92f37eea03dab
93 rm -rf .git*
94 ./build.sh
95 cd ..
96 fi
97
98 # Build MuseScore on Travis but not on Docker Hub (reduce container size)
99 [ -d "MuseScore" ] || exit 0
100
101 ##########################################################################
102 # BUILD MUSESCORE
103 ##########################################################################
104
105 cd MuseScore
106 make revision
107 make "$@" portable
108
109 appdir="$(cat build.release/PREFIX.txt)"
110 appimage="$(echo "$appdir" | sed 's|\.AppDir$|.AppImage|')"
111
112 ##########################################################################
113 # PACKAGE INTO APPIMAGE WITH APPIMAGEKIT
114 ##########################################################################
115
116 cd ../AppImageKit/AppImageAssistant.AppDir
117 chmod u+x /$appdir/bin/QtWebEngineProcess
118
119 ./package "$appdir" "$appimage"
120
121 # allow access to AppImage from outside the chroot
122 chmod a+rwx "$appimage"
123 parent_dir="$(dirname "$appimage")"
124 while [ "$(dirname "$parent_dir")" != "$parent_dir" ]; do
125 [ "$parent_dir" == "/" ] && break
126 chmod a+rwx "$parent_dir"
127 parent_dir="$(dirname "$parent_dir")"
128 done
129
130 ls -lh "$appimage"