Skip to content

Commit

Permalink
Merge pull request musescore#2513 from shoogle/appimage-improvements
Browse files Browse the repository at this point in the history
Improve AppImages including fix 104106 use system font settings
  • Loading branch information
lasconic committed Apr 1, 2016
2 parents 6a89acd + 2a62996 commit a65f06b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 40 deletions.
32 changes: 16 additions & 16 deletions build/Linux+BSD/mscore.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
.SH NAME@Variables_substituted_by_CMAKE_on_installation@
mscore@MSCORE_INSTALL_SUFFIX@, musescore@MSCORE_INSTALL_SUFFIX@ \- @MUSESCORE_NAME_VERSION@ sheet music editor.

.SH SYNOPSIS
@BEGIN_section_to_only_appear_in_portable_builds@
@MAN_PORTABLE@.SS Before installation:
@MAN_PORTABLE@.B @PORTABLE_INSTALL_NAME@.AppImage
@MAN_PORTABLE@.B ./@PORTABLE_INSTALL_NAME@.AppImage
@MAN_PORTABLE@.RI [ OPTIONS ]
@MAN_PORTABLE@.RI [ FILE .\|.\|.]

Expand All @@ -47,13 +47,13 @@ musical scores, released under the GNU General Public Licence (GPLv2).
@MAN_PORTABLE@.SS Portable version
@MAN_PORTABLE@This portable version of MuseScore has all of MuseScore's usual features,
@MAN_PORTABLE@but it runs on a wider range of distributions and does not need to be
@MAN_PORTABLE@installed. There is an option to install it if full integration with other
@MAN_PORTABLE@applications and the desktop environment is desired.
@MAN_PORTABLE@installed. There is an option to install it for full integration with other
@MAN_PORTABLE@applications and the desktop environment.
@END_section_to_only_appear_in_portable_builds@

.SS Getting help
This manual documents command line useage of
.BR mscore .
.BR mscore@MSCORE_INSTALL_SUFFIX@ .
For help with the full MuseScore program see:
.RS
.TP
Expand All @@ -66,14 +66,14 @@ For help with the full MuseScore program see:

.SS Further information
.TP
These pages cover the topics in this manual may be more up-to-date:
These pages cover the topics in this manual and may be more up-to-date:

<https://musescore.org/handbook/command-line-options-0>
<https://musescore.org/handbook/revert-factory-settings-0>

.SH OPTIONS
A summary of options is included below. Running
.B mscore
.B mscore@MSCORE_INSTALL_SUFFIX@
without options launches the full MuseScore
program and opens any specified files.

Expand All @@ -85,14 +85,13 @@ program and opens any specified files.
@MAN_PORTABLE@.TP
@MAN_PORTABLE@.B man, manual, manpage
@MAN_PORTABLE@Displays this manual.
@MAN_PORTABLE@If MuseScore is installed the manual can be viewed using the traditional `man
@MAN_PORTABLE@.BR mscore `.
@MAN_PORTABLE@If MuseScore is installed the manual can be viewed using the familiar `man
@MAN_PORTABLE@.BR mscore@MSCORE_INSTALL_SUFFIX@ `.
@MAN_PORTABLE@.TP
@MAN_PORTABLE@.B install [-i] [PREFIX]
@MAN_PORTABLE@.RS
@MAN_PORTABLE@Run this without '-i' or 'PREFIX' specified to fully integrate MuseScore
@MAN_PORTABLE@with the desktop environment (GNOME, KDE, etc) just as if it had been
@MAN_PORTABLE@installed using a package manager. This should:
@MAN_PORTABLE@Run this without '-i' or 'PREFIX' to fully integrate MuseScore
@MAN_PORTABLE@with the desktop environment (GNOME, KDE, etc). This should:
@MAN_PORTABLE@.RS 2
@MAN_PORTABLE@.IP \[bu] 2
@MAN_PORTABLE@Add MuseScore to your Applications Menu or Launcher,
Expand Down Expand Up @@ -123,7 +122,7 @@ program and opens any specified files.
@MAN_PORTABLE@If you installed for all users then it will be removed for all users.
@MAN_PORTABLE@
@MAN_PORTABLE@.TP
@MAN_PORTABLE@.B check-depends [exes-only]
@MAN_PORTABLE@.B check-depends, check-dependencies [exes-only]
@MAN_PORTABLE@System information for developers.
@MAN_PORTABLE@This detects which software libraries needed
@MAN_PORTABLE@by MuseScore are not available from the system
Expand Down Expand Up @@ -166,7 +165,7 @@ Displays all MIDI input on the console
Displays all MIDI output on the console
.TP
.B \-o, --export-to <filename>
Exports the currently opened file to the specified <filename>. The file type depends on the filename extension. This option switches to the "converter" mode and avoids any graphical interface. You can also add a filename before the -o if you want to import and export files from the command line. For example mscore -o "My Score.pdf" "My Score.mscz"
Exports the currently opened file to the specified <filename>. The file type depends on the filename extension. This option switches to the "converter" mode and avoids any graphical interface. You can also add a filename before the -o if you want to import and export files from the command line. For example mscore@MSCORE_INSTALL_SUFFIX@ -o "My Score.pdf" "My Score.mscz"
.TP
.B \-r, --image-resolution <dpi>
Determines the output resolution for the output to "*.png" files in the converter mode. The default resolution is 300 dpi.
Expand Down Expand Up @@ -232,12 +231,13 @@ No method of data rescue can match regular, automated backups.

.SH BUGS
.TP
Issue Tracker:
Please report any bugs via the Issue Tracker:

<https://musescore.org/project/issues>

.TP
Please check if the bug has already been reported.
Please check first to if the bug has already been reported. If you just need
help with something then please use the support forum instead.

.SH AUTHOR
The MuseScore Team.
8 changes: 6 additions & 2 deletions build/Linux+BSD/portable/AppRun.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
[ "${APPIMAGE}" ] || export APPIMAGE="${APPDIR}/AppRun"

libs="${APPDIR}/lib"
export LD_LIBRARY_PATH="${libs}:${libs}/qt5/lib:${LD_LIBRARY_PATH}"
# Setting LD_LIBRARY_PATH won't override AppImage libraries, but advanced users
# can do that with APPIMAGE_LIBRARY_PATH if they really want to.
export LD_LIBRARY_PATH="${APPIMAGE_LIBRARY_PATH}:${libs}:${libs}/qt5/lib:${LD_LIBRARY_PATH}"

export QT_STYLE_OVERRIDE="GTK+" # use system font size

case "$1" in
-h|--help|install|uninstall|remove|man|manual|manpage|check-depends )
-h|--help|install|uninstall|remove|man|manual|manpage|check-depends|check-dependencies )
"${APPDIR}/bin/portable-utils" "$@"
;;
* )
Expand Down
18 changes: 13 additions & 5 deletions build/Linux+BSD/portable/copy-libs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ getCrossPlatformDependencies() {
dest_dir="$qt_dest/lib"
#dest_dir="$lib_dest"

#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
#icudata, icui18n, & icuuc have version numbers (.52 when build on jessie,
#.42 on centos) so moved to cross-platform for the time being.
#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
Expand Down Expand Up @@ -158,6 +159,10 @@ building_on_Debian_Jessie() {
copyLib libxml2.so.2
copyLib libxslt.so.1

copyLib libicudata.so.52 # moved from cross-platform
copyLib libicui18n.so.52 # moved from cross-platform
copyLib libicuuc.so.52 # moved from cross-platform

#2nd round of dependencies
copyLib libavahi-client.so.3
copyLib libavahi-common.so.3
Expand Down Expand Up @@ -254,6 +259,9 @@ building_on_CentOS_6() {
copyLib libjpeg.so.62
copyLib libssl.so.10
copyLib libtiff.so.3
copyLib libicudata.so.42 # moved from cross-platform
copyLib libicui18n.so.42 # moved from cross-platform
copyLib libicuuc.so.42 # moved from cross-platform

# Needed by Fedora 22:
copyLib libmng.so.1
Expand All @@ -277,7 +285,7 @@ locateLib() {
echo "$d/$1"
return
else
path="$(ls "$d/$1."* | grep -Em1 "$1.[0-9]+")"
path="$(ls "$d/$1."* | grep -Em1 "$1.[0-9]+")"
if [ "$path" ]; then
echo "$path"
return
Expand Down
33 changes: 16 additions & 17 deletions build/Linux+BSD/portable/portable-utils.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function main() {
man|manual|manpage )
man "${APPDIR}/share/man/man1/mscore@MSCORE_INSTALL_SUFFIX@.1.gz"
;;
check-depends )
check-depends|check-dependencies )
checkDependencies "$2"
;;
* )
Expand All @@ -42,7 +42,7 @@ Special options for MuseScore Portable AppImage:
install [-i] [PREFIX] Installs resources for desktop integration.
remove, uninstall [PREFIX] Removes resources from desktop environment.
check-depends [exes-only] Displays system information for developers.
Ordinary MuseScore options:
$("${APPDIR}/bin/mscore@MSCORE_INSTALL_SUFFIX@" --help | tail -n +5)
EOF
Expand Down Expand Up @@ -191,7 +191,7 @@ INFORMATION: MuseScore is not in PATH. If you want to run MuseScore from
the command line you will have to type the full file path, like this:
${APPIMAGE}
This does not affect you if you launch MuseScore by clicking on the icon.
EOF
fi
Expand All @@ -213,7 +213,7 @@ function removeResources() {
readYes || return 0
cd "$prefix" && <"${APPDIR}/install_manifest.txt" xargs rm || return 1
rm "$(dirname "${APPIMAGE}")/mscore@MSCORE_INSTALL_SUFFIX@"
rm "$(dirname "${APPIMAGE}")/musescore@MSCORE_INSTALL_SUFFIX@"
rm "$(dirname "${APPIMAGE}")/musescore@MSCORE_INSTALL_SUFFIX@"
<"${APPDIR}/install_manifest.txt" xargs "${APPDIR}/bin/rm-empty-dirs"
updateCache $prefix
echo -ne "Resources removed from ${PWD}.\nRemove MuseScore itself (delete ${APPIMAGE}) [Y/n]?"
Expand All @@ -229,12 +229,12 @@ function checkDependencies() {
cd "${APPDIR}"
find . -executable -type f \! -name "lib*.so*" > "${tmp}/exes.txt"
find . -name "lib*.so*" \! -type l > "${tmp}/libs.txt"

num_exes=$(<"${tmp}/exes.txt" xargs -n1 basename 2>/dev/null | tee "${tmp}/exes2.txt" | wc -l)
num_libs=$(<"${tmp}/libs.txt" xargs -n1 basename 2>/dev/null | tee "${tmp}/libs2.txt" | wc -l)

echo "AppImage contains ${num_exes} executables and ${num_libs} libraries." >&2

if [ "$1" == "exes-only" ]; then
echo "Checking dependencies for executables..." >&2
include_libs=""
Expand All @@ -244,47 +244,46 @@ function checkDependencies() {
include_libs="${tmp}/libs.txt"
num_includes="$((${num_libs}+${num_exes}))"
fi

# Check dependencies against system. See 'checkFile()' function.
export -f checkFile && echo 0 > "${tmp}/.counter"
cat "${tmp}/exes.txt" "${include_libs}" | xargs -n1 -I '%%%' bash -c \
'checkFile "${0}" "${1}" "${2}"' "%%%" "${tmp}" "${num_includes}" \; \
| sort | uniq > "${tmp}/deps.txt"
echo "Processing results." >&2

#grep "=> not found" "${tmp}/deps.txt"

#<"${tmp}/libs.txt" xargs -n1 basename | tee "${tmp}/libs2.txt" | wc -l \
mv "${tmp}/libs2.txt" "${tmp}/libs.txt"
#<"${tmp}/exes.txt" xargs -n1 basename | tee "${tmp}/exes2.txt" | wc -l \
mv "${tmp}/exes2.txt" "${tmp}/exes.txt"

# Have only checked system libraries. Now consider those in package:
<"${tmp}/libs.txt" xargs -n1 -I '%%%' sed -i 's|^%%% => not found$|%%% => package|' "${tmp}/deps.txt"
<"${tmp}/libs.txt" xargs -n1 -I '%%%' sed -i 's|%%%$|%%% => both|' "${tmp}/deps.txt"

# Remaining dependencies must be system:
sed -ri 's/^(.*[^(not found|package|both)])$/\1 => system/' "${tmp}/deps.txt"


# TODO: Might want to ignore some indirect dependencies. E.g. MuseScore depends on libX.so,
# and libX.so depends on libY.so, but MuseScore doesn't need any features from libY.so.

num_package=$(prepResult "${tmp}/deps.txt" ' => package$' "${tmp}/package.txt")
num_system=$(prepResult "${tmp}/deps.txt" ' => system$' "${tmp}/system.txt")
num_both=$(prepResult "${tmp}/deps.txt" ' => both$' "${tmp}/both.txt")
num_neither=$(prepResult "${tmp}/deps.txt" ' => not found$' "${tmp}/neither.txt")

# Any libraries included in package that don't appear in 'deps.txt' **might**
# not actually be needed. Careful: they might be needed by a plugin!
num_extra=$(<"${tmp}/libs.txt" xargs -n1 -I '%%%' sh -c \
"grep -q '%%%' \"${tmp}/deps.txt\" || echo '%%%'" \
| sort -f | tee "${tmp}/extra.txt" | wc -l)

cat <(echo "# Package:" && printVersion && printf "\n# System:\n" && uname -srmo) /etc/*release* \
<(printf "\n# In package only: ${num_package}\n") "${tmp}/package.txt" \
<(printf "\n# System only: ${num_system}\n") "${tmp}/system.txt" \
<(printf "\n# Provided by both: ${num_both}\n") "${tmp}/both.txt" \
<(printf "\n# Provided by neither: ${num_neither}\n") "${tmp}/neither.txt" \
<(printf "\n# Extra: (in package but unlinked. Possibly needed by plugins) ${num_extra}\n") "${tmp}/extra.txt" \
| less

rm -r "${tmp}"
}

Expand Down

0 comments on commit a65f06b

Please sign in to comment.