-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux installer #2932
Closed
Closed
Add Linux installer #2932
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,115 @@ | ||
#!/bin/sh | ||
set -e | ||
BINDIR="$1" | ||
RUNFILE="$2" | ||
[ "$BINDIR" -a "$RUNFILE" ] | ||
|
||
VERSION=@VERSION@ | ||
|
||
cd "$BINDIR" | ||
[ -e CMakeCache.txt ] | ||
|
||
rm -fr installer.root | ||
mkdir installer.root | ||
make install DESTDIR=installer.root | ||
cd installer.root | ||
|
||
if [ ! -e usr/bin/lmms ] | ||
then | ||
mkdir -p usr | ||
mv ./"@CMAKE_INSTALL_PREFIX@"/* usr | ||
rmdir -p --ignore-fail-on-non-empty \ | ||
../installer.root/"@CMAKE_INSTALL_PREFIX@" | ||
fi | ||
|
||
strip usr/bin/lmms usr/lib/lmms/RemoteZynAddSubFx usr/lib/lmms/*.so \ | ||
usr/lib/lmms/ladspa/* | ||
|
||
rm -f ../download.log | ||
|
||
download_and_unpack_packages() | ||
{ | ||
sort -u | | ||
xargs apt-get download | | ||
tee -a ../download.log | ||
|
||
ls *.deb | | ||
while read DEB | ||
do | ||
dpkg-deb -x $DEB . | ||
done | ||
rm *.deb | ||
} | ||
|
||
# Find required libraries and download the deb files that contain them; | ||
# RemoteVstPlugin.exe.so is not considered | ||
ldd usr/bin/lmms usr/lib/lmms/RemoteZynAddSubFx usr/lib/lmms/lib*.so \ | ||
usr/lib/lmms/ladspa/* | | ||
grep = | | ||
cut -d " " -f 3 | | ||
grep -v usr/lib/lmms | | ||
sort -u | | ||
xargs dpkg -S | | ||
cut -d : -f 1 | | ||
download_and_unpack_packages | ||
|
||
# Fetch missing copyright files | ||
PACKAGES=$(find -L usr/share/doc -maxdepth 1 -type l -printf "%l\n") | ||
if [ "$PACKAGES" ] | ||
then | ||
echo "$PACKAGES" | | ||
download_and_unpack_packages | ||
fi | ||
|
||
mv usr/share/applications/lmms.desktop lmms-$VERSION.desktop | ||
sed -e " | ||
/^Name=/ s/LMMS/LMMS $VERSION/ | ||
/^Icon=/ s/lmms/lmms-$VERSION/ | ||
" -i lmms-$VERSION.desktop | ||
|
||
mv usr/share/pixmaps/lmms.png lmms-$VERSION.png | ||
rmdir --ignore-fail-on-non-empty usr/share/pixmaps | ||
|
||
mv usr/share/mime/packages/lmms.xml . | ||
|
||
rm -fr lib64 usr/include usr/share/applications usr/share/doc-base \ | ||
usr/share/lintian usr/share/man usr/share/menu usr/share/mime | ||
|
||
find usr/share/doc -mindepth 2 ! -name copyright -delete | ||
|
||
# Convert RPATH to RUNPATH | ||
find lib usr/lib -type f | | ||
while read FILE | ||
do | ||
if readelf -d "$FILE" 2> /dev/null | grep "(RPATH)" | | ||
grep -v '\[\$ORIGIN\]' > /dev/null | ||
then | ||
chrpath -c "$FILE" | ||
fi | ||
done | ||
|
||
# libc6 is included, so its loader should be used instead of the system one; | ||
# move the loader to usr/bin because of Qt applicationDirPath() usage | ||
MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH) | ||
mv lib/$MULTIARCH/ld-*.so usr/bin/ld.so | ||
|
||
find -type l -execdir \[ ! -e '{}' \] \; -delete | ||
|
||
# FHS requires /opt programs to be in /opt/<package>/bin | ||
mkdir -p bin | ||
|
||
cat > bin/lmms-launcher << EOF | ||
#!/bin/sh | ||
DIR=\$(dirname \$(readlink -f "\$0")) | ||
DIR=\${DIR%/bin} | ||
export LD_LIBRARY_PATH="\$DIR"/lib/$MULTIARCH:"\$DIR"/usr/lib/$MULTIARCH\ | ||
:"\$DIR"/usr/lib/$MULTIARCH/pulseaudio:"\$DIR"/usr/lib | ||
"\$DIR"/usr/bin/ld.so "\$DIR"/usr/bin/lmms "\$@" | ||
EOF | ||
|
||
chmod a+x bin/lmms-launcher | ||
|
||
cp -a ../../cmake/linux/installer . | ||
|
||
cd .. | ||
makeself --xz --complevel 6 installer.root "$RUNFILE" LMMS ./installer $VERSION |
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,19 @@ | ||
#!/bin/sh | ||
set -e | ||
BINDIR="$1" | ||
BUNDLE_FILE="$2" | ||
[ "$BINDIR" -a "$BUNDLE_FILE" ] | ||
|
||
cd "$BINDIR" | ||
[ -e download.log ] | ||
|
||
rm -fr bundled-source | ||
mkdir bundled-source | ||
cd bundled-source | ||
|
||
grep "^Get:" ../download.log | | ||
sed -re "s/.* ([^ ]+) [^ ]+ ([^ ]+) \[.*/\1=\2/" | | ||
xargs apt-get -d source | ||
|
||
cd .. | ||
tar zcf "$BUNDLE_FILE" bundled-source |
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,47 @@ | ||
#!/bin/sh | ||
set -e | ||
[ "$1" ] | ||
|
||
VERSION="$1" | ||
|
||
if [ $(id -u) -eq 0 ] | ||
then | ||
DIR=/opt/lmms-$VERSION | ||
PREFIX=/usr | ||
umask 022 | ||
chmod -R +rX * | ||
else | ||
DIR="$HOME"/.lmms-$VERSION | ||
PREFIX="$HOME"/.local | ||
fi | ||
echo Installing to $DIR | ||
mkdir -p "$DIR" | ||
|
||
rm -fr "$DIR"/bin "$DIR"/etc "$DIR"/lib "$DIR"/usr | ||
mv bin etc lib usr "$DIR" | ||
|
||
sed -e "/^Exec=/ s#lmms#\"$DIR\"/bin/lmms-launcher#" -i lmms-$VERSION.desktop | ||
|
||
ICONDIR="$PREFIX"/share/icons | ||
mkdir -p "$ICONDIR" | ||
mv lmms-$VERSION.png "$ICONDIR" | ||
|
||
MENUDIR="$PREFIX"/share/applications | ||
mkdir -p "$MENUDIR" | ||
mv lmms-$VERSION.desktop "$MENUDIR" | ||
if [ "$(which update-desktop-database)" ] | ||
then | ||
update-desktop-database "$MENUDIR" | ||
fi | ||
|
||
MIMEDIR="$PREFIX"/share/mime/packages | ||
if [ ! \( -e "$MIMEDIR"/lmms.xml -o -e /usr/share/mime/packages/lmms.xml -o \ | ||
-e /usr/local/share/mime/packages/lmms.xml \) ] | ||
then | ||
mkdir -p "$MIMEDIR" | ||
mv lmms.xml "$MIMEDIR" | ||
if [ "$(which update-mime-database)" ] | ||
then | ||
update-mime-database "$PREFIX"/share/mime | ||
fi | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, the
update-desktop-database
command will fail to work with makeself unless you temporarily shim in a more permissive umask.