File: RecipeDebian

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 219,852 kB
  • sloc: cpp: 291,412; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 246; perl: 82; pascal: 79
file content (184 lines) | stat: -rwxr-xr-x 5,205 bytes parent folder | download | duplicates (5)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#!/bin/bash

# This file is designed to run in debian jessie docker images.

COMMAND=$1
ARCH=$2

main() {

  set -e # Halt on error
  set -x # Be verbose

  shift 2 #need to adjust parameter list so $makefile_overrides start at $1

  case $COMMAND in
    "--fetch-build-dependencies-only")
      fetch-build-dependencies
      ;;
    "--fetch-package-dependencies-only")
      fetch-package-dependencies
      ;;
    "--build-only")
      build "$@"
      ;;
    "--package-only")
      package
      ;;
    *)
      fetch-build-dependencies
      fetch-package-dependencies
      build "$@"
      package
  esac

  echo 'RecipeDebianCross completed'
}

#################################################################################
# Fetch compile-time dependencies only
##################################################################################
fetch-build-dependencies() {
  echo "fetching dependencies for arm arch: $ARCH"

  # get cross compiler toolchain
  apt-key adv --fetch-keys http://emdebian.org/tools/debian/emdebian-toolchain-archive.key
  echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.list.d/crosstools.list

  # allow to download $ARCH-specific packages
  dpkg --add-architecture $ARCH

  apt-get clean && apt-get update && apt-get install -y \
    libsndfile1-dev:$ARCH \
    libasound2-dev:$ARCH \
    portaudio19-dev:$ARCH \
    libportmidi-dev:$ARCH \
    zlib1g-dev:$ARCH \
    libfreetype6-dev:$ARCH \
    libmp3lame-dev:$ARCH \
    libssl-dev:$ARCH \
    libdrm-dev:$ARCH \
    libgl1-mesa-dev:$ARCH \
    libpulse-dev:$ARCH \
    qtbase5-dev:$ARCH \
    qttools5-dev:$ARCH \
    qtscript5-dev:$ARCH \
    libqt5xmlpatterns5-dev:$ARCH \
    libqt5svg5-dev:$ARCH \
    libqt5webkit5-dev:$ARCH \
    qttools5-dev-tools:$ARCH \
    cross-gcc-dev \
    binutils-arm-linux-gnueabihf \
    crossbuild-essential-armhf \
    qemu-user-static \
    cmake \
    git

  # forcibly install because will break aptitude dependency rules 
  force-install qtbase5-dev-tools $ARCH
}

###################################################################################
# Fetch run-time dependencies only...to be run after fetching compile dependencies
###################################################################################
fetch-package-dependencies() {
  echo "fetching AppImage packaging + runtime dependencies for arch: $ARCH"

  force-install \
    alsa-base any \
    alsa-tools $ARCH \
    alsa-utils $ARCH \
    libasound2-plugins $ARCH \
    pulseaudio $ARCH \
    pkg-config $ARCH \
    liblcms2-2 $ARCH \
    libmng1 $ARCH \
    libicu52 $ARCH \
    qtquick1-5-dev $ARCH \
    libqt5quickwidgets5 $ARCH \
    libqt5gui5 $ARCH \
    libqt5multimedia5 $ARCH \
    libqt5multimediawidgets5 $ARCH \
    libqt5positioning5 $ARCH \
    libqt5sensors5 $ARCH \
    libqt5webkit5 $ARCH \
    libpulse0 $ARCH \
    libjson-c-dev $ARCH \
    libexpat1-dev $ARCH \
    libdbus-1-3 $ARCH \
    libglib2.0-0 $ARCH \
    libkeyutils-dev $ARCH \
    libwrap0 $ARCH \
    libacl1 $ARCH \
    libreadline6 $ARCH \
    libbz2-1.0 $ARCH \
    libpcre3 $ARCH \
    qml-module-qtquick-controls $ARCH \
    qml-module-qtquick-dialogs $ARCH \
    qml-module-qtquick-layouts $ARCH \
    qml-module-qtquick2 $ARCH \
    qml-module-qtqml-models2 $ARCH \
    qt5-image-formats-plugins $ARCH \
    libwrap0 $ARCH 
}

########################################################
# BUILD MuseScore PORTABLE (Compile, not package)
########################################################
build() {
  echo "building MuseScore Portable for arch: $ARCH"

  cd MuseScore

  make revision

  if [ "$ARCH" == "armhf" ]; then
    LIBARM="/lib/arm-linux-gnueabihf" # might generalize in future to support other archs
    CMAKE_TOOLCHAIN_FILE="/MuseScore/build/Linux+BSD/portable/ARM/jessie-crosscompile-armhf.cmake" \
    LD_LIBRARY_PATH="/usr$LIBARM:/usr$LIBARM/alsa-lib:/usr$LIBARM/pulseaudio:$LIBARM" \
    make "$@" portable
  else
    echo "This bash script only supports armhf cross at the moment"
  fi
}


##########################################################################
# PACKAGE INTO APPIMAGE WITH APPIMAGEKIT
##########################################################################
package() {
  echo 'packaging'

  appdir="$(cat MuseScore/build.release/PREFIX.txt)"
  appimage="$(echo "$appdir" | sed 's|\.AppDir$|.AppImage|')"

  cd AppImageKit-5/AppImageAssistant.AppDir
  chmod u+x /$appdir/bin/QtWebEngineProcess 

  ./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"

}

########################################################################
# helper function needed for forcibly installing packages
# which would break aptitude's dependency requirements
########################################################################
force-install() {
  while (($#)); do
    apt-get download $1:$2 && dpkg --force-all -i $1*
    shift 2
  done
}

main "$@"