Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2904 from shoogle/fixed-appimagekit-version
32-bit Docker image, and fixes for 64-bit
- Loading branch information
Showing
3 changed files
with
127 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM toopher/centos-i386:centos6 | ||
ADD Recipe /Recipe | ||
RUN bash -ex Recipe && yum clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/bin/bash | ||
|
||
# This script should be run in a CentOS 6 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}")")/../../../../.." | ||
|
||
yum -y install epel-release | ||
|
||
# basic dependencies (needed by Docker image) | ||
yum -y install git wget which automake unzip | ||
|
||
# get newer compiler than available by default | ||
if [ ! -f "/etc/yum.repos.d/devtools-2.repo" ]; then | ||
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo | ||
yum -y install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils | ||
fi | ||
source /opt/rh/devtoolset-2/enable # enable new compiler | ||
|
||
# build AppImageKit now to avoid conflicts with MuseScore's dependencies (LAME) | ||
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 | ||
|
||
# MuseScore's dependencies: | ||
yum -y install \ | ||
alsa-lib-devel \ | ||
fontconfig-devel \ | ||
freetype-devel \ | ||
jack-audio-connection-kit-devel \ | ||
libsndfile-devel \ | ||
libvorbis-devel \ | ||
libXcomposite-devel \ | ||
libXcursor-devel \ | ||
libXrender-devel \ | ||
libxslt-devel \ | ||
mesa-libGL-devel \ | ||
portaudio-devel \ | ||
pulseaudio-libs-devel | ||
|
||
# get Qt | ||
if [ ! -d "qt5" ]; then | ||
mkdir qt5 | ||
wget -q -O qt5.zip http://utils.musescore.org.s3.amazonaws.com/qt542-x86.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 LAME (get this dependency last because rpmforge and epel-release conflict) | ||
if [ "$(arch)" = "i686" ]; then | ||
nux_url="http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-2.el6.nux.noarch.rpm" | ||
else | ||
nux_url="http://li.nux.ro/download/nux/dextop/el6/$(arch)/nux-dextop-release-0-2.el6.nux.noarch.rpm" | ||
fi | ||
rpm -Uvh "${nux_url}" || true # don't fail if already installed | ||
yum -y install lame-devel | ||
|
||
# install cmake | ||
if [ ! -d cmake ]; then | ||
if [ "$(arch)" = "i686" ]; then | ||
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.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 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters