I found the solution.
I write all the story to install gnat-2018 and gtkada-2018 (Adacore) in Ubuntu 18.04.1 from scratch.
Preparation
#1--#8 are just for my memory.
- Install Ubuntu 18.04.1 from scratch
- Install google-chrome
sudo apt install chromium-browser
sudo apt install synaptic
gsettings set org.gnome.desktop.session idle-delay 1800
sudo apt update
sudo apt upgrade
Reboot OS
sudo apt install make
sudo apt install gcc
sudo apt install gprbuild
sudo apt update
sudo apt upgrade
Now, preparations were done.
GNAT Installation
- Download file from https://www.adacore.com/download/more
Gnat-community-2018-20180528-x86_64-linux-bin
- Set the file executable +x or tick property-permission-Execute in Nautilus.
Execute Gnat-community-2018-20180528-x86_64-linux-bin without sudo
sudo causes a warning in the installation process, then do without sudo in terminal, or just
double-click the file in Nautilus.
Installation directory is required soon, enter e.g. /usr/gnat
- After a few minutes, installation Wizard finishes.
- Set PATH.
e.g. export PATH=/usr/gnat/bin:$PATH
e.g. in ~/.bashrc
Now, GPS works and you can use all of Ada functionalities except gtkada.
- Close Terminal
gtkada Preparation
If you want to install in the same directory, e.g. /usr/gnat, then skip next #21.
- gtkada in another directory
If you want to install gtkada in another directory (e.g. /usr/gtkada), do in Terminal:
sudo visudo
Add the same PATH in the "Default" line as below (e.g. /usr/gnat/bin):
Defaults secure_path="/usr/gnat/bin:/usr/local/sbin:...
To save and quit in visudo
are tricky, do as follows:
^o BS BS BS BS Enter Y Y ^x
Enter to check again to make sure, sudo visudo
, then exit with ^x
after the checking.
From next, get the missing file libxcb-xlib-so.0.
The file is not available directly, then get the RPM file which includes it, and convert to the deb file format to install Ubuntu to get it out.
- Go to http://rpm.pbone.net/index.php3/stat/3/limit/9/srodzaj/1/dl/40/search/libxcb.so.1/field[]/1/field[]/2
- Find PCLinuxOS and go to the link www.pclinuxos.com/pclinuxos/apt/pclinuxos/64bit/RPMS.x86_64/libxcb-1.12-4pclos2017.x86_64.rpm
- Download ftp.ntua.gr libxcb-1.12-4pclos2017.x86_64.rpm
- Set the file executable:
libxcb-1.12-4pclos2017.x86_64.rpm (159.9kB).
Install alien which can convert the RPM file to the DEB file.
sudo apt install alien
Convert from RPM to DEB
sudo alien libxcb-1.12-4pclos2017.x86_64.rpm
libxcb_1.12-5_amd64.deb was generated.
Now, 2 files are here:
mori@envy:~/Downloads$ ls -al lib*
-rwxrwxr-x 1 mori mori 159903 Dec 27 18:12 libxcb-1.12-4pclos2017.x86_64.rpm
-rw-r--r-- 1 root root 152024 Jan 1 12:43 libxcb_1.12-5_amd64.deb
- Install DEB package:
sudo dpkg -i libxcb_1.12-5_amd64.deb
- The target file is created in /usr/lib64 directory (not in /usr/lib)
mori@VB:/usr/lib64$ ls -al libxcb-xlib*
lrwxrwxrwx 1 root root 31 Dec 25 16:22 libxcb-xlib.so.0 -> ../../usr/lib64/libxcb.so.1.1.0
lrwxrwxrwx 1 root root 31 Dec 25 16:22 libxcb-xlib.so.0.0.0 -> ../../usr/lib64/libxcb.so.1.1.0
The real file is libxcb.so.1.1.0, and libxcb-xlib.so.0 is just the sym-link.
Now, save only libxcb.so.1.1.0 to another safety place, I used a USB drive.
Uninstall the deb package:
sudo dpkg -r libxcb
Now, you got the missing file, and set the file into the gtkada installer next.
- Download gtkada-2018 (choose the platform and year)
gtkada-community-2018-20180523-x86_64-linux-bin.tar.gz 136.9 MiB May 24 2018
- Set it executable
- Extract file
- Copy the fie libxcb.so.1.1.0 into gtk-bin/lib64 directory:
Downloads/gtkada-community-community-2018-x86_64-linux-bin/gtk-bin/lib64
- Set libxcb.so.1.1.0 executable
- Set sym-link
gtk-bin/lib64$ sudo ln -s ./libxcb.so.1.1.0 ./libxcb-xlib.so.0
- Check if the sym-link is created
/Downloads/gtkada-community-community-2018-x86_64-linux-bin/gtk-bin/lib64$ ls -al libxcb*
-rwxr-xr-x 1 mori mori 154424 Aug 16 2017 libxcb.so.1.1.0
lrwxrwxrwx 1 root root 17 Dec 25 22:18 libxcb-xlib.so.0 -> ./libxcb.so.1.1.0
- Copy once more libxcb.so.1.1.0 into gtk-bin/lib directory:
Downloads/gtkada-community-community-2018-x86_64-linux-bin/gtk-bin/lib
- Set libxcb.so.1.1.0 executable
- Set sym-link
gtk-bin/lib$ sudo ln -s ./libxcb.so.1.1.0 ./libxcb-xlib.so.0
- Check if the sym-link is created
/Downloads/gtkada-community-community-2018-x86_64-linux-bin/gtk-bin/lib$ ls -al libxcb*
-rwxr-xr-x 1 mori mori 154424 Aug 16 2017 libxcb.so.1.1.0
lrwxrwxrwx 1 root root 17 Dec 25 22:18 libxcb-xlib.so.0 -> ./libxcb.so.1.1.0
Now you got prepared all the settings.
gtkada Installation
- Downloads/gtkada-community-community-2018-x86_64-linux-bin$
sudo ./doinstall
Set installation directory /usr/gnat (same) or /usr/gtkada or else.
After a few minutes, installation finishes.
Set gtkada Environments
Do not follow the installer's comments, they are for some other OS's.
Now, the bottom of ~/.bashrc is:
export PATH=/usr/gnat/bin:$PATH
Add one more line like this
. ./gtkada-env.sh
(Note: dot-space-dot)
Create a text file ~/gtkada-env.sh with the following text:
prefix="/usr/gnat"
LD_LIBRARY_PATH_64=$prefix/lib:$LD_LIBRARY_PATH_64
PKG_CONFIG_PATH=$prefix/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
GDK_PIXBUF_MODULE_FILE=$prefix/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
GDK_PIXBUF_MODULEDIR=$prefix/lib/gdk-pixbuf-2.0/2.10.0/loaders/
FONTCONFIG_FILE=/etc/fonts/fonts.conf
XDG_DATA_DIRS=$prefix/share:$XDG_DATA_DIRS
XDG_CONFIG_DIRS=$prefix/etc:$XDG_CONFIG_DIRS
GSETTINGS_BACKEND=memory
GLADE_BASE_DIR=$prefix
GPR_PROJECT_PATH=$prefix/lib/gnat:$GPR_PROJECT_PATH
export LD_LIBRARY_PATH_64
export PKG_CONFIG_PATH
export GDK_PIXBUF_MODULE_FILE
export GDK_PIXBUF_MODULEDIR
export FONTCONFIG_FILE
export XDG_DATA_DIRS
export XDG_CONFIG_DIRS
export GSETTINGS_BACKEND
export GLADE_BASE_DIR
export GPR_PROJECT_PATH
NOTE1: The first line should be changed if you installed into another directory,
e.g. /usr/gtkada then change prefix="/usr/gtkada"
NOTE2: 1/05/2019 FONTCONFIG_FILE was changed.
- Close Terminal
Test Build Functionalities
The easiest way is to use GPS Wizard
- Create a test directory and run gps
- ~/ada/simplegtkada$
gps
- "create new project", "GtkAda", "Simple Window" can make a simple Hello world.
- Build and Run can check the functionality.
- Check if the Terminal application execution doesn't output any errors:
- ~/ada/simplegtkada/obj$
./main
Full build test using testgtk
- Copy all the install files with -a option to another directory.
- ~/Downloads$
cp -a gtkada-community-community-2018-x86_64-linux-bin gtkada-test
- Delete all files in ~/Downloads/gtkada-test/testgtk/obj
- Delete 2 files testgtk and test_rtree in ~/Downloads/gtkada-test/testgtk
- ~/Downloads/gtkada-test/testgtk$
gprbuild
- All testgtk files should be compiled and linked again.
- Try
./testgtk
and check the functionalities.
- ~/Downloads/gtkada-test/testgtk$
./testgtk
Known Issue
gedit issue
gedit from Terminal can't startup, though Nautilus can start it up.
The environment settings should affect it, but I couldn't fix it.
Let me know if anyone know the solution.
Compiler reference warnings
These warnings are displayed at both static and static-pic compilings, but I think we can ignore them (they did not happen at 2017):
gtkada-canvas_view.ads:590:07: warning: formal parameter "At_Point" is not referenced
gtkada-canvas_view.ads:591:07: warning: formal parameter "Context" is not referenced
gtkada-canvas_view.ads:792:07: warning: formal parameter "Item" is not referenced
gtkada-canvas_view.ads:1984:07: warning: formal parameter "At_Point" is not referenced
gtkada-canvas_view.ads:1985:07: warning: formal parameter "Context" is not referenced
gtkada-canvas_view.ads:1992:07: warning: formal parameter "View" is not referenced
A Benefit of gtkada 2018 Version
It doesn't display the error messages anymore which were usually in 2016 and 2017 versions such as:
Gtk-Message: Failed to load module "unity-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
when starting up GPS and gtkada applications. It makes me feel better.