How does ncurses search for terminal descriptions - ncurses

I'm building ncurses 6.1 from source for some reasons. First I configure the sources with
./configure
and then I build it with
make
both without arguments. When I try to run tests I get the error message
Error opening terminal: xterm-256color.
on my local system (Ubuntu 17.10) and
Error opening terminal: xterm
on the build server (Jenkins Docker container).
I found out that this build is looking for terminal descriptions in /usr/share/terminfo/. There are many descriptions but no xterm-256color on my local system. On the build server the folder /usr/share/terminfo/ is empty. I found xterm-256color and xterm at /lib/terminfo. When I install ncurses with package manager (apt for Ubuntu 17.10), it works. So I assume that this package chooses the right path. I copied xterm-256color resp. xterm from /lib/terminfo to /usr/share/terminfo/ and my build works on both systems now. Why do two different paths exist and why do these two versions of ncurses choose two different paths? I need a conan package of ncurses that works out of the box without copying description files.
This could be a duplicate of:
How to set custom search paths for the terminfo database when building ncurses from source

The answer is in the summary at the end of configure (which isn't shown in the question). But running infocmp -D will show the directories that infocmp would use when looking for descriptions.
You can modify the behavior using the TERMINFO and TERMINFO_DIRS environment variables.
The /lib/terminfo is Debian-specific (Ubuntu doesn't provide any changes for ncurses; they simply recompile the Debian packages: most Ubuntu bug reports for ncurses deal with their problems in doing that).
Debian by default installs someone's notion of a minimal terminal database in that directory. Install ncurses-term to get a full terminal database.
By the way, compiling and installing ncurses on Debian/Ubuntu/other systems with ncurses already installed runs a risk of breaking the existing libraries which are used (for example) by bash and other utilities that you probably need.

Related

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.

Golang cross-compilation: gccgo - unrecognized command line option `-marm`

I'm trying to compile a Go app for linux/arm and keep running into problems on my Ubuntu machine. When I run GOOS=linux GOARCH=arm go build in my source directory, I get tons of erorrs that are variations of:
# github.com/huin/mqtt
gccgo: error: unrecognized command line option `-marm`
Running gccgo --help informs me that options starting with -g, -f -m (and others) will be passed on to any sub-processes started by gccgo, so I don't know which process it's sending -marm to.
Any clues? Ubuntu 14.10 LTS, 64bit
So thanks to a clue by Dean, I've worked out the issue and solved it.
The issue was caused by me installing Go via apt-get, then removing it (via apt-get), then installing Go from the golang website. There were still files left over from the first install, which were probably older versions and therefore didn't have support for the -marm flag.
I was going to wipe my dev machine anyway, so I did, installed Ubuntu again, installed Go from the website (not via apt-get) and everything worked first time. If you don't want to wipe your machine, then just make sure to look around to see if there are version conflicts.
I've been stung by this sort of thing before (when installing node.js via apt-get, realising it was many versions out of date, then removing, and installing node.js via source), so if anyone is reading this, be careful when installing software via apt-get, then upgrading, as you might have similar version issues like I did!

Cygwin - Installing a specific package version using the commandline installer

Using the commandline installer, one can easily install Cygwin with a list of wanted packages like so
setup-x86.exe -q -p='tar,sed,<more packages>'
Is it also possible to fix the version of the packages, something like
setup-x86.exe -q -p='tar:1.2.3,sed,<more packages>'
(this obviously doesn't work)?
The short answer to your query is, No. Cygwin's setup -x86.exe does not give you the flexibility to specify version names along with package names. As per the official doc :
The basic reason for not having a more full-featured package manager is that such a program would need full access to all of Cygwin's POSIX functionality. That is, however, difficult to provide in a Cygwin-free environment, such as exists on first installation. Additionally, Windows does not easily allow overwriting of in-use executables so installing a new version of the Cygwin DLL while a package manager is using the DLL is problematic
There are however a couple of workarounds if you want to download a specific package:
Locate a cygwin mirror that hosts the specific version. Google for your version, and if you find a mirror hosting that version, simply use that mirror before running setup -x86.exe. [source]
Maintain a local pacakge repository and use the commandline options -q -L -l x:\cygwin-local\, where your downloaded package tree is in x:\cygwin-local\ [source] . You can learn how to build and maitain packages here
Compile and install the package after you've set up cygwin using make.
This is function that Cygwin's installer now provides. By default, when running from the command line, it will install the latest version of each package, but you can specify a version with =. For example:
setup-x86_64.exe -P git=2.35.0-1,vim
will install the latest version of Vim, and version 2.35.0-1 of Git.

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).

C++ Not Installed In Cygwin

I just installed Cygwin and can launch a bash shell from windows, do ls, emacs, vi , etc. However, when I do g++ it says command not found.
I thought g++ was installed by default in Cygwin? If that's not the case, what are the exact categories under which I can add g++ as a package to my cygwin?
Did you install the Devel packages?
I would suggest you read this tutorial to get up and running.
It's a good idea to just install everything with CygWin. When you run setup, just click on the circular icon at the top level until it reads "Full" rather then "Default" - that will install all the packages.
I've sometimes had trouble installing single packages due to dependencies but a full install is not affected by that same problem.
Disk space is cheap, your time spent trying to figure out why things don't work is not.

Resources