How to use Qt's 'windeployqt' in Linux / Fedora - qt

I'm currently trying to cross-compile my Qt apps on a Fedora 21 machine to Windows (32 bit, for now). Compilation works without problems, but deployment doesn't. Of cours, I could copy all the necessary files out of the directories, but I think that's a waste of time, so I want to use Qt's 'windeployqt' tool.
But whenever I invoke it, e.g. in Qt Creator as a build step, it just puts out this message(my test application is called day_404 :D) :
Unable to find dependent libraries of /home/marius/Entwicklung/build-day_404-Windows_32bit-Release/release/day_404.exe :Not implemented.
Does any of you know how to fix this, and use windeployqt without using Windows?
Thanks in advance,
Marius

The windeployqt tool doesn't seem to be usable on Fedora 23. It relies on accessing qmake, thus, it doesn't work in the mingw cross-compile environment, where you build with mingw32-qmake-qt5 (or mingw64-qmake-qt5). Even if this issue is patched - it wouldn't work with Qt5 projects using mingw64-cmake.
A relatively simple way to get a list of all DLLs that need to be copied for deployment is to run the application under wine and trace all dll loads.
For example like this:
$ WINEDEBUG=+loaddll wine ./myapp 2> dll.log
The dll paths can be extracted like that:
$ grep Loaded dll.log | grep -v 'system32\|:load_builtin_dll' \
| awk -F'"' '{print $2}' \
| sed -e 's#\\\\#/#g' -e 's/^[A-Z]://' \
| sort > dll.lst
The file dll.lst looks like this for a typical Qt5 project cross-compiled with mingw64:
/path/to/cwd/myapp.exe
/path/to/cwd/project.dll
[..]
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libpng16-16.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libstdc++-6.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libxml2-2.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt5Core.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt5Gui.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt5Widgets.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/zlib1.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qgif.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qico.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qjpeg.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/platforms/qwindows.dll
You can then deploy those files like this:
$ mkdir -p "$deploy_dir"/{imageformats,platforms}
$ for i in imageformats platforms ; do
grep "/plugins/$i" dll.lst | xargs -r cp -t "$deploy_dir"/$i
done
$ grep -v '/plugins/' dll.lst | xargs -r cp -t "$deploy_dir"
Wine Config
For running a cross-compiled binary under wine, the mingw dll directory has to be added to the wine path, e.g. via:
sed 's/^\("PATH".*\)"$/\1;Z:\\\\usr\\\\x86_64-w64-mingw32\\\\sys-root\\\\mingw\\\\bin"/' \
-i $HOME/.wine/system.reg
The file ~/.wine/system.reg is automatically created by wine if it is doesn't exist, yet.
PELDD
You can also use the tool peldd to get a list of all DLLs that a windows binary depends on. The tool runs on Linux, e.g.:
$ peldd myapp.exe -a -p . \
| sed -e 's#^\./#'"$PWD"'/#' -e 's#^\([^/]\)#'"$PWD"'/\1#' \
| sort > dll2.lst
The tool transitively walks all dependencies as compiled into the binaries - but - DLLs that are conditionally loaded at runtime (think dlopen(), think Qt plugin) don't leave traces in the binary headers. In contrast to that: when running under wine, those DLLs are recorded, as well. For our example, this could be:
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libjpeg-62.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qgif.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qico.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qjpeg.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/platforms/qwindows.dll

Related

Symfony2 Api-Platform bin/schema issue

I've just started Api-Platform framework and while executing:
php bin/schema generate-types src/ app/config/schema.yml
I get this:
C:\wamp\www\sf2-api>php bin/schema generate-types src/ app/config/schema.yml
dir=$(d=${0%[/\\]*}; cd "$d"; cd "../vendor/api-platform/schema-generator/bin" &
& pwd)
# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# Cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m $dir);
fi
fi
dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/schema" "$#"
I am using Symfony 2.7.8 on window7.
I have the same issue on ubunbu 14.04.
Finally, I replace the bin directory with the one in blog-api.
Updated:
The bin-api-platform is the one generated by api-platform.
The bin-blog-api is the one I copy from blog-api. This works fine.
Use :
php vendor/api-platform/schema-generator/bin/schema generate-types src/app/config/schema.yml
instead of :
php bin/schema generate-types src/ app/config/schema.yml
The correct syntax is:
php vendor/api-platform/schema-generator/bin/schema generate-types src/ app/config/schema.yml

How can I get the names of the applications that are installed on an application server?

I have an SSH access to my application. Is there any UNIX code that I can use to get the name of the applications installed?
Thanks!
Actually I don't understand when you talk about "my applicattion" or "applications installed" what are you exactly refering.
1) If you want to know what applications are deployed, for example in the application server of your instance, for example Tomcat 7 you can take a look here: List Currently Deployed Applications
2) Or maybe you are looking for SO installed applications.
Depeending on what OS is running may be different. For example for Red Hat Enterprise / Fedora Linux / Suse Linux / Cent OS:
Under Red Hat/Fedora Linux:
$ rpm -qa | grep {package-name}
For example find out package mutt installed or not:
$ rpm -qa | grep mutt
Output:
mutt-1.4.1-10
If you don't get any output ( package name along with version), it means package is not installed at all. You can display list all installed packages with the following command:
$ rpm -qa
$ rpm -qa | less
3) Another useful command is ps command. You can check what is running with the ps command.
Type the following ps command to display all running process:
ps aux | less
Where,
A: select all processes
a: select all processes on a terminal, including those of other users
x: select processes without controlling ttys
Task: see every process on the system
ps -A
ps -e

How to run Alfresco Bundled Installer on Docker?

I am starting to use Docker, and now I would like to use it for running Alfresco instances.
I tried to install Alfresco using the single file installer obtained from:
http://wiki.alfresco.com/wiki/Community_file_list_4.2.e (572Mb)
After inserting the installer file and run the recently created image, I execute:
root#3e8b72d208e4:/root# chmod u+x alfresco.sh
root#3e8b72d208e4:/root# mv alfresco.sh alfresco.bin
root#3e8b72d208e4:/root# ./alfresco.bin
root#3e8b72d208e4:/root#
After 1 second, the ./alfresco.bin process ends with no output. It is supposed to prompt some installer options.
I'm running Docker on Ubuntu 13.10 64 bits with 8Gb in RAM. What would be the right procedure to install Alfresco on a Docker container using the installer?
The problem is that the bitrock installer requires tmpfs which in turn requires extra privileges for the executing the container. Run your container with
docker run -i -t -privileged <image> [<command>]
and execute
mount none /tmp -t tmpfs
within the container.
After that, the installer will run just fine.
Unfortately, things get messy if what you want is building an image from a dockerfile. docker build does not provide the -privileged switch or a RUNP instruction. You might want to have a look at https://github.com/dotcloud/docker/issues/1916 for further discussion.
For getting the docker-compose.yml of the community version. Here's one command that helped me generate the files needed.
docker run -it --rm -v "$PWD:/app" -w "/app" -e XDG_CONFIG_HOME=/app/.yo_config -e npm_config_cache=/app/.cache node:alpine sh -c "npm i -g yo generator-alfresco-docker-installer && yo alfresco-docker-installer"

Can PowerShell (or script) on Windows / Mac / Ubuntu list file / directory structure easily?

Can PowerShell on Windows by itself or using simple shell script, list files and directory this way: (or using Mac OS X or Ubuntu's shell script)
audio
mp3
song1.mp3
some other song.mp3
audio books
7 habits.mp3
video
samples
up.mov
cars.mov
Unix's ls -R or ls -lR can't seem to list it in a tree structure unfortunately.
You can use tree.com for listing like indented like shown above. Note that tree.com only works with the filesystem. If you ever have a need to display structure for other providers like WSMan or RegEdit, you can use the Show-Tree function that comes with the PowerShell Community Extensions.
In Linux, you can use:
ls -R directory | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
or for the current directory:
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
You can put this "small" command in a script: look here
you can use Unix's tree command, or if you are on Windows, the GNU windows tree.
Windows has a tree command:
C:\folder>tree . /F
Folder PATH listing for volume sys
Volume serial number is F275-CBCA
C:\FOLDER.
│ file01.txt
│
├───Sub folder
│ chart-0001.png
│ chart-0002.png
└───────chart-0004.png
The /F parameter is what tells it to show files. You can execute this from Powershell
This is probably what you're looking for:
ls -R | tree
It's not installed by default on Ubuntu. So, to install it:
sudo apt-get install tree

In Unix, how do I find out which executables or processes are using my shared libraries?

How do I find out which executables or processes are using my shared library objects in a Unix environment, specifically the AIX environment. Is there any command for it?
In linux, you would:
for i in /usr/bin /bin /usr/local/bin /sbin /...; do
# edit: bug fix to display which filename has the library
# the egrep component will extract line with your library
# or line with ":::", which contains name of the binary
find /usr/bin -printf '::: %p\n' -exec ldd \{\} \; | egrep 'your lib. name|:::'
done
The ldd package for AIX can be found as described here
To check running processes, you could: lsof | grep 'your library name'. How to obtain lsof for AIX can be found here
Not sure if it will help, but maybe you could lsof.
fuser might be what you want.
In Solaris Open or otherwise:
For example; some of the output supressed...
mybox#myplace02:~$ pldd ``pgrep pidgin
5451: pidgin
/usr/lib/libc/libc_hwcap1.so.1
/usr/lib/libgdk-x11-2.0.so.0.1400.3
/usr/lib/libgdk_pixbuf-2.0.so.0.1400.3
/usr/lib/libglib-2.0.so.0.1800.0
/usr/lib/libgobject-2.0.so.0.1800.0
/usr/lib/libmlib.so.2
/usr/lib/libmlib/libmlib_sse2.so.2
/usr/lib/libgthread-2.0.so.0.1800.0
/lib/libpthread.so.1
/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3
/usr/lib/locale/common/methods_unicode.so.3
/lib/libthread.so.1
/usr/lib/libpurple.so.0.5.1
/lib/libnsl.so.1
/usr/lib/libgtk-x11-2.0.so.0.1400.3

Resources