Merge pull request #2491 from ericfont/armcross

cross compile AppImage in debian docker on travis for armhf
This commit is contained in:
Nicolas Froment 2016-03-30 14:23:13 +04:00
commit 86f1e70faf
13 changed files with 520 additions and 65 deletions

View file

@ -11,8 +11,9 @@ env:
matrix:
fast_finish: true
allow_failures:
- env: "JOB=AppImage_64bit"
- env: "JOB=AppImage_32bit"
- env: "JOB=AppImage_x86_64"
- env: "JOB=AppImage_i686"
- env: "JOB=AppImage_armhf"
include:
# 1st parallel build job - debug build on Ubuntu
- env: "JOB=Tests"
@ -54,8 +55,9 @@ matrix:
- "./build/travis/job1_Tests/run_tests.sh"
after_script:
- 'ARTIFACTS_PATHS="$(ls vtest/html | tr "\n" ":")" artifacts upload'
# 2nd parallel build job - portable Linux AppImage 64-bit build on CentOS
- env: "JOB=AppImage_64bit"
# 2nd parallel build job - portable Linux AppImage 64-bit x86 build on CentOS
- env: "JOB=AppImage_x86_64"
addons:
apt:
packages:
@ -65,9 +67,10 @@ matrix:
services:
- docker
script:
- "./build/travis/job2_AppImage/build.sh --upload-branches $APPIMAGE_UPLOAD_BRANCHES"
# 3rd parallel build job - portable Linux AppImage 32-bit build on CentOS
- env: "JOB=AppImage_32bit"
- "[[ $APPIMAGE_BUILD_ARCHS == *x86_64* ]] && ./build/travis/job2_AppImage/build.sh --x86_64 --upload-branches $APPIMAGE_UPLOAD_BRANCHES || true"
# 3rd parallel build job - portable Linux AppImage 32-bit x86 build on CentOS
- env: "JOB=AppImage_i686"
addons:
apt:
packages:
@ -77,7 +80,22 @@ matrix:
services:
- docker
script:
- "./build/travis/job2_AppImage/build.sh --32bit --upload-branches $APPIMAGE_UPLOAD_BRANCHES"
- "[[ $APPIMAGE_BUILD_ARCHS == *i686* ]] && ./build/travis/job2_AppImage/build.sh --i686 --upload-branches $APPIMAGE_UPLOAD_BRANCHES || true"
# 4th parallel build job - portable Linux AppImage armhf build on Debian crosscompiler
- env: "JOB=AppImage_armhf"
addons:
apt:
packages:
- bsdtar
- curl
- zsync
services:
- docker
before_script:
- "sudo ./build/travis/job2_AppImage/set-binfmt-misc.sh"
script:
- "[[ $APPIMAGE_BUILD_ARCHS == *armhf* ]] && ./build/travis/job2_AppImage/build.sh --armhf --upload-branches $APPIMAGE_UPLOAD_BRANCHES || true"
notifications:
recipients:

View file

@ -47,7 +47,7 @@ include (${PROJECT_SOURCE_DIR}/build/FindQt5Transitional.cmake)
#include modules
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build" ${CMAKE_MODULE_PATH})
include (UsePkgConfig1)
include (UsePkgConfig1) #defines MACRO(PKGCONFIG1 _package _minVersion _include_DIR _link_DIR _link_FLAGS _cflags)
include (TargetDoc)
include (FindPulseAudio)
include (GetCompilerVersion)
@ -209,7 +209,7 @@ SET(QT_USE_QTHELP TRUE)
##
##if (APPLE)
## PKGCONFIG (freetype2 2.5.2 FREETYPE_INCLUDE_DIRS FREETYPE_LIBDIR FREETYPE_LIBRARIES FREETYPE_CPP)
## PKGCONFIG1 (freetype2 2.5.2 FREETYPE_INCLUDE_DIRS FREETYPE_LIBDIR FREETYPE_LIBRARIES FREETYPE_CPP)
## if (FREETYPE_INCLUDE_DIRS)
## STRING(REGEX REPLACE "\"" "" FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
## STRING(REGEX REPLACE "\"" "" FREETYPE_LIBDIR ${FREETYPE_LIBDIR})
@ -226,11 +226,11 @@ SET(QT_USE_QTHELP TRUE)
##
if (BUILD_ALSA)
PKGCONFIG (alsa 1.0.0 ALSA_INCDIR ALSA_LIBDIR ALSA_LIB ALSA_CPP )
PKGCONFIG1 (alsa 1.0.0 ALSA_INCDIR ALSA_LIBDIR ALSA_LIB ALSA_CPP )
if (NOT ALSA_INCDIR)
message(SEND_ERROR "Error: ALSA support requested (BUILD_ALSA=${BUILD_ALSA}), but ALSA >= 1.0.0 was not found.")
else (NOT ALSA_INCDIR)
message("ALSA >= 1.0.0 found. ALSA support enabled.")
message("ALSA >= 1.0.0 found. ALSA support enabled. INCDIR ${ALSA_INCDIR}, LIBDIR ${ALSA_LIBDIR}, LIB ${ALSA_LIB}, CPP ${ALSA_CPP}")
set (USE_ALSA 1)
endif (NOT ALSA_INCDIR)
else (BUILD_ALSA)
@ -316,7 +316,7 @@ IF(BUILD_JACK)
ENDIF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
MESSAGE("jack support enabled.")
ELSE(MINGW)
PKGCONFIG(jack ${JACK_MIN_VERSION} JACK_INCDIR JACK_LIBDIR JACK_LIB JACK_CPP)
PKGCONFIG1 (jack ${JACK_MIN_VERSION} JACK_INCDIR JACK_LIBDIR JACK_LIB JACK_CPP)
IF(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} found. jack support enabled.")
SET(USE_JACK 1)
@ -339,9 +339,9 @@ if (BUILD_PORTAUDIO)
set ( USE_PORTAUDIO 1 )
set ( USE_PORTMIDI 1 )
else (MINGW)
PKGCONFIG (portaudio-2.0 19 PORTAUDIO_INCDIR PORTAUDIO_LIBDIR PORTAUDIO_LIB PORTAUDIO_CPP)
PKGCONFIG1 (portaudio-2.0 19 PORTAUDIO_INCDIR PORTAUDIO_LIBDIR PORTAUDIO_LIB PORTAUDIO_CPP)
if (PORTAUDIO_INCDIR)
message(STATUS "Portaudio found. Portaudio support enabled. ${PORTAUDIO_INCDIR} ${PORTAUDIO_LIBDIR} ${PORTAUDIO_LIB}")
message(STATUS "Portaudio found. Portaudio support enabled. INCDIR ${PORTAUDIO_INCDIR}, LIBDIR ${PORTAUDIO_LIBDIR}, LIB ${PORTAUDIO_LIB}")
set ( USE_PORTAUDIO 1 )
else (PORTAUDIO_INCDIR)
message(SEND_ERROR "Error: Portaudio support requested (BUILD_PORTAUDIO=${BUILD_PORTAUDIO}), but portaudio-2.0 Version 19 was not found (package portaudio19-dev)")
@ -363,7 +363,7 @@ if (APPLE)
## libvorbis
##
PKGCONFIG (vorbis 1.3.3 VORBIS_INCDIR VORBIS_LIBDIR VORBIS_LIB VORBIS_CPP)
PKGCONFIG1 (vorbis 1.3.3 VORBIS_INCDIR VORBIS_LIBDIR VORBIS_LIB VORBIS_CPP)
if (VORBIS_INCDIR)
message("libvorbis detected ${VORBIS_INCDIR} ${VORBIS_LIBDIR} ${VORBIS_LIB}")
else (VORBIS_INCDIR)
@ -375,7 +375,7 @@ if (APPLE)
## libogg
##
PKGCONFIG (ogg 1.3.0 OGG_INCDIR OGG_LIBDIR OGG_LIB OGG_CPP)
PKGCONFIG1 (ogg 1.3.0 OGG_INCDIR OGG_LIBDIR OGG_LIB OGG_CPP)
if (OGG_INCDIR)
message("libogg detected ${OGG_INCDIR} ${OGG_LIBDIR} ${OGG_LIB}")
else (OGG_INCDIR)
@ -388,7 +388,7 @@ if (APPLE)
## libsndfile
##
PKGCONFIG (sndfile 1.0.25 SNDFILE_INCDIR SNDFILE_LIBDIR SNDFILE_LIB SNDFILE_CPP)
PKGCONFIG1 (sndfile 1.0.25 SNDFILE_INCDIR SNDFILE_LIBDIR SNDFILE_LIB SNDFILE_CPP)
if (SNDFILE_INCDIR)
message("libsndfile detected ${SNDFILE_INCDIR} ${SNDFILE_LIBDIR} ${SNDFILE_LIB}")
else (SNDFILE_INCDIR)
@ -444,7 +444,9 @@ if (NOT MINGW AND NOT APPLE)
string(TOUPPER "mscore${MSCORE_INSTALL_SUFFIX}" MAN_MSCORE_UPPER) # Command name shown in uppercase in man pages by convention
if (${MSCORE_INSTALL_SUFFIX} MATCHES "portable") # Note: "-portable-anything" would match
# Build portable AppImage as per https://github.com/probonopd/AppImageKit
execute_process(COMMAND arch OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)# get architecture (strip trailing newline)
if (NOT DEFINED ARCH)
execute_process(COMMAND arch OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)# get architecture (strip trailing newline)
endif (NOT DEFINED ARCH)
get_filename_component(PORTABLE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} PATH)# get path (dirname)
get_filename_component(PORTABLE_INSTALL_NAME ${CMAKE_INSTALL_PREFIX} NAME)# strip path (basename)
if (NOT MSCORE_UNSTABLE)

View file

@ -47,6 +47,7 @@ release:
cd build.release; \
export PATH=${BINPATH}; \
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE}" \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DMSCORE_INSTALL_SUFFIX="${SUFFIX}" \
-DMUSESCORE_LABEL="${LABEL}" \

View file

@ -20,16 +20,22 @@ if (PULSEAUDIO_LIBRARIES AND PULSEAUDIO_INCLUDE_DIRS)
else (PULSEAUDIO_LIBRARIES AND PULSEAUDIO_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(libpulse _PULSEAUDIO_INCLUDEDIR _PULSEAUDIO_LIBDIR _PULSEAUDIO_LDFLAGS _PULSEAUDIO_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_PULSEAUDIO libpulse)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(PULSEAUDIO_INCLUDE_DIR
if (DEFINED CMAKE_TOOLCHAIN_FILE)
include (UsePkgConfig)
pkgconfig (libpulse PULSEAUDIO_INCLUDEDIRS PULSEAUDIO_LIBDIR PULSEAUDIO_LDFLAGS PULSEAUDIO_CFLAGS)
set (PULSEAUDIO_LIBRARY "${PULSEAUDIO_LIBDIR}/libpulse.so" )
set (PULSEAUDIO_FOUND TRUE)
else (DEFINED CMAKE_TOOLCHAIN_FILE)
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(libpulse _PULSEAUDIO_INCLUDEDIR _PULSEAUDIO_LIBDIR _PULSEAUDIO_LDFLAGS _PULSEAUDIO_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_PULSEAUDIO libpulse)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(PULSEAUDIO_INCLUDE_DIR
NAMES
pulse/pulseaudio.h
PATHS
@ -38,9 +44,9 @@ else (PULSEAUDIO_LIBRARIES AND PULSEAUDIO_INCLUDE_DIRS)
/usr/local/include
/opt/local/include
/sw/include
)
find_library(PULSEAUDIO_LIBRARY
)
find_library(PULSEAUDIO_LIBRARY
NAMES
pulse
PATHS
@ -49,9 +55,9 @@ else (PULSEAUDIO_LIBRARIES AND PULSEAUDIO_INCLUDE_DIRS)
/usr/local/lib
/opt/local/lib
/sw/lib
)
)
find_library(PULSEAUDIO_SIMPLE_LIBRARY
find_library(PULSEAUDIO_SIMPLE_LIBRARY
NAMES
pulse-simple
PATHS
@ -60,15 +66,16 @@ else (PULSEAUDIO_LIBRARIES AND PULSEAUDIO_INCLUDE_DIRS)
/usr/local/lib
/opt/local/lib
/sw/lib
)
)
if (PULSEAUDIO_LIBRARY)
set(PULSEAUDIO_FOUND TRUE)
endif (PULSEAUDIO_LIBRARY)
if (PULSEAUDIO_LIBRARY)
set(PULSEAUDIO_FOUND TRUE)
endif (PULSEAUDIO_LIBRARY)
set(PULSEAUDIO_INCLUDE_DIRS
set(PULSEAUDIO_INCLUDE_DIRS
${PULSEAUDIO_INCLUDE_DIR}
)
)
endif (DEFINED CMAKE_TOOLCHAIN_FILE)
if (PULSEAUDIO_FOUND)
set(PULSEAUDIO_LIBRARIES
@ -84,7 +91,7 @@ else (PULSEAUDIO_LIBRARIES AND PULSEAUDIO_INCLUDE_DIRS)
if (PULSEAUDIO_FOUND)
if (NOT PULSEAUDIO_FIND_QUIETLY)
message(STATUS "Found pulseaudio: ${PULSEAUDIO_LIBRARY}")
message(STATUS "Found pulseaudio. LIB ${PULSEAUDIO_LIBRARY}, INCLUDE ${PULSEAUDIO_INCLUDEDIRS}, LIBDIR ${PULSEAUDIO_LIBDIR}, LDFLAGS ${PULSEAUDIO_LDFLAGS}, CFLAGS ${PULSEAUDIO_CFLAGS}")
endif (NOT PULSEAUDIO_FIND_QUIETLY)
else (PULSEAUDIO_FOUND)
if (PULSEAUDIO_FIND_REQUIRED)

View file

@ -0,0 +1,7 @@
FROM debian:jessie
ADD https://raw.githubusercontent.com/ericfont/MuseScore/compile-armhf/build/Linux%2BBSD/portable/RecipeDebian /
RUN chmod +x RecipeDebian
RUN ./RecipeDebian --fetch-build-dependencies-only armhf
RUN ./RecipeDebian --fetch-package-dependencies-only armhf

View file

@ -0,0 +1,52 @@
#Cross toolchain file for building QT project (specifically MuseScore)
#For use in Debian x86-64 + armhf with cross compiler
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(ARCH armhf) # AppImage directory's name will include this string
# specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)
SET(ENV{PKG_CONFIG_PATH} /usr/lib/arm-linux-gnueabihf/pkgconfig)
# don't set CMAKE_STRIP, because doing so somehow causes CMakeCache to report nothing for CMAKE_STRIP:FILEPATH
#SET(CMAKE_STRIP /usr/bin/arm-linux-gnueabihf-strip)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf /usr/include/arm-linux-gnueabihf)
SET(CMAKE_LIBRARY_PATH /usr/include/arm-linux-gnueabihf)
# Qt include directories
SET(QT_INCLUDE_DIR /usr/include/arm-linux-gnu)
SET(QT_QT_INCLUDE_DIR ${QT_INCLUDE_DIR}/qt5)
SET(QT_QTCORE_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtCore)
SET(QT_QTXML_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtXml)
SET(QT_QTGUI_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtGui)
SET(QT_QTNETWORK_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtNetwork)
SET(QT_QTUITOOLS_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtUiTools)
SET(QT_QTSCRIPT_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtScript)
SET(QT_QTWEBKIT_INCLUDE_DIR ${QT_QT_INCLUDE_DIR}/QtWebkit)
SET(QT_INCLUDES ${QT_INCLUDE_DIR} ${QT_QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTXML_INCLUDE_DIR} ${QT_GUI_INCLUDE_DIR} ${QT_QTNETWORK_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
# Qt libraries
SET(QT_LIBRARY_DIR ${CMAKE_LIBRARY_PATH})
SET(QT_CROSS_LIBRARIES QtSvg5 QtGui5 QtCore5 QtXml5 QtNetwork5 QtWebKit5 QtXmlPatterns5 QtDeclarative5)
# Qt binaries
SET(QT_BINARY_DIR /usr/lib/arm-linux-gnueabihf/qt5/bin)
SET(QT_MOC_EXECUTABLE ${QT_BINARY_DIR}/moc)
SET(QT_UIC_EXECUTABLE ${QT_BINARY_DIR}/uic)
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake)
SET(QT_RCC_EXECUTABLE ${QT_BINARY_DIR}/rcc)
SET(QT_LRELEASE_EXECUTABLE ${QT_BINARY_DIR}/lrelease)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Audio library include dirs (not usre this is being used)
SET(LAME_INCLUDE_DIR /usr/include/lame)

View file

@ -0,0 +1,18 @@
FROM ericfont/armv7hf-debian-qemu:jessie
RUN [ "cross-build-start" ]
RUN apt-get update
# need to be able to use https for wget
RUN apt-get install ca-certificates wget #git
# get prebuilt AppImageKit
RUN wget https://bintray.com/artifact/download/ericfont/prebuilt-AppImageKit/AppImageKit-5_built-in-armv7hf-jessie.tar.gz
RUN tar -xvzf AppImageKit-5_built-in-armv7hf-jessie.tar.gz
RUN rm AppImageKit-5_built-in-armv7hf-jessie.tar.gz
# add AppImageKit dependencies
RUN apt-get -y install libfuse-dev libglib2.0-dev cmake git libc6-dev binutils fuse python
RUN [ "cross-build-end" ]

View file

@ -0,0 +1,182 @@
#!/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 \
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
./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 "$@"

View file

@ -20,7 +20,9 @@ main() {
getCrossPlatformDependencies
# get linux-specific dependencies, based on which distro is making the AppImage
if [ "$(grep "CentOS release 6" /etc/*release*)" ]; then
if [ "$(grep "Debian GNU/Linux 8 (jessie)" /etc/*release*)" ]; then
building_on_Debian_Jessie # aka "Debian 8"
elif [ "$(grep "CentOS release 6" /etc/*release*)" ]; then
building_on_CentOS_6
else
echo "${0}: Warning: Not running on a supported build system!" >&2
@ -54,9 +56,12 @@ getCrossPlatformDependencies() {
# Qt base dependencies (see "mscore/CMakeLists.txt")
dest_dir="$qt_dest/lib"
#dest_dir="$lib_dest"
copyLib libicudata.so.42 #icudt53.dll # Needed by Ubuntu 12.04
copyLib libicui18n.so.42 #libicuin53.so.5 # Needed by Ubuntu 12.04
copyLib libicuuc.so.42 #libicuuc53.so.5 # Needed by Ubuntu 12.04
#icudata, icui18n, & icuuc have version numbers .52 when build on jessie, .42 on centos.
copyLib libicudata.so #icudt53.dll # Needed by Ubuntu 12.04
copyLib libicui18n.so #libicuin53.so.5 # Needed by Ubuntu 12.04
copyLib libicuuc.so #libicuuc53.so.5 # Needed by Ubuntu 12.04
copyLib libQt5CLucene.so.5
copyLib libQt5Core.so.5
copyLib libQt5Gui.so.5
@ -72,7 +77,7 @@ getCrossPlatformDependencies() {
copyLib libQt5Sensors.so.5
copyLib libQt5Sql.so.5
copyLib libQt5Svg.so.5
copyLib libQt5WebChannel.so.5
#copyLib libQt5WebChannel.so.5 # Not present on Debian, and apparently not needed
copyLib libQt5WebKit.so.5
copyLib libQt5WebKitWidgets.so.5
copyLib libQt5Widgets.so.5
@ -102,6 +107,128 @@ getCrossPlatformDependencies() {
bash -c "qt_prefix='$qt_prefix' qt_dest='$qt_dest' copyQt %%%"
}
########################################################
# copy libs specific if building on Debian 8 "Jessie"
########################################################
building_on_Debian_Jessie() {
dest_dir="$lib_dest"
copyLib libasound.so.2
copyLib libcups.so.2
copyLib libdbus-1.so && mv "$dest_dir/libdbus-1.so" "$dest_dir/libdbus-1.so.3" #renamed to .3 because didn't exist in arm, and don't want x86-64 fallback version
copyLib libEGL.so.1
copyLib libfontconfig.so.1
copyLib libfreetype.so.6
copyLib libGLESv2.so.2
copyLib libglib-2.0.so && mv "$dest_dir/libglib-2.0.so" "$dest_dir/libglib-2.0.so.0" #renamed to .0 cause didn't have
copyLib libgobject-2.0.so.0
copyLib libgstapp-0.10.so.0
copyLib libgstbase-0.10.so.0
copyLib libgstinterfaces-0.10.so.0
copyLib libgstpbutils-0.10.so.0
copyLib libgstreamer-0.10.so.0
copyLib libgstvideo-0.10.so.0
copyLib libharfbuzz.so.0
copyLib libICE.so.6
copyLib liblcms2.so.2
copyLib libogg.so.0
copyLib libSM.so.6
copyLib libsndfile.so.1
copyLib libsqlite3.so.0
copyLib libtiff.so.5
copyLib libvorbis.so.0
copyLib libvorbisfile.so.3
copyLib libwebp.so.5
copyLib libX11-xcb.so.1
copyLib libX11.so.6
copyLib libxcb-icccm.so.4
copyLib libxcb-image.so.0
copyLib libxcb-keysyms.so.1
copyLib libxcb-randr.so.0
copyLib libxcb-render-util.so.0
copyLib libxcb-render.so.0
copyLib libxcb-shape.so.0
copyLib libxcb-shm.so.0
copyLib libxcb-sync.so.1
copyLib libxcb-xfixes.so.0
copyLib libxcb-xkb.so.1
copyLib libxcb.so.1
copyLib libXi.so.6
copyLib libxkbcommon-x11.so.0
copyLib libxkbcommon.so.0
copyLib libxml2.so.2
copyLib libxslt.so.1
#2nd round of dependencies
copyLib libavahi-client.so.3
copyLib libavahi-common.so.3
copyLib libdrm.so.2
copyLib libexpat.so && mv "$dest_dir/libexpat.so" "$dest_dir/libexpat.so.1" #renamed to .1 cause didn't have
copyLib libffi.so.6
copyLib libFLAC.so.8
copyLib libgbm.so.1
copyLib libglapi.so.0
copyLib libgmodule-2.0.so.0
copyLib libgnutls-deb0.so.28
copyLib libgraphite2.so.3
copyLib libgssapi_krb5.so.2
copyLib libgthread-2.0.so.0
copyLib libjbig.so.0
copyLib libjson-c.so && mv "$dest_dir/libjson-c.so" "$dest_dir/libjson-c.so.2" #renamed to .2 cause didn't have
copyLib liborc-0.4.so.0
copyLib libvorbisenc.so.2
copyLib libwayland-client.so.0
copyLib libwayland-server.so.0
copyLib libXau.so.6
copyLib libxcb-dri2.so.0
copyLib libxcb-util.so.0
copyLib libXdmcp.so.6
copyLib libXext.so.6
#3rd round of dependencies
copyLib libasyncns.so.0
copyLib libgmp.so.10
copyLib libhogweed.so.2
copyLib libjack.so.0
copyLib libjpeg.so.62
copyLib libk5crypto.so.3
copyLib libkeyutils.so && mv "$dest_dir/libkeyutils.so" "$dest_dir/libkeyutils.so.1" #renamed to .1 cause didn't have
copyLib libkrb5.so.3
copyLib libkrb5support.so.0
copyLib libmng.so.1
copyLib libnettle.so.4
copyLib libp11-kit.so.0
copyLib libpng12.so.0
copyLib libtasn1.so.6
copyLib libwrap.so.0
copyLib libXtst.so.6
dest_dir="$qt_dest/lib"
copyLib libQt5Concurrent.so.5
copyLib libQt5DBus.so.5
copyLib libQt5Designer.so.5
copyLib libQt5QuickWidgets.so.5
copyLib libQt5Test.so.5
#jessie doesn't seem to have the following, although in sid this is provided by libqt5gui5
#copyLib libQt5XcbQpa.so.5
#copyQt plugins/xcbglintegrations/libqxcb-glx-integration.so # Needed by plugins which open a window
#needed by Arch Linux
dest_dir="$lib_dest"
copyLib libpcre.so.3
# needed if don't have pulseaudio installed (e.g. in a minimal chroot on Android)
copyLib libpulse.so.0
copyLib libpulsecommon-5.0.so
# If AppImage is run with alsa, then will complain:
# "Cannot open shared library /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_pulse.so"
# but cannot seem to figure out how to get the AppImage, so exclude for now, hopefully figure out later.
#dest_dir="$lib_dest/alsa-lib"
#copyLib libasound_module_pcm_pulse.so #can add, but if mscore run without alsa, will complain missing
}
##########################################################################
# LINUX-ONLY DEPENDENCIES (no equivalents in "mscore/CMakeLists.txt")
# These differ depending on the distribution used to build the AppImage.
@ -116,8 +243,6 @@ building_on_CentOS_6() {
copyLib libQt5Concurrent.so.5
copyLib libQt5DBus.so.5
copyLib libQt5Designer.so.5
copyLib libQt5Location.so.5
copyLib libQt5QuickParticles.so.5
copyLib libQt5QuickWidgets.so.5
copyLib libQt5Test.so.5
copyLib libQt5XcbQpa.so.5
@ -135,6 +260,12 @@ building_on_CentOS_6() {
copyLib libpng12.so.0
copyLib libudev.so.0
copyLib liblcms.so.1
# Needed if don't have pulseaudio installed. Ignoring, since only advanced distros
# like Arch, Gentoo, Debian minimal, servers, etc. don't have pulse installed.
#copyLib libpulse.so.0
#copyLib libpulsecommon-8.0.so
#copyLib libasound_module_pcm_pulse.so # found in /usr/lib64/alsa-lib/
}
locateLib() {
@ -145,6 +276,12 @@ locateLib() {
if [ -e "$d/$1" ]; then
echo "$d/$1"
return
else
path="$(ls "$d/$1."* | grep -Em1 "$1.[0-9]+")"
if [ "$path" ]; then
echo "$path"
return
fi
fi
done
# If it wasn't found then search library cache

View file

@ -1,18 +1,18 @@
# - pkg-config module for CMake
#
# Defines the following macros:
# Defines the following macro:
#
# PKGCONFIG(package includedir libdir linkflags cflags)
# PKGCONFIG1(package includedir libdir linkflags cflags)
#
# Calling PKGCONFIG will fill the desired information into the 4 given arguments,
# e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS)
# Calling PKGCONFIG1 will fill the desired information into the 4 given arguments,
# e.g. PKGCONFIG1(libart-2.0 LIBART_INCLUDE_DIR LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS)
# if pkg-config was NOT found or the specified software package doesn't exist, the
# variable will be empty when the function returns, otherwise they will contain the respective information
#
FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin /usr/local/bin )
FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS ${PATH} /usr/bin /usr/local/bin )
MACRO(PKGCONFIG _package _minVersion _include_DIR _link_DIR _link_FLAGS _cflags)
MACRO(PKGCONFIG1 _package _minVersion _include_DIR _link_DIR _link_FLAGS _cflags)
# reset the variables at the beginning
SET(${_include_DIR})
SET(${_link_DIR})
@ -40,6 +40,6 @@ MACRO(PKGCONFIG _package _minVersion _include_DIR _link_DIR _link_FLAGS _cflags)
ENDIF(PKGCONFIG_EXECUTABLE)
ENDMACRO(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags)
ENDMACRO(PKGCONFIG1 _include_DIR _link_DIR _link_FLAGS _cflags)
MARK_AS_ADVANCED(PKGCONFIG_EXECUTABLE)

View file

@ -82,13 +82,19 @@ ARCH="$(basename "$FILE" | sed -r 's|^.*-([^-]*)\.AppImage$|\1|')"
case "${ARCH}" in
x86_64|amd64 )
SYSTEM="${ARCH} (64 bit Intel/AMD)"
SYSTEM="${ARCH} (64-bit Intel/AMD)"
;;
i686|i386|i[345678]86 )
SYSTEM="${ARCH} (32 bit Intel/AMD)"
SYSTEM="${ARCH} (32-bit Intel/AMD)"
;;
*[Aa][Rr][Mm]* )
SYSTEM="${ARCH} (32 bit ARM)"
armel )
SYSTEM="${ARCH} (old 32-bit ARM)"
;;
armhf )
SYSTEM="${ARCH} (new 32-bit ARM)"
;;
aarch64 )
SYSTEM="${ARCH} (64-bit ARM)"
;;
* )
echo "Error: unrecognised architecture '${ARCH}'" >&2

View file

@ -5,7 +5,7 @@
# always be uploaded unless a list of specific branches is passed in. e.g.:
# $ build.sh --upload-branches master my-branch-1 my-branch-2
# Builds will be for the native architecture (64 bit) unless another is
# specified for cross-compiling. (e.g. build.sh --32bit)
# specified for cross-compiling. (e.g. build.sh --i686 or build.sh --armhf)
set -e # exit on error
set -x # echo commands
@ -37,17 +37,35 @@ else
makefile_overrides="" # use Makefile defaults
fi
# Build AppImage. Are we cross-compiling?
# Build AppImage depending on arch specified in $1 if cross-compiling, else default build x86_64
case "$1" in
--32bit )
--armhf )
shift
# Build MuseScore AppImage inside 32-bit Docker image
# build MuseScore inside debian x86-64 multiarch image containing arm cross toolchain and libraries
docker run -i -v "${PWD}:/MuseScore" \
ericfont/musescore:jessie-crosscompile-armhf \
/bin/bash -c \
"/MuseScore/build/Linux+BSD/portable/RecipeDebian --build-only armhf $makefile_overrides"
# then run inside fully emulated arm image for AppImage packing step (which has trouble inside multiarch image)
docker run -i --privileged multiarch/qemu-user-static:register
docker run -i -v "${PWD}:/MuseScore" --privileged \
ericfont/musescore:jessie-packaging-armhf \
/bin/bash -c \
"/MuseScore/build/Linux+BSD/portable/RecipeDebian --package-only armhf"
;;
--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"
;;
* )
[ "$1" == "--64bit" ] && shift || true
# Build MuseScore AppImage inside native (64-bit) Docker image
[ "$1" == "--x86_64" ] && shift || true
# Build MuseScore AppImage inside native (64-bit x86) Docker image
docker run -i -v "${PWD}:/MuseScore" library/centos:6 /bin/bash -c \
"/MuseScore/build/Linux+BSD/portable/Recipe $makefile_overrides"
;;

View file

@ -0,0 +1,7 @@
#!/bin/bash
umount binfmt_misc
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
echo ":arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\
\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\
\xff\xff\xff:/usr/bin/qemu-arm-static:" > /proc/sys/fs/binfmt_misc/register