How to use appimage to deploy qt5 application - linux

I'm using appimage http://appimage.org to pack my application in a standalone excutable.
I'm doint this on debian testing lenny.
My application uses a lot of opensource libraries (qt, python pythonqt fftw hdf4/5 gsl netpbm qwt) and everything was ok using Qt4. I can compile my app on debian and create an appdir image that run smoothly on mint (with xfce).
This stopped working when I switch to Qt5.
Now the appimage runs on debian, but not on mint, I get this error:
This application failed to start because it could not find or load the Qt platform plugin "xcb".
Available platform plugins are: eglfs, kms, linuxfb, minimal, minimalegl, offscreen, xcb.
Reinstalling the application may fix this problem.
Aborted
Notice that the messege is non-consistent: firts it says I lack xcb and than it maks as available.
I did copied the plugins directory in my app usr/lib tree.
I have xcb installed on host apt-get install libx11-xcb1
My AppRun file looks like this:
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
cd "${HERE}/usr/"
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${LD_LIBRARY_PATH}"
export PATH="${HERE}/usr/bin:${PATH}"
export QT_PLUGIN_PATH="${HERE}/usr/lib"
exec "${HERE}/usr/bin/Neutrino" "$#"
cd -
What am I missing?

Many Qt5 applications such as Krita, Scribus, and Subsurface are being distributed as AppImages, so it is definitely possible.
Probably you are missing some components that need to be bundled inside the AppImage. Especially, Qt plugins need to be bundled inside the AppImage for it to work.
See here for an example of a Qt5.5 app being packaged as an AppImage.
Note that it is generally recommended to use an old base system such as CentOS 6 for compiling, because the resulting AppImages will be compatible to more distributions rather than just the latest ones.
If you post a link to your project or open an issue on https://github.com/probonopd/AppImages/issues I can possibly give you more detailed directions.

Related

Using KDE frameworks and Qt Creator installed without apt

A similar question has already been asked here Starting with KDE Frameworks 5 and Qt Creator. However, the answer still hasn't clarified my doubts. So here is the problem: on Linux (Ubuntu) there are two ways to install Qt, first is to use apt (sudo apt install qt5-default) and the other one is to download Qt from the official website. Now when you install using the first way Qt is installed by defualt /usr/lib and the second way in the home folder (or in /opt if you ran the installed with administrator privileges).
Now I would like to integrate KDE Frameworks 5 in my project so on the official website it is suggested to use:
sudo apt install framework
And then you can just include that in your project by QT += framework. The problem is I installed Qt using the second way (downloading from the website) and as a result Qt Creator always return Project ERROR: Unknown module(s) in QT: framework. This I believe is because Qt doesn't seem to be aware of the fact that the modules are in /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/ instead it probably looks for them somewhere else.
How do I solve this problem with a permanent solution? I cannot install Qt using apt because I would like to use the latest version which usually in not immediately available in the default repositories.
Ok so after a looking a lot, a solution has been suggested here https://forum.qt.io/topic/104861/how-to-use-kde-frameworks-with-qt-creator/8
Essentially Qt, if not installed through the system's repositories, is unable to find the KF5 modules. In order to fix this you can add a QMAKEPATH environment build variable to your project that tells Qt where it should look for the module, in my case this was in
/usr/lib/x86_64-linux-gnu/qt5

Linux standalone 'installation' of Postgresql

For easy deployment, I'd like to ship an installation of Postgres as part of the application. Is it possible to include an already compiled and runnable version of Postgres that can be launched as process? I was able to do such thing with a Windows and MacOS version, but haven't found anything about Linux on that matter yet. Perhaps someone has tried this before and can share some insights...
You haven't stated what linux OS you're using.
Assuming it's a Redhat variant why not package your application as an RPM package? You could then declare a dependency on the standard Postgres package which would be automatically installed yum. Same principle applies if you're using Debian based systems, just a different packaging format.
From the user's perspective the OS's native packaging format is always the easiest way to install your application. Just requires effort to package it properly.
You can find cross-platform binaries from these pages on PostgreSQL official website:
For easy GUI .run installers, use links provided at http://www.enterprisedb.com/products-services-training/pgdownload.
If your target machine has no X installed on it, or you want to automate installation process with shell scripts, then you can download RPM or Deb packages from http://community.openscg.com/se/postgresql/packages.jsp
I found these links on http://www.postgresql.org/download/linux/ubuntu/, under "Cross distribution packages" and "Graphical installer".
I quote from those pages:
Note: The cross distribution packages do not fully integrate with the platform-specific packaging systems.
You must have root priviliges to install these packages, however, none of your systems library files will be altered. The supporting libraries that these binaries require are included locally as part of the install. This is the "special sauce" that allows identical binaries to run on different linux distro's.

linux, freepascal, fp-ide: No debugger support availble. How to enable debugger?

How to enable debugger in fp-ide? I read somewhere that I should compile fp-ide from sources, but I don't know how to do this. Can someone help me?
Get the generic linux tar installer (fpc-2.6.0.x86_64-linux.tar) for FPC from http://www.freepascal.org/down/x86_64/linux-hungary.var It comes with a precompiled IDE with integrated debugger support and it works fine at least on 12.04 LTS.
I wasn't able to find a PPA for fp-ide, but I can describe how the CLI IDE is compiled on Arch Linux as documented in the repository. Do note that compiling will not enable the debugger in the CLI, as it seems to be an incompatibility between gdb and fp (fp-ide) according to e.g. this bug report in Debian. On Arch Linux, the fpc package also doesn't support the debugger in fp by design (it is explicitly disabled using the NOGDB flag).
Anyhow, here goes the compilation process:
Make sure you have FreePascal installed already, as you need it to compile the IDE
Download the source tarball
Extract the tarball to a location of your convenience and cd into that directory
Execute the following code from within your shell:
pushd fpcsrc/compiler
fpcmake -Tall
popd
make build
make -j1 install
# in Arch, the switch "NOGDB=1" is present in both make lines
That should compile the IDE and install it (you can even try to integrate it in dpkg by using checkinstall instead of make install, but take a look at the Arch PKGBUILD to see an example of what might be needed).
But why do you use the command line IDE fp instead of lazarus? With lazarus you can also make console applications and it offers much more features (e.g. working debug support).

Installing Qt on Linux (Debian distribution)

I have Qt 4.6.3 on Debian. I need version 4.8.1.
To install it I downloaded the Qt SDK 1.2.1 from the Qt site, where is said that it contains version 4.8.1
After installation I checked Qt version and it is 4.6.3 instead of expected 4.8.1.
What I am doing wrong? And how can I install 4.8.1?
First of all I recommend getting 'official' Debian Qt upgrades by adding the testing (wheezy) repo to your package manager, this way everything on your system will be updated seamlessly in a few clicks.
If you can't do this, then:
Use your package manager to uninstall the existing Qt installation (so that's the runtime libs, plugins, and Qt Creator).
Install the SDK anywhere you like, it installs under one folder anyway.
Update your $PATH to point to the directory with qtcreator, qmake, etc., there are numerous ways of doing this, the simplest is exporting the updated $PATH in your .bashrc. (And optionally make some nice shortcuts for your DE).
Create symlinks in /usr/lib (or /usr/lib64) to point to the Qt libraries the SDK provides, or add a qt.conf file containing the path in your /etc/ld.conf.so.d/ directory and run ldconfig as root.
I'm an openSUSE user myself, so some of the above may slightly different on Debian, hopefully someone with Debian experience can chime in if I'm incorrect.

Where is linux-tick-processor on node.js ubuntu native package installation?

I have installed Node.js on an Ubuntu 64bit server using a standard apt-get and would like to profile scripts through the "--prof" flag.
Web searching shows there should be a tool to process the v8.log output located in "deps/v8/tools/linux-tick-processor" but I don't seem to have any of those directories. Do they come with the native install? should they be installed separately? if so how?
Thank you
You need to download the source package with sudo apt-get source nodejs.The path you mentioned is in there.
You'll need to scons prof=on d8 in deps/v8 to build the debugger first, which might have some trouble on a 64-bit machine (v8 is 32-bit only), see here for more info.
Here's how I did it for Node.js 0.10.25 and 0.10.26:
I downloaded the source for Node.js that corresponds to the binaries I'm using. (I'm on Debian testing, which is a bit behind the releases from the Node.js web site.)
I checked the version of v8 bundled in the node sources. (Look at deps/v8/ChangeLog. It was 3.14.5 for Node.js 0.10.25 and 0.10.26.)
I downloaded this exact version of v8 from the v8 site.
Why? I tried running make native in Node.js deps/v8 directory but the Makefile was complaining about a missing test directory. From this we can infer that the Node developers are not including the entire v8 distribution. Once upon a time, with an earlier version of Node (0.8.something) I did build v8 from what was available in deps/v8 but this time I decided to use a different approach.
As explained in v8's build/README.txt, in the top level of the source tree for v8, I did:
$ svn co http://gyp.googlecode.com/svn/trunk build/gyp
(Linking my installed gyp to build/gyp as suggested in OrangeDog's answer did not work. That's why I did the above.)
I ran:
$ CXX=g++-4.7 make native
Why the CXX setting? I ran into a compilation problem right away when I tried with the default gcc. I checked the version. It was 4.8 and I remembered a story on Slashdot about how 4.8 was giving people trouble. So I installed 4.7. Worked fine.
I linked out/native/d8 to a location which is in my PATH. This is because the linux-tick-processor script does a poor job at finding d8. The simplest solution was to make it available in my PATH. Your mileage may vary.
After all this, linux-tick-processor can be used with the v8.log files that Node produces.
Either install the source package - sudo apt-get source nodejs, or switch to the official source as the ubuntu packages are very out of date.
To build d8, go to the deps/v8 directory.
Create a symlink at build/gyp to the directory where gyp can be found (e.g. /usr/bin).
Run make native.
Copy/symlink out/native/d8 to somewhere on your PATH.

Resources