Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
92eae8f
Initial version
tresf Jul 7, 2017
8dcbd19
Better messaging, rename and move to bulid dir
tresf Jul 7, 2017
5004eb7
Remove newlines
tresf Jul 7, 2017
74db001
Various fixes; untested
tresf Jul 8, 2017
91a000b
linuxdeployqt build inst, hack the .desktop file
tresf Jul 8, 2017
84de8cd
First working copy
tresf Jul 9, 2017
2b7dead
Fix download logic
tresf Jul 9, 2017
0e5ef88
Misc fixes
tresf Jul 9, 2017
62eea51
Remove unecessary command
tresf Jul 9, 2017
9beb316
Make AppRun aware of its parent directory
tresf Jul 9, 2017
0f99d4e
Typo
tresf Jul 9, 2017
040cc3c
Remove unecessary comment
tresf Jul 9, 2017
d4fe98a
Fix zyn linking attempt, misc cleanup
tresf Jul 9, 2017
8bea395
Add AppDir/usr/lib to LD_LIBRARY_PATH too
tresf Jul 9, 2017
62a57ff
Try to fix icon
tresf Jul 10, 2017
31fb899
Misc cleanup
tresf Jul 10, 2017
fc9f0f1
More cleanup
tresf Jul 10, 2017
6141c4d
Fix confusing ordering
tresf Jul 10, 2017
c33c4e5
Fix shellcheck, cosmetic stuff
tresf Jul 11, 2017
bf9d74b
Prevent making image from /usr/local
tresf Jul 11, 2017
eb5e819
Fix mimetype icon, Deb[ug] flags
tresf Jul 11, 2017
803b3a0
Fix menu icon
tresf Jul 11, 2017
8d89fd7
Attempt fix mimetypes
tresf Jul 13, 2017
0da1e6b
Mime work
tresf Jul 13, 2017
b301b04
Attempt to fix Qt58 compilation
tresf Jul 15, 2017
2982940
unset LD_LIBRARY_PATH
tresf Jul 15, 2017
7207675
More C++11/Qt5.8 fixes
tresf Jul 15, 2017
1cf825e
Fix LADSPA on Windows
tresf Jul 15, 2017
cea0622
Clean papu
tresf Jul 15, 2017
45a9c43
Fix VirtualBox crash
tresf Jul 15, 2017
ee7b988
Use weak loading of libjack
tresf Jul 17, 2017
064beb5
Fix weakjack
tresf Jul 17, 2017
dca8f97
Fix download cache logic
tresf Jul 18, 2017
22b88a0
Fix shellcheck warnings
tresf Jul 18, 2017
d923fe6
Merge branch 'stable-1.2' into appimage
tresf Jul 24, 2017
64e04d1
New approach at Zyn and VST linking
tresf Jul 24, 2017
04a42f7
Locate missing wine libs
tresf Jul 24, 2017
350c4d7
Remove wine workaround
tresf Jul 24, 2017
4271498
Handle alternative wine
tresf Jul 24, 2017
7f5a9f6
Clean up wine dependencies
tresf Jul 25, 2017
408a08e
Better wine workaround messaging
tresf Jul 25, 2017
4b4e754
Fix unecessary dirname logic
tresf Jul 21, 2017
752b7fa
Force linuxdeployqt to use cmake's qmake version
tresf Jul 25, 2017
43f9850
Add wine prefix to cmake
tresf Jul 25, 2017
2552305
More wine linking fixes
tresf Jul 25, 2017
208575b
Even more wine fixes
tresf Jul 25, 2017
33647a0
Yet another wine fix
tresf Jul 25, 2017
0fed492
Remove LD_LIBRARY_PATH from launcher
tresf Jul 26, 2017
8241043
Fix Zyn
tresf Jul 26, 2017
4a1ec1b
Prevent linking of .exe.so files
tresf Jul 26, 2017
c5cc585
Use forked linuxdeployqt to avoid libwine.so.1
tresf Jul 27, 2017
2c06b0d
Fix LADSPA linking
tresf Jul 27, 2017
a5ea5e9
Fix shellcheck warnings
tresf Jul 27, 2017
720a637
Consistent cmake message
tresf Jul 28, 2017
762e35b
Switch to appimagetool
tresf Aug 1, 2017
c727d9d
Fix shellcheck
tresf Aug 1, 2017
0382b69
Add stk rawwaves
tresf Aug 3, 2017
8bc9e9d
Add support for HiDPI screens
tresf Sep 20, 2017
a553aac
Revert "Fix weakjack"
tresf Oct 16, 2017
596c776
Revert "Use weak loading of libjack"
tresf Oct 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix shellcheck, cosmetic stuff
  • Loading branch information
tresf committed Jul 11, 2017
commit c33c4e5555e83ebaac8a45a9441e4daa93c8186c
75 changes: 50 additions & 25 deletions cmake/linux/package_linux.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,66 @@

set -e

LINUXDEPLOYQT="$HOME/bin/linuxdeployqt"
VERBOSITY=2 # 3=debug
LOGFILE="@CMAKE_BINARY_DIR@/linuxdeployqt.log"
APPDIR="@CMAKE_BINARY_DIR@/@[email protected]/"
DESKTOPFILE="${APPDIR}usr/share/applications/lmms.desktop"
STRIP=""

# Don't strip for debug builds
if [[ "@CMAKE_BUILD_TYPE@" == *"Debug"* ]]; then
STRIP="-no-strip"
fi

# Console colors
RED="\\x1B[1;31m"
GREEN="\\x1B[1;32m"
YELLOW="\\x1B[1;33m"
PLAIN="\\x1B[0m"

LINUXDEPLOYQT="$HOME/bin/linuxdeployqt"
APPDIR="@CMAKE_BINARY_DIR@/@[email protected]/"
DESKTOPFILE="${APPDIR}usr/share/applications/lmms.desktop"
function error {
echo -e " ${PLAIN}[${RED}error${PLAIN}] ${1}"
return 1
}

mkdir -p "$HOME/bin"
function success {
echo -e " ${PLAIN}[${GREEN}success${PLAIN}] ${1}"
}

function skipped {
echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}"
}

echo -e "\nWriting verbose output to \"${LOGFILE}\""

# Fetch portable linuxdeployqt if cache is older than $DAYSOLD
echo -e "${GREEN}Downloading linuxdeployqt to ${LINUXDEPLOYQT}${PLAIN}..."
echo -e "\nDownloading linuxdeployqt to ${LINUXDEPLOYQT}..."
mkdir -p "$HOME/bin"
DAYSOLD=2
if which linuxdeployqt > /dev/null d2>&1; then
echo " [skipping] The system already provides this utility"
elif ! find "$LINUXDEPLOYQT" -mtime -$DAYSOLD|grep -q "." > /dev/null 2>&1; then
skipped "System already provides this utility"
elif ! find "$LINUXDEPLOYQT" -mtime -$DAYSOLD 2>/dev/null|grep -q "." > /dev/null 2>&1; then
url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-$(uname -p).AppImage"
echo " Couldn't find linuxdeployqt newer than $DAYSOLD days old"
echo " Downloading ($(uname -p)): ${url}"
echo " [.......] Couldn't find linuxdeployqt newer than $DAYSOLD days old"
echo " [.......] Downloading ($(uname -p)): ${url}"
wget "$url" -O "$LINUXDEPLOYQT" -q || (rm "$LINUXDEPLOYQT" && false)
chmod +x "$LINUXDEPLOYQT"
echo " [success]"
success "Downloaded $LINUXDEPLOYQT"
else
echo " [skipping] Downloaded version is less than $DAYSOLD days old"
skipped "$LINUXDEPLOYQT is less than $DAYSOLD days old"
fi

# Make skeleton AppDir

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think this is needed? When you install your build products with make INSTALL_ROOT="$APPDIR" install then they will end up there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is post-install step, so it's irrelevant.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment, why are you doing it when it is irrelevant?

Copy link
Member Author

@tresf tresf Jul 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your comment is irrelevant. You're telling a project how to specify the install target, which is too late when it's a post-install step. We can script the entire thing like we do for Windows, but then it takes away the granularity of developers specifying their own build environment.

We copy the install instead of messing it all up. Ideally, the /usr mandate would be dropped and then we can use whatever folder we want. That's how macdeployqt works for us.

It's really not your place to tell a project, or a user for that matter where to drop an install target. This may make sense for a small project. But (I feel) for large, complex projects, it's presumptuous.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So where would you ideally like to install? The reasonis that (at least for some software), the path specified with DCMAKE_INSTALL_PREFIX ends up in the compiled binaries, which is what I generally want to avoid, hence recommending /usr as the generic prefix. This is not a hard requirement though and you are free to use another prefix.

Copy link
Member Author

@tresf tresf Jul 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where would you ideally like to install

Wherever the user says to, would be the ideal location. For our tutorials, this is usually /home/user/lmms/target, but I often run a second copy from /home/user/Desktop/lmms/target and others may prefer their own place.

DCMAKE_INSTALL_PREFIX ends up in the compiled binaries, which is what I generally want to avoid

This is the part that confuses me... I would expect a relinking tool to be agnostic of the prefix, but to be fair, I've also never written one. :)

echo -e "${GREEN}Creating ${APPDIR}...${PLAIN}"
echo -e "\nCreating ${APPDIR}..."
rm -rf "$APPDIR"
mkdir -p "$APPDIR/usr"
echo " [success]"
success "Created ${APPDIR}"

# Clone install to AppDir

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think this is needed? When you install your build products with make INSTALL_ROOT="$APPDIR" install then they will end up there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a post-install step, so it's irrelevant.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment, why are you doing it when it is irrelevant?

echo -e "${GREEN}Copying @CMAKE_INSTALL_PREFIX@ to ${APPDIR}...${PLAIN}"
echo -e "\nCopying @CMAKE_INSTALL_PREFIX@ to ${APPDIR}..."
cp -R "@CMAKE_INSTALL_PREFIX@/." "$APPDIR/usr"
echo " [success]"
success "${APPDIR}"

# Create a wrapper script which calls the lmms executable
mv "$APPDIR/usr/bin/lmms" "$APPDIR/usr/bin/lmms.real"
Expand All @@ -72,22 +94,25 @@ mv "$VSTLIB" "$VSTBIN"
sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE"

# Bundle both qt and non-qt dependencies into appimage format
echo -e "${GREEN}Bundling dependencies...${PLAIN}"
"$LINUXDEPLOYQT" "$DESKTOPFILE" -executable="$ZYNBIN" -executable="$VSTBIN" -bundle-non-qt-libs
echo " [success]"
echo -e "\nBundling and relinking system dependencies..."
echo -e "#### linuxdeployqt pass 1 ####" > "$LOGFILE"
"$LINUXDEPLOYQT" "$DESKTOPFILE" -executable="$ZYNBIN" -executable="$VSTBIN" -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
success "Bundled and relinked dependencies"

# Move executables back to lib directory
mv "$ZYNBIN" "$ZYNLIB"
mv "$VSTBIN" "$VSTLIB"

# Run a second time to create AppImage
echo -e "${GREEN}Finishing the AppImage...${PLAIN}"
"$LINUXDEPLOYQT" "$DESKTOPFILE" -appimage
echo " [success]"
echo -e "${GREEN}Moving to @APPIMAGE_FILE@...${PLAIN}"
echo -e "\nFinishing the AppImage..."
echo -e "\n\n#### linuxdeployqt pass 2 ####" > "$LOGFILE"
"$LINUXDEPLOYQT" "$DESKTOPFILE" -appimage -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
success "Created .AppImage"

echo -e "\nMoving to @APPIMAGE_FILE@..."
# FIXME
# Per https://github.com/probonopd/linuxdeployqt/issues/146
#shellcheck disable=SC2203
mv *.AppImage "@APPIMAGE_FILE@"
mv ./*.AppImage "@APPIMAGE_FILE@"
success "Created @APPIMAGE_FILE@"

echo -e "${GREEN}Finished${PLAIN}"
echo -e "\nFinished"