How can I know which Debian libraries Electron needs to run? - linux

What I'm doing
I'm building an Electron-based kiosk app using Balena to run on a Raspberry Pi 4. Balena requires a Dockerfile to build the container that will run my app. In that Dockerfile, I must make sure I install all the libraries needed by Electron. The image I'm using is based on Debian Buster (the default image Balena uses).
What I know
I've found two working examples in GitHub similar to what I'm trying to do where I can see which libraries are installed:
https://github.com/Ciantic/balena-electron-example (list of installed libraries)
https://github.com/balena-io/balena-electronjs (list of installed libraries)
And also two files inside the Electron repo that mention required libraries:
https://github.com/electron/electron/blob/77049545050673949b2844f17b3731196947956a/build/install-build-deps.sh#L189-L231
https://github.com/electron/electron/blob/d5ab63b1ead93dcb4e3099fccd4670fe9258ca9c/docs/development/build-instructions-linux.md
What's confusing me
Each list of libraries in the above files is different from the others. I don't know which one I should follow. Also, the build instructions for Linux don't have any list specific for Debian.
My question
How can I know for sure exactly which libraries I need to install in my Debian-based container so that Electron can run?

In the example, it should show a Dockerfile that you can use to get the required libraries.

Related

Installing SDL2 Development version on Ubuntu Linux

I am trying to install SDL2 on Linux Ubuntu 18.04. However there are 2 types of packages available on the repository, the 'normal' library version and the development files version.
libsdl2-2.0-0/bionic-updates,bionic-security 2.0.8+dfsg1-1ubuntu1.18.04.4 amd64
Simple DirectMedia Layer
libsdl2-dev/bionic-updates,bionic-security 2.0.8+dfsg1-1ubuntu1.18.04.4 amd64
Simple DirectMedia Layer development files
What I am asking is are there differences between the two version for developing application/game using SDL2 and which one should I install if I am just starting to learn SDL2?
Ubuntu (and other Linux distributions) often divide up packages this way: the first package contains libraries and executables needed to run something compiled with the package (SDL2 in this case), the dev packages contains the headers, additional libraries or config files needed to compile a program with package. You want to install both; normally installing the dev version of the package will pull in the other as a dependency.
You will need both, most likely :)
The lib package contains the binary SDL library. That's needed to run a program.
But in order to develop an application, you need the C header files to include in your source code - assuming that you want to create a program in C or C++. The compiler needs these files to 'see' the functions provided by the lib.
If you want to use SDL library in a different way, you could also use python and python-pygame-sdl2.

How to use appimage to deploy qt5 application

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.

Using container for Linux applications?

I am experimenting with multiple versions of QEMU.
This involves downloading different versions and variants of source code, and running the usual: configure, make and make install.
The problem is I can't install multiple versions simultaneously because they use the same install script. I need to uninstall (make uninstall) before I install another one. This only works if I have kept the makefile of the installed binaries.
I think what I would like to do is something similar to Python's virtualenv. A standalone Linux user(?) environment for each application that I can easily remove.
Is there such a thing? Or is my approach completely flawed?
I think the best approach for such cases is docker container. Docker is a container-based virtualization technology, In which you can build your customized Linux-based environment and host your application inside it. thereafter, that means, you have containerized your application and its ready to be distributed and run easily.

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.

Port a debian package to YUM for CentOS

I have a project that runs on Debian and uses many packages provided from the Debian repositories.
Because of demand, I've looked into porting the project to CentOS, but found that many of the packages I require are completely missing - at least 10 dependencies would have to be compiled manually at install time on the users machine.
My question is, what is the best way to create an installer for the user's machine? Should I use automake tools (with the standard ./configure, make, make install), to compile the required libraries, or is this a non-standard approach. Note that my app doesn't actually need to be compiled since it is written in Python, so is it weird to do a "make", when you're not compiling your own app?
Should the configure script just warn the user that package X is missing, and let them handle the rest?
Should I roll my own dependency checker by runng pkg-config manually a few times for each library required, and exit if something is missing?
I'm quite new to this, so any tips to get me moving in the right direction are appreciated.
Edit: I am familiar with RPM and yum for red hat base distros, but CentOS is missing many multimedia packages that I require. An example of one of my package dependencies is "liquidsoap" which is a programmable audio engine: http://savonet.sourceforge.net/
This is available on Debian, but not Redhat/Centos
See this link on CentOS package management.
http://wiki.centos.org/PackageManagement/Yum
CentOS is redhat based and does not use .deb packages by default. However apt package management has been ported to tons of platforms, you may be able to use a port for centOS
If you use YUM whatever packages you need will be there for your application as redhat distros need all the same things that any other distro does.
EDIT: To get the details out of comments
Packages not available on the target platform either have to be built (possibly as a port) on the target platform and then shipped in the ported package (in this case YUM), or code needs to be modified and forked to use packages which already are available on the target platform. The choice depends on which is worse, or which is even possible given your constraints.

Resources