Skip to content

Commit

Permalink
Merge pull request #2904 from shoogle/fixed-appimagekit-version
Browse files Browse the repository at this point in the history
32-bit Docker image, and fixes for 64-bit
  • Loading branch information
lasconic committed Dec 9, 2016
2 parents d457192 + 26b7361 commit 0d26707
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 8 deletions.
3 changes: 3 additions & 0 deletions build/Linux+BSD/portable/x86_32/Dockerfile
@@ -0,0 +1,3 @@
FROM toopher/centos-i386:centos6
ADD Recipe /Recipe
RUN bash -ex Recipe && yum clean all
117 changes: 117 additions & 0 deletions build/Linux+BSD/portable/x86_32/Recipe
@@ -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"
15 changes: 7 additions & 8 deletions build/travis/job2_AppImage/build.sh
Expand Up @@ -18,8 +18,8 @@ branch="$TRAVIS_BRANCH"
revision="$(echo "$TRAVIS_COMMIT" | cut -c 1-7)"
[ "$revision" ] || revision="$(make revision && cat mscore/revision.h)"

docker_tag="" # default for "latest" tag
[ "$branch" == "master" ] || docker_tag=":$branch"
docker_tag="latest" # Docker terminology for master branch
[ "$branch" == "master" ] || docker_tag="$branch" # other branches use branch name

function rebuild-docker-image() { # $1 is arch (e.g. x86_64)
if [ $(git diff --name-only HEAD HEAD~1 | grep "^build/Linux+BSD/portable/$1") ]; then
Expand Down Expand Up @@ -73,17 +73,16 @@ case "$1" in
--i686 )
shift
# Build MuseScore AppImage inside 32-bit x86 Docker image
docker run -i -v "${PWD}:/MuseScore" toopher/centos-i386:centos6 /bin/bash -c \
"linux32 --32bit i386 /MuseScore/build/Linux+BSD/portable/Recipe $makefile_overrides"
(set +x; DOCKER_TRIGGER="$DOCKER_TRIGGER_X86_32" rebuild-docker-image x86_32)
docker run -i -v "${PWD}:/MuseScore" "$DOCKER_USER/musescore-x86_32:$docker_tag" /bin/bash -c \
"/MuseScore/build/Linux+BSD/portable/x86_32/Recipe $makefile_overrides"
;;


* )
[ "$1" == "--x86_64" ] && shift || true
# Build MuseScore AppImage inside native (64-bit x86) Docker image
DOCKER_TRIGGER=$DOCKER_TRIGGER_X86_64
rebuild-docker-image x86_64
docker run -i -v "${PWD}:/MuseScore" "$DOCKER_USER/MuseScore:$docker_tag" /bin/bash -c \
(set +x; DOCKER_TRIGGER="$DOCKER_TRIGGER_X86_64" rebuild-docker-image x86_64)
docker run -i -v "${PWD}:/MuseScore" "$DOCKER_USER/musescore-x86_64:$docker_tag" /bin/bash -c \
"/MuseScore/build/Linux+BSD/portable/x86_64/Recipe $makefile_overrides"
;;
esac
Expand Down

0 comments on commit 0d26707

Please sign in to comment.