Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

BEAUGY Alexandre-2
Dear all,

For those who still need to work with Gtk2 to build their Ada graphical
solution, but don't want to stay stuck with gnat(-pro) 7.2.2, and so using
gnat(-pro)-17.x (or higher), I've managed to setup a set of patches to allow
anyone to build a Gtk2 Ada project with gnat-pro-17.x (or higher).

First of all, I want to clarify a few things to explain my context:
- My target is el7.x86_64
- I want and I need to work with the latest gnat(-pro) available
- The GTK HMIs of my solution are stuck in gtk2 in the short-term (gtk3
migration only considered at a longer term)
- I don't want to carry an Adacore gtk2 binaries bundle at runtime (i.e.
gtk+-2.24.8-x86_64-pc-linux-gnu.tgz), so I'm working with gtk2 libraries
provided by el7

Now that the context is given, here is my approach:

First of all, to avoid any misunderstanding, the solution I will detail below
is mainly based on Fedora Project's work on gtkada2 (thanks to them), that's
why a big part of my solution come from there. But, as you will soon notice, I
did not do the full Fedora Project job, as I skipped all the "Fedora
Project -- Ada Packaging" specific stuff.

So let's go :

1. I first studied the patches extracted from GtkAda-2.24.2-19.fc24.src.rpm
and applicable to gtkada2-2.24.2

2. Then I did a(n incomplete) work of creating an equivalent set of patches
adapted to gtkada2-2.24.4, which led me to the following:
2.a. Patches *not* adapted:
(considered Fedora Project specific, or too much time consuming to fix, or
even already fixed in 2.24.*4*)
- GtkAda-2.14.1-multilib_gpr.patch
- GtkAda-2.14.1-multilib_gtkada-config.patch
- GtkAda-2.18.0-gl_placement.patch
- GtkAda-2.18.0-no_include_gmain.patch
- GtkAda-2.24.2-configuration-5.patch
- GtkAda-2.24.2-source_dir.patch
2.b. Patches adapted to gtkada2-2.24.2:
- GtkAda-2.18.0-link_as_needed.patch
- GtkAda-2.18.0-lm.patch
- GtkAda-2.24.2-man_xref.patch
- GtkAda-2.24.2-no_extern_inline.patch
- GtkAda-2.24.2-stringcopy.patch

3. I fixed GPR errors (non-blocking in gnat-pro-17.2 /*blocking* in
gnat-pro-19.1) in one last patch
(this patch includes one snippet -- simplified version of one debian GNU/Linux
script: library-cfg.sh
(https://salsa.debian.org/debian/ncurses/blob/stretch/Ada95/src/library-cfg.sh)
- GtkAda-2.24.4-gnatmake_cargs.patch

4. I determined the following order of application of patches based on
GtkAda.spec (from GtkAda-2.24.2-19.fc24.src.rpm):
4.a. GtkAda-2.18.0-lm.patch
4.b. GtkAda-2.18.0-link_as_needed.patch
4.c. GtkAda-2.24.2-man_xref.patch
4.d. GtkAda-2.24.2-stringcopy.patch
4.e. GtkAda-2.24.2-no_extern_inline.patch
4.f. GtkAda-2.24.4-gnatmake_cargs.patch

5. Then I built my gtkada2 that way:
  rm -rf /var/tmp/maestro-env.WK01yNE3Io/gtkada-2.24.4-src
  tar -C /var/tmp/maestro-env.WK01yNE3Io -xf gtkada-2.24.4-src.tgz
  pushd /var/tmp/maestro-env.WK01yNE3Io/gtkada-2.24.4-src
  patch -Np1 -i GtkAda-2.18.0-lm.patch
  patch -Np1 -i  GtkAda-2.18.0-link_as_needed.patch
  patch -Np1 -i GtkAda-2.24.2-man_xref.patch
  patch -Np1 -i GtkAda-2.24.2-stringcopy.patch
  patch -Np1 -i GtkAda-2.24.2-no_extern_inline.patch
  patch -Np1 -i GtkAda-2.24.4-gnatmake_cargs.patch
  ./configure
  make
  make install
  popd

I finally checked that my solution build and run properly with my newly built
gtkada2-2.24.4.el7.x86-64.
It did!
Successfully tested with gnat-pro-17.2 and gnat-pro-19.1.

Hope this helps.

Best Regards,

--
Alexandre BEAUGY
[@@ OPEN @@]


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada

gtkada-2.24.4-src-patches.tar.xz (5K) Download Attachment
smime.p7s (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

Björn Persson-3
BEAUGY Alexandre wrote:
> First of all, to avoid any misunderstanding, the solution I will detail below
> is mainly based on Fedora Project's work on gtkada2 (thanks to them),

You're welcome. It's good to know that my work is useful to people.

> 2. Then I did a(n incomplete) work of creating an equivalent set of patches
> adapted to gtkada2-2.24.4,

I thought we had the last release of GTKada 2 in Fedora. Where did you
find 2.24.4?

> - GtkAda-2.24.2-stringcopy.patch

That patch is outdated. I have fixed more format string bugs since
Fedora 24. I have no proof that they're exploitable, but that doesn't
mean that they aren't. It's best to not take the risk:

https://src.fedoraproject.org/rpms/GtkAda/raw/master/f/GtkAda-2.24.2-format_security.patch

Björn Persson

_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada

attachment0 (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

BEAUGY Alexandre-2
Hi Björn,

About gtkada2-2.24.4, it came from a commercial version of GNAT.
I'm not that much aware of what is the latest released GPL version of gtkada2, but from what I can see on debian packages webpage, there exist a source package for gtkada2-gpl-2.24.4-src (http://deb.debian.org/debian/pool/main/libg/libgtkada/libgtkada_2.24.4dfsg.orig.tar.xz).

Also, thanks for the string copy patch update.

Br,

--
Alexandre

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Björn Persson
Envoyé : jeudi 7 mars 2019 15:20
À : [hidden email]
Objet : Re: [gtkada] Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

BEAUGY Alexandre wrote:
> First of all, to avoid any misunderstanding, the solution I will
> detail below is mainly based on Fedora Project's work on gtkada2
> (thanks to them),

You're welcome. It's good to know that my work is useful to people.

> 2. Then I did a(n incomplete) work of creating an equivalent set of
> patches adapted to gtkada2-2.24.4,

I thought we had the last release of GTKada 2 in Fedora. Where did you find 2.24.4?

> - GtkAda-2.24.2-stringcopy.patch

That patch is outdated. I have fixed more format string bugs since Fedora 24. I have no proof that they're exploitable, but that doesn't mean that they aren't. It's best to not take the risk:

https://src.fedoraproject.org/rpms/GtkAda/raw/master/f/GtkAda-2.24.2-format_security.patch

Björn Persson

_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada

smime.p7s (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

BEAUGY Alexandre-2
In reply to this post by BEAUGY Alexandre-2
Dear all,

Please find in attachment one last patch (for (gnatpro|gps)-19.1 only).

This patch upgrades gtkada2 GPR files content in order to be able to use
them within gps-19.1 (otherwise it complains on "static-pic" kind not
defined).

Br,

--
Alexandre BEAUGY
[@@ OPEN @@]

-----Message d'origine-----
De : [hidden email]
[mailto:[hidden email]] De la part de BEAUGY Alexandre
Envoyé : mercredi 6 mars 2019 14:43
À : [hidden email]
Objet : [gtkada] Patches for gtkada-2.24.4 with gnat-pro-17.x (and higher)

Dear all,

For those who still need to work with Gtk2 to build their Ada graphical
solution, but don't want to stay stuck with gnat(-pro) 7.2.2, and so using
gnat(-pro)-17.x (or higher), I've managed to setup a set of patches to allow
anyone to build a Gtk2 Ada project with gnat-pro-17.x (or higher).

First of all, I want to clarify a few things to explain my context:
- My target is el7.x86_64
- I want and I need to work with the latest gnat(-pro) available
- The GTK HMIs of my solution are stuck in gtk2 in the short-term (gtk3
migration only considered at a longer term)
- I don't want to carry an Adacore gtk2 binaries bundle at runtime (i.e.
gtk+-2.24.8-x86_64-pc-linux-gnu.tgz), so I'm working with gtk2 libraries
provided by el7

Now that the context is given, here is my approach:

First of all, to avoid any misunderstanding, the solution I will detail
below is mainly based on Fedora Project's work on gtkada2 (thanks to them),
that's why a big part of my solution come from there. But, as you will soon
notice, I did not do the full Fedora Project job, as I skipped all the
"Fedora Project -- Ada Packaging" specific stuff.

So let's go :

1. I first studied the patches extracted from GtkAda-2.24.2-19.fc24.src.rpm
and applicable to gtkada2-2.24.2

2. Then I did a(n incomplete) work of creating an equivalent set of patches
adapted to gtkada2-2.24.4, which led me to the following:
2.a. Patches *not* adapted:
(considered Fedora Project specific, or too much time consuming to fix, or
even already fixed in 2.24.*4*)
- GtkAda-2.14.1-multilib_gpr.patch
- GtkAda-2.14.1-multilib_gtkada-config.patch
- GtkAda-2.18.0-gl_placement.patch
- GtkAda-2.18.0-no_include_gmain.patch
- GtkAda-2.24.2-configuration-5.patch
- GtkAda-2.24.2-source_dir.patch
2.b. Patches adapted to gtkada2-2.24.2:
- GtkAda-2.18.0-link_as_needed.patch
- GtkAda-2.18.0-lm.patch
- GtkAda-2.24.2-man_xref.patch
- GtkAda-2.24.2-no_extern_inline.patch
- GtkAda-2.24.2-stringcopy.patch

3. I fixed GPR errors (non-blocking in gnat-pro-17.2 /*blocking* in
gnat-pro-19.1) in one last patch
(this patch includes one snippet -- simplified version of one debian
GNU/Linux
script: library-cfg.sh
(https://salsa.debian.org/debian/ncurses/blob/stretch/Ada95/src/library-cfg.
sh)
- GtkAda-2.24.4-gnatmake_cargs.patch

4. I determined the following order of application of patches based on
GtkAda.spec (from GtkAda-2.24.2-19.fc24.src.rpm):
4.a. GtkAda-2.18.0-lm.patch
4.b. GtkAda-2.18.0-link_as_needed.patch
4.c. GtkAda-2.24.2-man_xref.patch
4.d. GtkAda-2.24.2-stringcopy.patch
4.e. GtkAda-2.24.2-no_extern_inline.patch
4.f. GtkAda-2.24.4-gnatmake_cargs.patch

5. Then I built my gtkada2 that way:
  rm -rf /var/tmp/maestro-env.WK01yNE3Io/gtkada-2.24.4-src
  tar -C /var/tmp/maestro-env.WK01yNE3Io -xf gtkada-2.24.4-src.tgz
  pushd /var/tmp/maestro-env.WK01yNE3Io/gtkada-2.24.4-src
  patch -Np1 -i GtkAda-2.18.0-lm.patch
  patch -Np1 -i  GtkAda-2.18.0-link_as_needed.patch
  patch -Np1 -i GtkAda-2.24.2-man_xref.patch
  patch -Np1 -i GtkAda-2.24.2-stringcopy.patch
  patch -Np1 -i GtkAda-2.24.2-no_extern_inline.patch
  patch -Np1 -i GtkAda-2.24.4-gnatmake_cargs.patch
  ./configure
  make
  make install
  popd

I finally checked that my solution build and run properly with my newly
built gtkada2-2.24.4.el7.x86-64.
It did!
Successfully tested with gnat-pro-17.2 and gnat-pro-19.1.

Hope this helps.

Best Regards,

--
Alexandre BEAUGY
[@@ OPEN @@]


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada

GtkAda-2.24.4-gpr_upgrade.patch.xz (1K) Download Attachment
smime.p7s (9K) Download Attachment