-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Recipe
executable file
·129 lines (107 loc) · 3.37 KB
/
Recipe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
# This script should be run in an Ubuntu 12.04 "Precise Pangolin" Docker image
set -e # Halt on errors
set -x # Be verbose
##########################################################################
# GET DEPENDENCIES
##########################################################################
# go one-up from MuseScore root dir regardless of where script was run from:
cd "$(dirname "$(readlink -f "${0}")")/../../../../.."
apt-get update # no package lists in Docker image
# basic dependencies (needed by Docker but provided on Travis)
apt-get -y install \
git \
unzip \
libxslt1-dev \
libxrender-dev \
libxcomposite-dev \
libdrm-dev \
libgl1-mesa-dev \
libopenal1 \
gstreamer0.10-plugins-base \
software-properties-common # installs `add-apt-repository`
# get newer compiler
if [ ! -f /etc/apt/sources.list.d/ubuntu-toolchain-r-test-precise.list ]; then
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
fi
# MuseScore dependencies (same as on Travis)
apt-get -y install \
g++-4.9 \
wget \
make \
curl \
alsa \
libasound2-dev \
portaudio19-dev \
libportmidi-dev \
libsndfile1-dev \
zlib1g-dev \
libfreetype6-dev \
libfontconfig1-dev \
lame \
libmp3lame-dev \
libegl1-mesa-dev \
libpulse-dev \
libnss3-dev \
libxss1 \
libnspr4-dev \
libxi-dev \
libxcursor-dev \
libxtst-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
# get Qt
if [ ! -d "qt5" ]; then
mkdir qt5
wget -q -O qt5.zip http://utils.musescore.org.s3.amazonaws.com/qt593.zip
unzip -qq qt5.zip -d qt5
rm -f qt5.zip
fi
export PATH="${PWD}/qt5/bin:$PATH"
export QT_PLUGIN_PATH="${PWD}/qt5/plugins"
export QML2_IMPORT_PATH="${PWD}/qt5/qml"
export LD_LIBRARY_PATH="${PWD}/qt5/lib:$LD_LIBRARY_PATH"
# install cmake
if [ ! -d cmake ]; then
if [ "$(arch)" = "i686" ]; then
CMAKE_URL="http://www.cmake.org/files/v3.10/cmake-3.10.1-Linux-i386.tar.gz"
else
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-$(arch).tar.gz"
fi
mkdir cmake
wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
fi
export PATH="${PWD}/cmake/bin:${PATH}"
# build AppImageKit
if [ ! -d "AppImageKit" ]; then
git clone https://github.com/probonopd/AppImageKit.git
cd AppImageKit
git reset --hard 076a88a57d7ca1a8d77bdbf7d8e92f37eea03dab
rm -rf .git*
./build.sh
cd ..
fi
# Build MuseScore on Travis but not on Docker Hub (reduce container size)
[ -d "MuseScore" ] || exit 0
##########################################################################
# BUILD MUSESCORE
##########################################################################
cd MuseScore
make revision
make "$@" portable
appdir="$(cat build.release/PREFIX.txt)"
appimage="$(echo "$appdir" | sed 's|\.AppDir$|.AppImage|')"
##########################################################################
# PACKAGE INTO APPIMAGE WITH APPIMAGEKIT
##########################################################################
cd ../AppImageKit/AppImageAssistant.AppDir
./package "$appdir" "$appimage"
# allow access to AppImage from outside the chroot
chmod a+rwx "$appimage"
parent_dir="$(dirname "$appimage")"
while [ "$(dirname "$parent_dir")" != "$parent_dir" ]; do
[ "$parent_dir" == "/" ] && break
chmod a+rwx "$parent_dir"
parent_dir="$(dirname "$parent_dir")"
done
ls -lh "$appimage"