Change GtkAda-intl.gpd to GtkAda-intl.adb with build_skeleton.pl

After some time I think I found a way to install GtkAda, now I found that gtkada-intl.adb is not present but there is gtkada-intl.gpd which looks very much at gtkada-intl.adb.There are some differences a number of lines starting with for instance #if and #end and so on. ban example is

function Gettext (Msg : UTF8_String) return UTF8_String is
function Internal (Msg : UTF8_String) return chars_ptr;
pragma Import (C, Internal, “gettext”);
begin
#if HAVE_GETTEXT then
return Value (Internal (Msg & ASCII.NUL));
#else
– return Msg;
#end if;
end Gettext;

In the very large comment of the gtkada-intl.ads file is suggested that build_skeleton.pl can create gtkada-intl.adb. Can anybody can tell me how or have an already converted version of the file.

this file is created during (usual in Linux world) configure; make command sequence. Look at Makefile.in:

src/gtkada-intl.adb: src/gtkada-intl.gpb Makefile
        gnatprep -DGETTEXT_INTL=$(GETTEXT_INTL) -DHAVE_GETTEXT=$(HAVE_GETTEXT) src/gtkada-intl.gpb $@

configure command (this is a shell script) detects available library and creates Makefile Then make executes commands from Makefile and runs (something like):

gnatprep -DGETTEXT_INTL=False -DHAVE_GETTEXT=False src/gtkada-intl.gpb src/gtkada-intl.adb

and gnatprep creates the file.

I did not think that the operating system would be a problem but I use a windows 11 system and know nothing about Linux

Where are you going get Gtk+ for Windows from? GtkAda depends on Gtk+.

Once again I propose you to install Alire and use it. It will be much simpler to you than reinventing gtkada installation procedure. :folded_hands:

I am using the source from Releases · AdaCore/gtkada but in alire it asks for libgtk3. In various answers alire should be the answer to the .gpd problem but I cannot find it. alre said missing

Just use alr with gtkada in your crate and alire will download and install libgtk3 for you.

Gtk+ is a C library, while GtkAda is Ada interface for it. GtkAda depends on Gtk+. GtkAda source release doesn’t include Gtk+ binaries. Alire will install gtk+ (libgtk) for you. Just try

alr init --bin my_gtk_app
cd my_gtk_app
alr with gtkada
# Edit src/my_gtk_app.adb
alr run

What errors do you have with this?

Sure? What about gtksourceview or svg? It is not that simple.

Gtk is a conglomerate of a huge number of subprojects one cannot bundle into a single packet. If Alire wanted to do it seriously it would have separate crates for countless Gtk components like atk, gdk, cairo, pango … ad infinitum. Not to mention themes, fonts and other stuff.

to Max: The following error:Changes to dependency solution:

New solution is incomplete.

  •    gtkada     26.0.0    (new)
    

+b make 4.3.0 (new,indirect,executable in path)
+b pkg_config 1.7.3 (new,indirect,executable in path)
Missing:
+! libgtk3 >=3.24.24 (new,indirect,missing)

PS C:\GNAT\gtkada> alr run
Note: Building gtkada=0.1.0-dev/gtkada.gpr…
Setup
[mkdir] object directory for project Gtkada
[mkdir] exec directory for project Gtkada
Compile
[Ada] gtkada.adb
gprbuild: spawn failed with ERRNO = 2 (No such file or directory)
gprbuild: failed command was: c:\users\familie dries\appdata\local\alire\cache\toolchains\gnat_native_15.2.1_346e2e00\bin\gcc.exe -c -x ada -gnatA -Og -ffunction-sections -fdata-sections -g -gnatwa -gnatw.X -gnatVa -gnaty3 -gnatya -gnatyA -gnatyB -gnatyb -gnatyc -gnaty-d -gnatye -gnatyf -gnatyh -gnatyi -gnatyI -gnatyk -gnatyl -gnatym -gnatyn -gnatyO -gnatyp -gnatyr -gnatyS -gnatyt -gnatyu -gnatyx -gnatW8 -gnatec=C:\Users\FAMILI~1\AppData\Local\Temp\GPR.376\GNAT-TEMP-000003.TMP -gnatem=C:\Users\FAMILI~1\AppData\Local\Temp\GPR.376\GNAT-TEMP-000004.TMP C:\GNAT\gtkada\src\gtkada.adb
ERROR: Command [“gprbuild”, “-s”, “-j0”, “-p”, “-P”, “C:\GNAT\gtkada\gtkada.gpr”] exited with code 7
ERROR: Build failed

It looks like you have an issue with the compiler. Try to reinstall it by

  • removing c:\users\familie dries\appdata\local\alire\cache\toolchains folder
  • running alr toolchain --select gprbuild gnat_native

Then try again.

PS C:\GNAT\gtkada> alr run
Note: Building gtkada=0.1.0-dev/gtkada.gpr…
Compile
[Ada] gtkada.adb
gprbuild: spawn failed with ERRNO = 2 (No such file or directory)
gprbuild: failed command was: c:\users\familie dries\appdata\local\alire\cache\toolchains\gnat_native_15.2.1_346e2e00\bin\gcc.exe -c -x ada -gnatA -Og -ffunction-sections -fdata-sections -g -gnatwa -gnatw.X -gnatVa -gnaty3 -gnatya -gnatyA -gnatyB -gnatyb -gnatyc -gnaty-d -gnatye -gnatyf -gnatyh -gnatyi -gnatyI -gnatyk -gnatyl -gnatym -gnatyn -gnatyO -gnatyp -gnatyr -gnatyS -gnatyt -gnatyu -gnatyx -gnatW8 -gnatec=C:\Users\FAMILI~1\AppData\Local\Temp\GPR.31432\GNAT-TEMP-000003.TMP -gnatem=C:\Users\FAMILI~1\AppData\Local\Temp\GPR.31432\GNAT-TEMP-000004.TMP C:\GNAT\gtkada\src\gtkada.adb
ERROR: Command [“gprbuild”, “-s”, “-j0”, “-p”, “-P”, “C:\GNAT\gtkada\gtkada.gpr”] exited with code 7
ERROR: Build failed
After your remove and the toolchain I got with ale run the error message above

It looks like you have a space in the “user name”, right? I guess this causes the problem :frowning:

I never got a problem with this before. I thought that was possible in Windows.
When I change that can that gives problems elsewhere?

Yes, it (spaces in file names) should work, but apparently it doesn’t work in case of gprbuild, I guess. You can try to create another user just to try if this helps.

alire just calls the package manager of your system. For windows, it’s pacman -S mingw-w64-x86_64-gtk3. The package manager then installs the required dependencies (atk, cairo, pixbuf2, pango…) as they are defined by your distribution. There’s no magic. You can look at alire-index on github link.

Fair enough, but I prefer direct installation or else dependencies properly handled. If you do that with Alire then it must include all dependencies required. It does not seem so if people get installation errors. Moreover, there must be no any build. The end user does not have to build Gtk, he should not do GtkAda either.

@ldries46 Did you name your own project gtkada?

Building gtkada=0.1.0-dev/gtkada.gpr is kind of suspicious…

ThyMythos : yes I do so because I want create readability also in the directory structure. The structure until now is:
C:
C:\GNAT
C:\GNAT\GPS , C:\GNAT\gcc , C:\GNAT\gprbuild
So the gtkada installation should logically C:\GNAT\GtkAda
Ailre creates its own directory name. That means installation has one level more including a directory that contains only another directory. So my project name has to be GtkAda create the logical naming I want

That’s the problem of your package manager/distribution, not of alire.

As a pure hobbyist, I would have just gave up with Ada a few years ago as the tooling was really painfull at that time, with almost no way to find interesting/useful libraries, and a headache to integrate in my own projects. Alire is not perfect but really ease the entry level. And your complaints are mostly against your package manager, not alire :slight_smile:

1 Like

After all this thread, I still don’t understand what you want to achieve.